Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(thermals): correct the default value of the "gen-ts" property to use "use global" instead of "use global parameter" #1918

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading