Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wpreimes committed May 4, 2024
1 parent e267023 commit 52ede22
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ norecursedirs =
build
.tox
testpaths = tests
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
doc_example: marks tests based on jupyter notebooks (deselect with '-m "not doc_example"')

[aliases]
dists = bdist_wheel
Expand Down
7 changes: 4 additions & 3 deletions src/repurpose/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def parallel_process_async(
```
verbose: bool, optional (default: False)
Print all logging messages to stdout, useful for debugging.
Only effective when logging is activated.
progress_bar_label: str, optional (default: "Processed")
Label to use for the progress bar.
backend: Literal["threading", "multiprocessing", "loky"] = "loky"
Expand All @@ -264,13 +265,13 @@ def parallel_process_async(
List of return values from each function call or None if no return
values are found.
"""
if STATIC_KWARGS is None:
STATIC_KWARGS = dict()

if activate_logging:
logger = logging.getLogger(logger_name)
logger.setLevel(loglevel.upper())

if STATIC_KWARGS is None:
STATIC_KWARGS = dict()

if verbose:
# in this case we also print ALL log messages
streamHandler = logging.StreamHandler(sys.stdout)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestRegularImageStackNoCollocation(unittest.TestCase):
Time series and image stack match exactly (grid and timestamps)
"""
def setUp(self) -> None:
self.timestamps = pd.date_range('2020-01-01', '2020-01-02', freq='6H')
self.timestamps = pd.date_range('2020-01-01', '2020-01-02', freq='6h')
self.writer = Regular3dimImageStack.from_genreg(
resolution=0.25, extent=bbox_spain, timestamps=self.timestamps,
time_collocation=False, reference_time="1900-01-01T00:00:00",
Expand Down Expand Up @@ -125,7 +125,7 @@ class TestRegularImageStackWithCollocation(unittest.TestCase):
"""
def setUp(self) -> None:
grid_spain = genreg_grid(1, 1, *bbox_spain, origin="bottom")
self.img_timestamps = pd.date_range('2020-01-01', '2020-01-02', freq='6H')
self.img_timestamps = pd.date_range('2020-01-01', '2020-01-02', freq='6h')
# 1h, 3.5h, 0.125h, 5.9999h, 0h
self.offsets = np.array([3600, 3600*3.5, 3600*0.125, 3600*5.9999, 0.])
self.timeoffsets = np.array([timedelta(seconds=o) for o in self.offsets])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ts2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def postprocess_func(stack, vars, fillvalue=0):
stack[var].values = np.nan_to_num(stack[var].values, nan=fillvalue)
return stack

timestamps_image = pd.date_range('2020-07-01', '2020-07-31', freq='6H')
timestamps_image = pd.date_range('2020-07-01', '2020-07-31', freq='6h')
timestamps_ts = timestamps_image[20:50]

# 2020070412 and 2020070418 are missing:
Expand Down

0 comments on commit 52ede22

Please sign in to comment.