Skip to content

Commit

Permalink
Explicitly request value for 'endStep' as integer
Browse files Browse the repository at this point in the history
  • Loading branch information
Metamess committed Feb 20, 2024
1 parent f95912c commit 33804b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cfgrib/cfmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def to_grib_date_time(
message[time_key] = int(datetime_iso[11:16].replace(":", ""))


def from_grib_step(message, step_key="endStep", step_unit_key="stepUnits"):
def from_grib_step(message, step_key="endStep:int", step_unit_key="stepUnits:int"):
# type: (abc.Field, str, str) -> float
step_unit = message[step_unit_key]
to_seconds = GRIB_STEP_UNITS_TO_SECONDS[step_unit]
Expand All @@ -97,7 +97,7 @@ def from_grib_step(message, step_key="endStep", step_unit_key="stepUnits"):
return int(message[step_key]) * to_seconds / 3600.0


def to_grib_step(message, step_ns, step_unit=1, step_key="endStep", step_unit_key="stepUnits"):
def to_grib_step(message, step_ns, step_unit=1, step_key="endStep:int", step_unit_key="stepUnits:int"):
# type: (abc.MutableField, int, int, str, str) -> None
step_s = step_ns * 1e-9
to_seconds = GRIB_STEP_UNITS_TO_SECONDS[step_unit]
Expand Down

0 comments on commit 33804b9

Please sign in to comment.