Skip to content

Commit

Permalink
chore: upgrade dependencies (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
markusrf authored Dec 12, 2024
1 parent e8d25dd commit ce3458c
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 274 deletions.
546 changes: 299 additions & 247 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ecalc = 'ecalc_cli.main:main'

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
pydantic = "<3"
pydantic = "<2.10.0" #Due to breaking bugs in 2.10.x. Unlock versioning when https://github.com/pydantic/pydantic/issues/10960 is fixed.
PyYAML = "^6"
numpy = [
{version = "~1.24.0", python="<3.9"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional

from pydantic import Field

Expand All @@ -14,7 +14,7 @@ class EnergyUsageModelCommon(YamlBase):
title="CONDITION",
description="Logical condition for the consumer to be used.\n\n$ECALC_DOCS_KEYWORDS_URL/CONDITION",
)
conditions: List[YamlExpressionType] = Field(
conditions: Optional[List[YamlExpressionType]] = Field(
None,
title="CONDITIONS",
description="Logical conditions for the consumer to be used.\n\n$ECALC_DOCS_KEYWORDS_URL/CONDITION",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Literal
from typing import List, Literal, Optional

from pydantic import Field

Expand Down Expand Up @@ -29,27 +29,27 @@ class YamlCompressorSystemCompressor(YamlBase):


class YamlCompressorSystemOperationalSetting(YamlBase):
crossover: List[int] = Field(
crossover: Optional[List[int]] = Field(
None,
title="CROSSOVER",
description="Set cross over rules in system operational setting. \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#crossover",
)
rates: List[YamlExpressionType] = Field(
rates: Optional[List[YamlExpressionType]] = Field(
None,
title="RATES",
description="Set rate per consumer in a consumer system operational setting. \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#rates",
)
rate_fractions: List[YamlExpressionType] = Field(
rate_fractions: Optional[List[YamlExpressionType]] = Field(
None,
title="RATE_FRACTIONS",
description="List of expressions defining fractional rate (of total system rate) per consumer. \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#rate-fractions",
)
suction_pressures: List[YamlExpressionType] = Field(
suction_pressures: Optional[List[YamlExpressionType]] = Field(
None,
title="SUCTION_PRESSURES",
description="Set suction pressure per consumer in a consumer system operational setting. \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#suction-pressures",
)
discharge_pressures: List[YamlExpressionType] = Field(
discharge_pressures: Optional[List[YamlExpressionType]] = Field(
None,
title="DISCHARGE_PRESSURES",
description="Set discharge pressure per consumer in a consumer system operational setting. \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#discharge-pressures",
Expand All @@ -67,7 +67,7 @@ class YamlCompressorSystemOperationalSetting(YamlBase):


class YamlPumpSystemOperationalSettings(YamlCompressorSystemOperationalSetting):
fluid_densities: List[YamlExpressionType] = Field(
fluid_densities: Optional[List[YamlExpressionType]] = Field(
None,
title="FLUID_DENSITIES",
description="Set fluid density per consumer in a consumer system operational setting. Will overwrite the systems common fluid density expression \n\n$ECALC_DOCS_KEYWORDS_URL/OPERATIONAL_SETTINGS#fluid-densities",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional

from pydantic import ConfigDict, Field

Expand Down Expand Up @@ -27,19 +27,19 @@ class YamlAsset(YamlBase):
title="Asset",
)

time_series: List[YamlTimeSeriesCollection] = Field(
time_series: Optional[List[YamlTimeSeriesCollection]] = 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: List[YamlFacilityModel] = Field(
facility_inputs: Optional[List[YamlFacilityModel]] = Field(
None,
title="FACILITY_INPUTS",
description="Defines input files which characterize various facility elements."
"\n\n$ECALC_DOCS_KEYWORDS_URL/FACILITY_INPUTS",
)
models: List[YamlModel] = Field(
models: Optional[List[YamlModel]] = Field(
None,
title="MODELS",
description="Defines input files which characterize various facility elements."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Union
from typing import List, Optional, Union

from pydantic import ConfigDict, Field, model_validator
from typing_extensions import Annotated
Expand Down Expand Up @@ -54,28 +54,30 @@ class YamlInstallation(YamlBase):
title="REGULARITY",
description="Regularity of the installation can be specified by a single number or as an expression. USE WITH CARE.\n\n$ECALC_DOCS_KEYWORDS_URL/REGULARITY",
)
generator_sets: List[YamlGeneratorSet] = Field(
generator_sets: Optional[List[YamlGeneratorSet]] = Field(
None,
title="GENERATORSETS",
description="Defines one or more generator sets.\n\n$ECALC_DOCS_KEYWORDS_URL/GENERATORSETS",
alias="GENERATORSETS",
)
fuel_consumers: List[
Annotated[
Union[
YamlFuelConsumer,
YamlConsumerSystem,
],
Field(discriminator="component_type"),
DiscriminatorWithFallback("TYPE", "FUEL_CONSUMER"),
fuel_consumers: Optional[
List[
Annotated[
Union[
YamlFuelConsumer,
YamlConsumerSystem,
],
Field(discriminator="component_type"),
DiscriminatorWithFallback("TYPE", "FUEL_CONSUMER"),
]
]
] = Field(
None,
title="FUELCONSUMERS",
description="Defines fuel consumers on the installation which are not generators.\n\n$ECALC_DOCS_KEYWORDS_URL/FUELCONSUMERS",
alias="FUELCONSUMERS",
)
venting_emitters: List[YamlVentingEmitter] = Field(
venting_emitters: Optional[List[YamlVentingEmitter]] = Field(
None,
title="VENTING_EMITTERS",
description="Covers the direct emissions on the installation that are not consuming energy",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Literal, Union
from typing import Literal, Optional, Union

from pydantic import ConfigDict, Field, field_validator
from typing_extensions import Annotated
Expand Down Expand Up @@ -43,7 +43,7 @@ class YamlDefaultTimeSeriesCollection(YamlTimeSeriesCollectionBase):
description="Defines the type of time series input file.\n\n$ECALC_DOCS_KEYWORDS_URL/TYPE",
)

interpolation_type: Literal["RIGHT"] = Field(
interpolation_type: Optional[Literal["RIGHT"]] = Field(
None,
title="INTERPOLATION_TYPE",
description="Defines how the time series are interpolated between input time steps.\n\n$ECALC_DOCS_KEYWORDS_URL/INTERPOLATION_TYPE",
Expand Down

0 comments on commit ce3458c

Please sign in to comment.