From 3adf777f6d09a1a26e709f6bcc6efa97611bcb09 Mon Sep 17 00:00:00 2001 From: Erik van Sebille Date: Fri, 29 Nov 2024 10:24:37 +0100 Subject: [PATCH] Using the new grid.negate_depth() method Note that this will only work after Parcels v3.1.1 is released and on conda. But create this PR now already so we don't forget to update the VirtualShip --- environment.yml | 2 +- src/virtualship/expedition/input_data.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/environment.yml b/environment.yml index 994ab6cf..3fd6422d 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge dependencies: - click - - parcels >3, <3.1.0 + - parcels >3.1.0 - pyproj >= 3, < 4 - sortedcontainers == 2.4.0 - opensimplex == 0.4.5 diff --git a/src/virtualship/expedition/input_data.py b/src/virtualship/expedition/input_data.py index 7af9ef72..037d007f 100644 --- a/src/virtualship/expedition/input_data.py +++ b/src/virtualship/expedition/input_data.py @@ -97,7 +97,7 @@ def _load_default_fieldset(cls, directory: str | Path) -> FieldSet: # make depth negative for g in fieldset.gridset.grids: - g.depth = -g.depth + g.negate_depth() # add bathymetry data bathymetry_file = directory.joinpath("bathymetry.nc") @@ -137,7 +137,7 @@ def _load_drifter_fieldset(cls, directory: str | Path) -> FieldSet: # make depth negative for g in fieldset.gridset.grids: - g.depth = -g.depth + g.negate_depth() # read in data already fieldset.computeTimeChunk(0, 1) @@ -169,7 +169,7 @@ def _load_argo_float_fieldset(cls, directory: str | Path) -> FieldSet: # make depth negative for g in fieldset.gridset.grids: if max(g.depth) > 0: - g.depth = -g.depth + g.negate_depth() # read in data already fieldset.computeTimeChunk(0, 1)