Skip to content

Commit

Permalink
reformat tim model
Browse files Browse the repository at this point in the history
  • Loading branch information
MAfarrag committed Jan 22, 2025
1 parent 01c7123 commit a93c1a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hydrolib/core/dflowfm/tim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class TimModel(ParsableFileModel):
>>> new_tim.timeseries = [TimRecord(time=0.0, data=[1.0, 2.0])]
Serialize the `TimModel` to a .tim file:
>>> new_tim.save(filepath="output.tim") # doctest: +SKIP
>>> new_tim.save(filepath=Path("output.tim")) # doctest: +SKIP
See Also:
TimParser: Used for parsing .tim files.
Expand Down Expand Up @@ -163,14 +163,14 @@ def _get_parser(cls) -> Callable[[Path], Dict]:
@validator("timeseries")
@classmethod
def _validate_timeseries_values(cls, v: List[TimRecord]) -> List[TimRecord]:
"""Validate if the amount of columns per timeseries match and if the timeseries have no duplicate times.
"""Validate if the number of columns per timeseries matches and if the timeseries have no duplicate times.
Args:
v (List[TimRecord]): Timeseries to validate.
Raises:
ValueError: When the amount of columns for timeseries is zero.
ValueError: When the amount of columns differs per timeseries.
ValueError: When the number of columns for timeseries is zero.
ValueError: When the number of columns differs per timeseries.
ValueError: When the timeseries has a duplicate time.
Returns:
Expand Down Expand Up @@ -209,9 +209,9 @@ def _raise_error_if_duplicate_time(timeseries: List[TimRecord]) -> None:

@validator("quantities_names")
def _validate_quantities_names(cls, v, values):
"""Validate if the amount of quantities_names match the amount of columns in the timeseries.
"""Validate if the number of quantities_names matches the number of columns in the timeseries.
The validator compared the amount of quantities_names with the amount of columns in the first record of
The validator compared the amount of quantities_names with the number of columns in the first record of
the timeseries.
"""
if v is not None:
Expand All @@ -229,7 +229,7 @@ def add_column(self, new_values: List[float], column_name: str = None) -> None:
Args:
new_values (List[float]): A list of new values to add, one for each TimRecord.
column_name (str, optional): The name of the new column. Defaults to None.
if None the column will be named as "quantity-{len(quantities_names) + 1}".
if None, the column is named as "quantity-{len(quantities_names) + 1}".
Raises:
ValueError: If the number of new values does not match the number of TimRecords.
Expand Down

0 comments on commit a93c1a2

Please sign in to comment.