Skip to content

Commit

Permalink
Merge pull request #131 from rom-py/no-sortby
Browse files Browse the repository at this point in the history
No sortby
  • Loading branch information
tomdurrant authored Jan 28, 2025
2 parents 980301b + a25746f commit 78b316c
Show file tree
Hide file tree
Showing 7 changed files with 517 additions and 404 deletions.
190 changes: 102 additions & 88 deletions notebooks/swan/example_declarative.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions notebooks/swan/example_declarative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ config:
- output: [hswell]
fswell: 0.125
block:
model_type: block
sname: COMPGRID
fname: swangrid.nc
output: [depth, wind, hsign, tps, dir]
Expand Down
481 changes: 283 additions & 198 deletions notebooks/swan/example_procedural.ipynb

Large diffs are not rendered by default.

242 changes: 128 additions & 114 deletions notebooks/swan/example_sensitivity.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions notebooks/swan/example_sensitivity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ output:
- output: [hswell]
fswell: 0.125
block:
model_type: block
sname: COMPGRID
fname: swangrid.nc
output: [depth, wind, hsign, tps, dir]
Expand Down
3 changes: 0 additions & 3 deletions rompy/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ def ds(self):
ds = self.source.open(
variables=self.variables, filters=self.filter, coords=self.coords
)
# Sort the dataset by all coordinates to avoid cropping issues
for dim in ds.dims:
ds = ds.sortby(dim)
return ds

def _figsize(self, x0, x1, y0, y1, fscale):
Expand Down
3 changes: 2 additions & 1 deletion rompy/core/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def derived_filter(ds, derived_variables):
return ds


def sort_filter(ds, coords=None):
def sort_filter(ds, coords: list = []):
coords = list[coords] if isinstance(coords, str) else coords
for c in coords:
if c in ds:
ds = ds.sortby(c)
Expand Down

0 comments on commit 78b316c

Please sign in to comment.