From c7c4a5947c5fa9d7611d0bafea2a27c21fe31c29 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Tue, 12 Nov 2024 23:49:47 +0800 Subject: [PATCH] Revert "Using private grid._depth for negating depth (#75)" This reverts commit 6f843e969f51cbe6cce0aa374889d3a9b0e49693. --- src/virtualship/expedition/input_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/virtualship/expedition/input_data.py b/src/virtualship/expedition/input_data.py index a280c477..7af9ef72 100644 --- a/src/virtualship/expedition/input_data.py +++ b/src/virtualship/expedition/input_data.py @@ -97,9 +97,7 @@ def _load_default_fieldset(cls, directory: str | Path) -> FieldSet: # make depth negative for g in fieldset.gridset.grids: - g._depth = ( - -g._depth - ) # TODO maybe add a grid.negate_depth() method in Parcels? + g.depth = -g.depth # add bathymetry data bathymetry_file = directory.joinpath("bathymetry.nc") @@ -139,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.depth = -g.depth # read in data already fieldset.computeTimeChunk(0, 1) @@ -171,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.depth = -g.depth # read in data already fieldset.computeTimeChunk(0, 1)