Skip to content

Commit

Permalink
ref: remove _ from DataBaseModel, used outside
Browse files Browse the repository at this point in the history
  • Loading branch information
leclairm committed Nov 8, 2024
1 parent 7967fc3 commit b6daca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/sirocco/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from collections.abc import Iterator
from datetime import datetime

from sirocco.parsing._yaml_data_models import ConfigCycle, _DataBaseModel
from sirocco.parsing._yaml_data_models import ConfigCycle, DataBaseModel

type ConfigCycleSpec = ConfigCycleTaskDepend | ConfigCycleTaskInput

Expand Down Expand Up @@ -218,7 +218,7 @@ def __getitem__(self, key: str | tuple(str, datetime | None)) -> TimeSeriesObjec
raise KeyError(msg)
return self._dict[name]

def resolve_target_dates(self, spec, ref_date: datetime | None) -> Iterator[datetime]:
def _resolve_target_dates(self, spec, ref_date: datetime | None) -> Iterator[datetime]:
if not spec.lag and not spec.date:
yield ref_date
if spec.lag:
Expand All @@ -233,7 +233,7 @@ def get(self, spec: ConfigCycleSpec, ref_date: datetime | None = None) -> Iterat
if ref_date is None and spec.date is []:
msg = "TimeSeries object must be referenced by dates"
raise ValueError(msg)
for target_date in self.resolve_target_dates(spec, ref_date):
for target_date in self._resolve_target_dates(spec, ref_date):
yield self._dict[name][target_date]
else:
if spec.lag or spec.date:
Expand Down
6 changes: 3 additions & 3 deletions src/sirocco/parsing/_yaml_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def convert_to_struct_time(cls, value: str | None) -> time.struct_time | None:
return None if value is None else time.strptime(value, "%H:%M:%S")


class _DataBaseModel(_NamedBaseModel):
class DataBaseModel(_NamedBaseModel):
"""
To create an instance of a data defined in a workflow file.
"""
Expand All @@ -138,11 +138,11 @@ def available(self) -> bool:
return isinstance(self, ConfigAvailableData)


class ConfigAvailableData(_DataBaseModel):
class ConfigAvailableData(DataBaseModel):
pass


class ConfigGeneratedData(_DataBaseModel):
class ConfigGeneratedData(DataBaseModel):
pass


Expand Down

0 comments on commit b6daca8

Please sign in to comment.