Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- python=3.10
- ffmpeg
- pip:
- sphinx-gallery
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions src/py_eddy_tracker/dataset/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down