Skip to content

Commit

Permalink
add docstrings model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AUdaltsova authored Aug 12, 2024
1 parent 76b737b commit ddae643
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ocf_datapipes/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class Wind(DataSourceMixin, TimeResolutionMixin, XYDimensionalNames, DropoutMixi

@field_validator("forecast_minutes")
def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check forecast length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "Forecast duration must be divisible by time resolution"
logger.error(message)
Expand All @@ -295,6 +296,7 @@ def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo

@field_validator("history_minutes")
def history_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check history length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "History duration must be divisible by time resolution"
logger.error(message)
Expand Down Expand Up @@ -402,6 +404,7 @@ def model_validation(cls, v):

@field_validator("forecast_minutes")
def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check forecast length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "Forecast duration must be divisible by time resolution"
logger.error(message)
Expand All @@ -410,6 +413,7 @@ def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo

@field_validator("history_minutes")
def history_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check history length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "History duration must be divisible by time resolution"
logger.error(message)
Expand Down Expand Up @@ -641,6 +645,7 @@ def validate_nwp_provider(cls, v: str) -> str:

@field_validator("forecast_minutes")
def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check forecast length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "Forecast duration must be divisible by time resolution"
logger.error(message)
Expand All @@ -649,6 +654,7 @@ def forecast_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo

@field_validator("history_minutes")
def history_minutes_divide_by_time_resolution(cls, v: int, info: ValidationInfo) -> int:
"""Check history length requested will give stable number of timesteps"""
if v % info.data["time_resolution_minutes"] != 0:
message = "History duration must be divisible by time resolution"
logger.error(message)
Expand Down

0 comments on commit ddae643

Please sign in to comment.