Skip to content

Commit

Permalink
fix using mutables as default value, and use absolute imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MAfarrag committed Dec 12, 2024
1 parent 7556303 commit 75988fb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hydrolib/core/dflowfm/tim/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pathlib import Path
from typing import Callable, Dict, List

from pydantic.v1 import Field
from pydantic.v1.class_validators import validator

from hydrolib.core.basemodel import BaseModel, ModelSaveSettings, ParsableFileModel

from .parser import TimParser
from .serializer import TimSerializer, TimSerializerConfig
from hydrolib.core.dflowfm.tim.parser import TimParser
from hydrolib.core.dflowfm.tim.serializer import TimSerializer, TimSerializerConfig


class TimRecord(BaseModel):
Expand All @@ -15,7 +15,7 @@ class TimRecord(BaseModel):
time: float
"""float: Time of the time record."""

data: List[float] = []
data: List[float] = Field(default_factory=list)
"""List[float]: Record of the time record."""


Expand All @@ -25,10 +25,10 @@ class TimModel(ParsableFileModel):
serializer_config = TimSerializerConfig()
"""TimSerializerConfig: The serialization configuration for the tim file."""

comments: List[str] = []
comments: List[str] = Field(default_factory=list)
"""List[str]: A list with the header comment of the tim file."""

timeseries: List[TimRecord] = []
timeseries: List[TimRecord] = Field(default_factory=list)
"""List[TimRecord]: A list containing the timeseries."""

@classmethod
Expand Down

0 comments on commit 75988fb

Please sign in to comment.