-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: generate asset/ecalc model schema (#157)
- Loading branch information
Showing
8 changed files
with
173 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
src/ecalc/libraries/libecalc/common/libecalc/input/validation/json_schemas/ecalc-model.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/ecalc/libraries/libecalc/common/libecalc/input/yaml_types/components/asset.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
from typing import Dict, Optional | ||
|
||
from libecalc.input.yaml_types import YamlBase | ||
from libecalc.input.yaml_types.variable import Variables | ||
from pydantic import Field | ||
|
||
# Dummy type used for attributes that aren't yet converted to pydantic yaml models | ||
DummyType = Optional[Dict] | ||
|
||
|
||
class YamlAsset(YamlBase): | ||
"""An eCalc™ yaml file""" | ||
|
||
class Config: | ||
title = "Asset" | ||
|
||
time_series: DummyType = Field( | ||
None, | ||
title="TIME_SERIES", | ||
description="Defines the inputs for time dependent variables, or 'reservoir variables'." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/TIME_SERIES", | ||
) | ||
facility_inputs: DummyType = Field( | ||
None, | ||
title="FACILITY_INPUTS", | ||
description="Defines input files which characterize various facility elements." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/FACILITY_INPUTS", | ||
) | ||
models: DummyType = Field( | ||
None, | ||
title="MODELS", | ||
description="Defines input files which characterize various facility elements." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/MODELS", | ||
) | ||
fuel_types: DummyType = Field( | ||
None, | ||
title="FUEL_TYPES", | ||
description="Specifies the various fuel types and associated emissions used in the model." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/FUEL_TYPES", | ||
) | ||
variables: Variables = Field( | ||
None, | ||
title="VARIABLES", | ||
description="Defines variables used in an energy usage model by means of expressions or constants." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/VARIABLES", | ||
) | ||
installations: DummyType = Field( | ||
..., | ||
title="INSTALLATIONS", | ||
description="Description of the system of energy consumers." "\n\n$ECALC_DOCS_KEYWORDS_URL/INSTALLATIONS", | ||
) | ||
start: str = Field( | ||
None, # TODO: DefaultDatetime? | ||
title="START", | ||
description="Global start date for eCalc calculations in <YYYY-MM-DD> format." | ||
"\n\n$ECALC_DOCS_KEYWORDS_URL/START", | ||
) | ||
end: str = Field( | ||
None, # TODO: DefaultDatetime? | ||
title="END", | ||
description="Global end date for eCalc calculations in <YYYY-MM-DD> format." "\n\n$ECALC_DOCS_KEYWORDS_URL/END", | ||
) |
Oops, something went wrong.