Skip to content

Commit b6f7041

Browse files
authored
Fix plot install (#95)
* Fix plot install * Fix some warnings * Use multiprocessing backend * Update builds * Update cartopy version * Update build * Add macos buillds back in * Switch back to threading backend * Update changelog
1 parent 17ad14d commit b6f7041

File tree

8 files changed

+21
-15
lines changed

8 files changed

+21
-15
lines changed

.github/workflows/build.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
auto-update-conda: true
4343
python-version: ${{ matrix.python-version }}
4444
channel-priority: flexible
45-
# mamba-version: "*"
4645
activate-environment: ismn
4746
auto-activate-base: false
4847
- name: Print environment infos
@@ -64,8 +63,8 @@ jobs:
6463
- name: Install plot requirements and run plot tests
6564
shell: bash -l {0}
6665
run: |
67-
conda install -c conda-forge cartopy
6866
pip install -e .[plot]
67+
python -c "import matplotlib, cartopy"
6968
pytest -m "requires_plot" --cov-append
7069
- name: Export Environment
7170
shell: bash -l {0}

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Unreleased changes in master branch
66
===================================
77
-
88

9+
Version 1.5.2
10+
=============
11+
- Fixed dependency list for `ismn[plot]` install (PyQt5 and cartopy>=0.22)
12+
- Use `repurpose.process.parallel_process` now
13+
914
Version 1.5.1
1015
=============
1116
- Fixed a bug where missing optional requirements (xarray, dask) lead to an error

setup.cfg

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ exclude =
5454
# `pip install ismn[plot]` like:
5555
plot =
5656
matplotlib
57-
cartopy
57+
cartopy>=0.22
58+
PyQt5
5859

5960
# only packages required for xarray conversion
6061
xr =
@@ -102,8 +103,10 @@ norecursedirs =
102103
testpaths = tests
103104

104105
markers =
105-
requires_plot: Run tests for parts of the ismn package that require optional dependencies from `pip install ismn[plot]`
106-
requires_xr: Run tests for parts of the ismn package that require optional dependencies from `pip install ismn[xr]`
106+
requires_plot: Marks tests for parts of the ismn package that require optional dependencies from `pip install ismn[plot]`
107+
requires_xr: Marks tests for parts of the ismn package that require optional dependencies from `pip install ismn[xr]`
108+
data_from_zip: Marks tests that read data from zip file
109+
107110

108111
[aliases]
109112
dists = bdist_wheel

src/ismn/filecollection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from typing import List, Tuple
3333
import pandas as pd
3434
from collections import OrderedDict
35-
from repurpose.process import parallel_process_async
35+
from repurpose.process import parallel_process
3636
import traceback
3737

3838
from ismn.base import IsmnRoot
@@ -270,7 +270,7 @@ def build_from_scratch(
270270
'stat_dir': process_stat_dirs
271271
}
272272

273-
res = parallel_process_async(
273+
res = parallel_process(
274274
_read_station_dir, ITER_KWARGS=ITER_KWARGS,
275275
STATIC_KWARGS=STATIC_KWARGS,
276276
n_proc=n_proc, show_progress_bars=True,

src/ismn/interface.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# SOFTWARE.
2323

2424
import os
25-
from repurpose.process import parallel_process_async # keep this import
25+
from repurpose.process import parallel_process # keep this import
2626
import numpy as np
2727
from pathlib import Path
2828
from tempfile import gettempdir
@@ -1020,5 +1020,4 @@ def print_climate_dict(self) -> None:
10201020

10211021
def close_files(self):
10221022
# close all open filehandlers
1023-
self.__file_collection.close()
1024-
1023+
self.__file_collection.close()

tests/test_components.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def test_sensor_coverage(self):
290290
start = self.sensor.metadata['timerange_from'].val.to_pydatetime()
291291
assert self.sensor.get_coverage(start=start-timedelta(days=100)) < cov
292292
np.testing.assert_almost_equal(
293-
self.sensor.get_coverage(freq='2H'), 113.492, decimal=3)
293+
self.sensor.get_coverage(freq='2h'), 113.492, decimal=3)
294294

295295
def test_sensor_attributes(self):
296296
"""

tests/test_filecollection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def setUpClass(cls):
131131
cls.coll = IsmnFileCollection.build_from_scratch(testdata_path_unzipped)
132132

133133

134-
@pytest.mark.zip
134+
@pytest.mark.data_from_zip
135135
class Test_FileCollectionCeopSepZipped(Test_FileCollectionCeopSepUnzipped):
136136
# same tests as for ceop sep format,
137137

@@ -149,7 +149,7 @@ def setUpClass(cls):
149149
cls.coll = IsmnFileCollection.build_from_scratch(testdata_zip_path)
150150

151151

152-
@pytest.mark.zip
152+
@pytest.mark.data_from_zip
153153
class Test_FileCollectionHeaderValuesZipped(Test_FileCollectionCeopSepUnzipped):
154154
# same tests as for ceop sep format,
155155
@classmethod

tests/test_interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def setUp(self) -> None:
310310
self.ds = ISMN_Interface(self.testdata)
311311

312312

313-
@pytest.mark.zip
313+
@pytest.mark.data_from_zip
314314
class Test_ISMN_Interface_CeopZipped(Test_ISMN_Interface_CeopUnzipped):
315315
@classmethod
316316
def setUpClass(cls):
@@ -332,7 +332,7 @@ def setUp(self) -> None:
332332
self.ds = ISMN_Interface(self.testdata_zip_path)
333333

334334

335-
@pytest.mark.zip
335+
@pytest.mark.data_from_zip
336336
class Test_ISMN_Interface_HeaderValuesZipped(Test_ISMN_Interface_CeopUnzipped):
337337
@classmethod
338338
def setUpClass(cls):

0 commit comments

Comments
 (0)