Skip to content

Commit

Permalink
Remove from_integer
Browse files Browse the repository at this point in the history
  • Loading branch information
samkellerhals committed May 27, 2024
1 parent 08906f1 commit b4211d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ class TurbulenceShearForcingType(int, Enum):
)
VERTICAL_HORIZONTAL_OF_HORIZONTAL_WIND_LTHESH = 3 #: same as `VERTICAL_HORIZONTAL_OF_HORIZONTAL_WIND` but scaling of coarse-grid horizontal shear production term with 1/sqrt(Ri) (if LTKESH = TRUE)

@classmethod
def from_integer(cls, value: int):
for item in cls:
if item.value == value:
return item
raise ValueError(f"No {cls.__name__} member corresponds to the value {value}")


class DiffusionConfig:
"""
Expand Down
2 changes: 1 addition & 1 deletion tools/src/icon4pytools/py2fgen/wrappers/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def diffusion_init(
thhgtd_zdiffu=thhgtd_zdiffu,
velocity_boundary_diffusion_denom=denom_diffu_v,
max_nudging_coeff=nudge_max_coeff,
shear_type=TurbulenceShearForcingType.from_integer(itype_sher),
shear_type=TurbulenceShearForcingType(itype_sher),
)

diffusion_params = DiffusionParams(config)
Expand Down

0 comments on commit b4211d8

Please sign in to comment.