Skip to content

Commit 97eaf1f

Browse files
authored
Fixes (#85)
* fixes * changed some defaults in new work * updated tests accordingly * do not use land_binary_mask to plot in animation when plotting after the simulation has been run previously * updated whats new
1 parent 2ce74ae commit 97eaf1f

6 files changed

Lines changed: 20 additions & 8 deletions

File tree

docs/whats_new.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# What's New
22

3+
## 2.4.2 (March 6, 2026)
4+
5+
* changed some defaults in new work
6+
* updated tests accordingly
7+
* do not use land_binary_mask to plot in animation when plotting after the simulation has been run previously
8+
39
## v2.4.0 (March 5, 2026)
410

511
* Changed default value of `use_static_masks` to False from True, so that wet/dry masks from ocean models are used by default.

particle_tracking_manager/config_the_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ def check_lon_lat_geojson_consistency(self) -> Self:
232232
"""Check if lon and lat are set when geojson is None, and vice versa."""
233233
if self.geojson is None:
234234
if self.lon is None and self.lat is None:
235-
self.lon = -151.0
236-
self.lat = 58.0
235+
self.lon = -152.6
236+
self.lat = 59.3
237237
logger.info(
238238
"Using default lon and lat set to -151.0 and 58.0 respectively."
239239
)

particle_tracking_manager/models/opendrift/config_opendrift.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ class LarvalFishModelConfig(OceanDriftModelConfig):
823823

824824
# Egg hatching parameters
825825
hatching_method: HatchingMethodEnum = Field(
826-
default=HatchingMethodEnum.temperature,
826+
default=HatchingMethodEnum.fixed_time,
827827
description="Egg hatching method. temperature: use ambient temperature (Ellertsen et al. 1988). fixed_time: hatch after fixed duration.",
828828
title="Hatching Method",
829829
json_schema_extra={
@@ -941,7 +941,7 @@ class PhytoplanktonModelConfig(OceanDriftModelConfig):
941941

942942
# Vertical behavior parameters
943943
vertical_behavior_mode: VerticalBehaviorModeEnum = Field(
944-
default=VerticalBehaviorModeEnum.depth,
944+
default=VerticalBehaviorModeEnum.dvm,
945945
description="Vertical behavior mode. none: passive. depth: maintain preferred depth band. dvm: diel vertical migration.",
946946
title="Vertical Behavior Mode",
947947
json_schema_extra={

particle_tracking_manager/models/opendrift/plot.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,13 @@ def plot(plot_name, input_kwargs, o, filename, drift_model):
170170
# landmask is being used ("auto landmask")
171171
# if not using the global land mask, then plot the wetdry model
172172
# landmask with these special inputs to look best.
173-
if o._config["general:use_auto_landmask"]["value"] == False:
173+
# cannot plot land separate from simulation since then the reader
174+
# is not available with the information. Checking for readers checks
175+
# for that.
176+
if (
177+
o._config["general:use_auto_landmask"]["value"] == False
178+
and len(o.env.readers.keys()) > 0
179+
):
174180
kwargs.update(
175181
{
176182
"background": "land_binary_mask",

tests/test_config_opendrift.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_Phytoplankton_defaults():
270270
drift_model="Phytoplankton",
271271
steps=1,
272272
)
273-
assert m.vertical_behavior_mode == VerticalBehaviorModeEnum.depth
273+
assert m.vertical_behavior_mode == VerticalBehaviorModeEnum.dvm
274274
assert m.w_active == 0.001
275275
assert m.z_pref == -10.0
276276
assert m.do3D == True

tests/test_config_the_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def test_seed_location_inputs():
135135

136136
m = TheManagerConfig(steps=1, start_time="2022-01-01", geojson=None)
137137
# these are set in a validator if geojson is None and lon/lat are None
138-
assert m.lon == -151.0
139-
assert m.lat == 58.0
138+
assert m.lon == -152.6
139+
assert m.lat == 59.3
140140

141141
with pytest.raises(ValidationError):
142142
m = TheManagerConfig(

0 commit comments

Comments
 (0)