Skip to content

Commit

Permalink
fix(thermals): correct the default value of the "gen-ts" property to …
Browse files Browse the repository at this point in the history
…use "use global" instead of "use global parameter" (#1918)

Merge pull request #1918 from AntaresSimulatorTeam/bugfix/1917-correct-gen-ts-vaue
  • Loading branch information
laurent-laporte-pro authored Jan 31, 2024
2 parents 60957a7 + 69f618e commit 37594a2
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 109 deletions.
4 changes: 2 additions & 2 deletions antarest/study/business/areas/thermal_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def schema_extra(schema: t.MutableMapping[str, t.Any]) -> None:
enabled=False,
unitCount=100,
nominalCapacity=1000.0,
genTs="use global parameter",
genTs="use global",
co2=7.0,
)

Expand Down Expand Up @@ -85,7 +85,7 @@ def schema_extra(schema: t.MutableMapping[str, t.Any]) -> None:
enabled=False,
unitCount=100,
nominalCapacity=1000.0,
genTs="use global parameter",
genTs="use global",
co2=7.0,
)

Expand Down
6 changes: 3 additions & 3 deletions antarest/study/business/table_mode_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from antarest.study.common.default_values import FilteringOptions, LinkProperties, NodalOptimization
from antarest.study.model import RawStudy
from antarest.study.storage.rawstudy.model.filesystem.config.binding_constraint import BindingConstraintFrequency
from antarest.study.storage.rawstudy.model.filesystem.config.thermal import LawOption, TimeSeriesGenerationOption
from antarest.study.storage.rawstudy.model.filesystem.config.thermal import LawOption, LocalTSGenerationBehavior
from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy
from antarest.study.storage.storage_service import StudyStorageService
from antarest.study.storage.variantstudy.model.command.icommand import ICommand
Expand Down Expand Up @@ -93,7 +93,7 @@ class ClusterColumns(FormFieldsBaseModel):
startup_cost: Optional[StrictInt]
market_bid_cost: Optional[StrictInt]
spread_cost: Optional[StrictInt]
ts_gen: Optional[TimeSeriesGenerationOption]
ts_gen: Optional[LocalTSGenerationBehavior]
volatility_forced: Optional[StrictInt]
volatility_planned: Optional[StrictInt]
law_forced: Optional[LawOption]
Expand Down Expand Up @@ -288,7 +288,7 @@ class PathVars(TypedDict, total=False):
},
"ts_gen": {
"path": f"{CLUSTER_PATH}/gen-ts",
"default_value": TimeSeriesGenerationOption.USE_GLOBAL_PARAMETER.value,
"default_value": LocalTSGenerationBehavior.USE_GLOBAL.value,
},
"volatility_forced": {
"path": f"{CLUSTER_PATH}/volatility.forced",
Expand Down
17 changes: 11 additions & 6 deletions antarest/study/storage/rawstudy/model/filesystem/config/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from antarest.study.storage.rawstudy.model.filesystem.config.identifier import IgnoreCaseIdentifier

__all__ = (
"TimeSeriesGenerationOption",
"LocalTSGenerationBehavior",
"LawOption",
"ThermalClusterGroup",
"ThermalProperties",
Expand All @@ -19,13 +19,18 @@
)


class TimeSeriesGenerationOption(EnumIgnoreCase):
class LocalTSGenerationBehavior(EnumIgnoreCase):
"""
Options related to time series generation.
The option `USE_GLOBAL_PARAMETER` is used by default.
The option `USE_GLOBAL` is used by default.
Attributes:
USE_GLOBAL: Use the global time series parameters.
FORCE_NO_GENERATION: Do not generate time series.
FORCE_GENERATION: Force the generation of time series.
"""

USE_GLOBAL_PARAMETER = "use global parameter"
USE_GLOBAL = "use global"
FORCE_NO_GENERATION = "force no generation"
FORCE_GENERATION = "force generation"

Expand Down Expand Up @@ -93,8 +98,8 @@ class ThermalProperties(ClusterProperties):
description="Thermal Cluster Group",
)

gen_ts: TimeSeriesGenerationOption = Field(
default=TimeSeriesGenerationOption.USE_GLOBAL_PARAMETER,
gen_ts: LocalTSGenerationBehavior = Field(
default=LocalTSGenerationBehavior.USE_GLOBAL,
description="Time Series Generation Option",
alias="gen-ts",
)
Expand Down
Loading

0 comments on commit 37594a2

Please sign in to comment.