Skip to content

Commit 52b29bd

Browse files
committed
precommit
1 parent 5d781c3 commit 52b29bd

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

particle_tracking_manager/models/opendrift/config_opendrift.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,17 @@ class HarmfulAlgalBloomModelConfig(HABParameters, OceanDriftModelConfig):
776776
default=HABSpeciesTypeEnum.PN,
777777
description="HarmfulAlgalBloom species category for this simulation. This option maps to individual properties which can instead be set manually if desired.",
778778
title="HAB Species Type",
779-
json_schema_extra={"ptm_level": 1,
780-
"oneOf": [{"const": species.name, "title": species.value, "description": _species_descriptions[species.value]} for species in HABSpeciesTypeEnum],
781-
},
779+
json_schema_extra={
780+
"ptm_level": 1,
781+
"oneOf": [
782+
{
783+
"const": species.name,
784+
"title": species.value,
785+
"description": _species_descriptions[species.value],
786+
}
787+
for species in HABSpeciesTypeEnum
788+
],
789+
},
782790
)
783791

784792
# # new field: full parameter bundle for the HAB species

particle_tracking_manager/models/opendrift/enums/species_types.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,15 @@ class HABParameters(BaseModel):
105105
}
106106

107107
# this is for the schema
108-
_species_descriptions = {species.value: "Defaults: " + ", ".join([f"{key}={value}" for key, value in SPECIES_HAB_DEFAULTS[species].model_dump().items()]) for species in HABSpeciesTypeEnum if species != "custom"}
108+
_species_descriptions = {
109+
species.value: "Defaults: "
110+
+ ", ".join(
111+
[
112+
f"{key}={value}"
113+
for key, value in SPECIES_HAB_DEFAULTS[species].model_dump().items()
114+
]
115+
)
116+
for species in HABSpeciesTypeEnum
117+
if species != "custom"
118+
}
109119
_species_descriptions["custom"] = "Custom species with user-defined parameters."

0 commit comments

Comments
 (0)