diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a6fcceed..bbc0662c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -11,7 +11,7 @@ jobs: matrix: # os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, windows-latest] - python_version: [3.7, 3.8, 3.9] + python_version: [3.7, 3.8, 3.9, '3.10'] name: Run py eddy tracker build tests runs-on: ${{ matrix.os }} defaults: diff --git a/doc/environment.yml b/doc/environment.yml index 7dcb504d..9d882911 100644 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -2,7 +2,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.8 + - python=3.10 - ffmpeg - pip: - sphinx-gallery diff --git a/requirements.txt b/requirements.txt index 477cf32d..497344e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ matplotlib -netCDF4 -numba>=0.53 -numpy<1.21 opencv-python -pint +pint==0.18 polygon3 pyyaml requests scipy zarr +netCDF4<1.6 +numpy<1.23 +numba<0.56 \ No newline at end of file diff --git a/src/py_eddy_tracker/dataset/grid.py b/src/py_eddy_tracker/dataset/grid.py index 797e0482..30cdd863 100644 --- a/src/py_eddy_tracker/dataset/grid.py +++ b/src/py_eddy_tracker/dataset/grid.py @@ -402,6 +402,14 @@ def load(self): self.setup_coordinates() + @staticmethod + def get_mask(a): + if len(a.mask.shape): + m = a.mask + else: + m = ones(a.shape, dtype='bool') if a.mask else zeros(a.shape, dtype='bool') + return m + @staticmethod def c_to_bounds(c): """ @@ -1126,7 +1134,7 @@ def _low_filter(self, grid_name, w_cut, factor=8.0): bins = (x_array, y_array) x_flat, y_flat, z_flat = x.reshape((-1,)), y.reshape((-1,)), data.reshape((-1,)) - m = ~z_flat.mask + m = ~self.get_mask(z_flat) x_flat, y_flat, z_flat = x_flat[m], y_flat[m], z_flat[m] nb_value, _, _ = histogram2d(x_flat, y_flat, bins=bins) @@ -1936,14 +1944,6 @@ def regrid(self, other, grid_name, new_name=None): # self.variables_description[new_name]['infos'] = False # self.variables_description[new_name]['kwargs']['dimensions'] = ... - @staticmethod - def get_mask(a): - if len(a.mask.shape): - m = a.mask - else: - m = ones(a.shape) if a.mask else zeros(a.shape) - return m - def interp(self, grid_name, lons, lats, method="bilinear"): """ Compute z over lons, lats