Skip to content

Commit

Permalink
ref: make available a property
Browse files Browse the repository at this point in the history
  • Loading branch information
leclairm committed Oct 29, 2024
1 parent e09b710 commit 13f2d31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/wcflow/parsing/_yaml_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class _DataBaseModel(_NamedBaseModel):
type: str
src: str
format: str | None = None
available: bool = False

@field_validator("type")
@classmethod
Expand All @@ -133,15 +132,19 @@ def is_file_or_dir(cls, value: str) -> str:
raise ValueError(msg)
return value

@property
def available(self) -> bool:
return isinstance(self, ConfigAvailableData)


class ConfigAvailableData(_DataBaseModel):

available: bool = True
pass


class ConfigGeneratedData(_DataBaseModel):

available: bool = False
pass


class ConfigData(BaseModel):
Expand Down

0 comments on commit 13f2d31

Please sign in to comment.