Skip to content

Commit

Permalink
put default value in user models
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Feb 10, 2025
1 parent 382d0ed commit 82a190e
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 164 deletions.
19 changes: 10 additions & 9 deletions src/antares/craft/model/settings/adequacy_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ class PriceTakingOrder(Enum):

@dataclass
class AdequacyPatchParameters:
include_adq_patch: bool
set_to_null_ntc_from_physical_out_to_physical_in_for_first_step: bool
set_to_null_ntc_between_physical_out_for_first_step: bool
price_taking_order: PriceTakingOrder
include_hurdle_cost_csr: bool
check_csr_cost_function: bool
threshold_initiate_curtailment_sharing_rule: int
threshold_display_local_matching_rule_violations: int
threshold_csr_variable_bounds_relaxation: int
include_adq_patch: bool = False
set_to_null_ntc_from_physical_out_to_physical_in_for_first_step: bool = True
set_to_null_ntc_between_physical_out_for_first_step: bool = True
price_taking_order: PriceTakingOrder = PriceTakingOrder.DENS
include_hurdle_cost_csr: bool = False
check_csr_cost_function: bool = False
threshold_initiate_curtailment_sharing_rule: int = 0
threshold_display_local_matching_rule_violations: int = 0
threshold_csr_variable_bounds_relaxation: int = 3
enable_first_step: bool = False


@dataclass
Expand Down
34 changes: 17 additions & 17 deletions src/antares/craft/model/settings/advanced_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# SPDX-License-Identifier: MPL-2.0
#
# This file is part of the Antares project.
from dataclasses import dataclass
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional

Expand Down Expand Up @@ -63,26 +63,26 @@ class RenewableGenerationModeling(Enum):

@dataclass
class AdvancedParameters:
initial_reservoir_levels: InitialReservoirLevel
hydro_heuristic_policy: HydroHeuristicPolicy
hydro_pricing_mode: HydroPricingMode
power_fluctuations: PowerFluctuation
shedding_policy: SheddingPolicy
unit_commitment_mode: UnitCommitmentMode
number_of_cores_mode: SimulationCore
renewable_generation_modelling: RenewableGenerationModeling
accuracy_on_correlation: set[OutputChoices]
initial_reservoir_levels: InitialReservoirLevel = InitialReservoirLevel.COLD_START
hydro_heuristic_policy: HydroHeuristicPolicy = HydroHeuristicPolicy.ACCOMMODATE_RULES_CURVES
hydro_pricing_mode: HydroPricingMode = HydroPricingMode.FAST
power_fluctuations: PowerFluctuation = PowerFluctuation.FREE_MODULATIONS
shedding_policy: SheddingPolicy = SheddingPolicy.SHAVE_PEAKS
unit_commitment_mode: UnitCommitmentMode = UnitCommitmentMode.FAST
number_of_cores_mode: SimulationCore = SimulationCore.MEDIUM
renewable_generation_modelling: RenewableGenerationModeling = RenewableGenerationModeling.CLUSTERS
accuracy_on_correlation: set[OutputChoices] = field(default_factory=set)


@dataclass
class SeedParameters:
seed_tsgen_thermal: int
seed_tsnumbers: int
seed_unsupplied_energy_costs: int
seed_spilled_energy_costs: int
seed_thermal_costs: int
seed_hydro_costs: int
seed_initial_reservoir_levels: int
seed_tsgen_thermal: int = 3005489
seed_tsnumbers: int = 5005489
seed_unsupplied_energy_costs: int = 6005489
seed_spilled_energy_costs: int = 7005489
seed_thermal_costs: int = 8005489
seed_hydro_costs: int = 9005489
seed_initial_reservoir_levels: int = 10005489


@dataclass
Expand Down
34 changes: 17 additions & 17 deletions src/antares/craft/model/settings/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ class OutputFormat(EnumIgnoreCase):

@dataclass
class GeneralParameters:
mode: Mode
horizon: str
nb_years: int
simulation_start: int
simulation_end: int
january_first: WeekDay
first_month_in_year: Month
first_week_day: WeekDay
leap_year: bool
year_by_year: bool
simulation_synthesis: bool
building_mode: BuildingMode
user_playlist: bool
thematic_trimming: bool
geographic_trimming: bool
store_new_set: bool
nb_timeseries_thermal: int
mode: Mode = Mode.ECONOMY
horizon: str = ""
nb_years: int = 1
simulation_start: int = 1
simulation_end: int = 365
january_first: WeekDay = WeekDay.MONDAY
first_month_in_year: Month = Month.JANUARY
first_week_day: WeekDay = WeekDay.MONDAY
leap_year: bool = False
year_by_year: bool = False
simulation_synthesis: bool = True
building_mode: BuildingMode = BuildingMode.AUTOMATIC
user_playlist: bool = False
thematic_trimming: bool = False
geographic_trimming: bool = False
store_new_set: bool = False
nb_timeseries_thermal: int = 1


@dataclass
Expand Down
26 changes: 13 additions & 13 deletions src/antares/craft/model/settings/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ class ExportMPS(Enum):

@dataclass
class OptimizationParameters:
simplex_range: SimplexOptimizationRange
transmission_capacities: OptimizationTransmissionCapacities
include_constraints: bool
include_hurdlecosts: bool
include_tc_minstablepower: bool
include_tc_min_ud_time: bool
include_dayahead: bool
include_strategicreserve: bool
include_spinningreserve: bool
include_primaryreserve: bool
include_exportmps: ExportMPS
include_exportstructure: bool
include_unfeasible_problem_behavior: UnfeasibleProblemBehavior
simplex_range: SimplexOptimizationRange = SimplexOptimizationRange.WEEK
transmission_capacities: OptimizationTransmissionCapacities = OptimizationTransmissionCapacities.LOCAL_VALUES
include_constraints: bool = True
include_hurdlecosts: bool = True
include_tc_minstablepower: bool = True
include_tc_min_ud_time: bool = True
include_dayahead: bool = True
include_strategicreserve: bool = True
include_spinningreserve: bool = True
include_primaryreserve: bool = True
include_exportmps: ExportMPS = ExportMPS.NONE
include_exportstructure: bool = False
include_unfeasible_problem_behavior: UnfeasibleProblemBehavior = UnfeasibleProblemBehavior.ERROR_VERBOSE


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions src/antares/craft/model/settings/study_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# SPDX-License-Identifier: MPL-2.0
#
# This file is part of the Antares project.
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Optional

from antares.craft.model.settings.adequacy_patch import AdequacyPatchParameters, AdequacyPatchParametersUpdate
Expand All @@ -32,8 +32,8 @@ class StudySettings:
advanced_parameters: AdvancedParameters
seed_parameters: SeedParameters
adequacy_patch_parameters: AdequacyPatchParameters
playlist_parameters: dict[int, PlaylistParameters]
thematic_trimming_parameters: ThematicTrimmingParameters
playlist_parameters: dict[int, PlaylistParameters] = field(default_factory=dict)


@dataclass
Expand Down
188 changes: 94 additions & 94 deletions src/antares/craft/model/settings/thematic_trimming.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,100 +15,100 @@

@dataclass
class ThematicTrimmingParameters:
ov_cost: bool
op_cost: bool
mrg_price: bool
co2_emis: bool
dtg_by_plant: bool
balance: bool
row_bal: bool
psp: bool
misc_ndg: bool
load: bool
h_ror: bool
wind: bool
solar: bool
nuclear: bool
lignite: bool
coal: bool
gas: bool
oil: bool
mix_fuel: bool
misc_dtg: bool
h_stor: bool
h_pump: bool
h_lev: bool
h_infl: bool
h_ovfl: bool
h_val: bool
h_cost: bool
unsp_enrg: bool
spil_enrg: bool
lold: bool
lolp: bool
avl_dtg: bool
dtg_mrg: bool
max_mrg: bool
np_cost: bool
np_cost_by_plant: bool
nodu: bool
nodu_by_plant: bool
flow_lin: bool
ucap_lin: bool
loop_flow: bool
flow_quad: bool
cong_fee_alg: bool
cong_fee_abs: bool
marg_cost: bool
cong_prob_plus: bool
cong_prob_minus: bool
hurdle_cost: bool
res_generation_by_plant: bool
misc_dtg_2: bool
misc_dtg_3: bool
misc_dtg_4: bool
wind_offshore: bool
wind_onshore: bool
solar_concrt: bool
solar_pv: bool
solar_rooft: bool
renw_1: bool
renw_2: bool
renw_3: bool
renw_4: bool
dens: bool
profit_by_plant: bool
sts_inj_by_plant: bool
sts_withdrawal_by_plant: bool
sts_lvl_by_plant: bool
psp_open_injection: bool
psp_open_withdrawal: bool
psp_open_level: bool
psp_closed_injection: bool
psp_closed_withdrawal: bool
psp_closed_level: bool
pondage_injection: bool
pondage_withdrawal: bool
pondage_level: bool
battery_injection: bool
battery_withdrawal: bool
battery_level: bool
other1_injection: bool
other1_withdrawal: bool
other1_level: bool
other2_injection: bool
other2_withdrawal: bool
other2_level: bool
other3_injection: bool
other3_withdrawal: bool
other3_level: bool
other4_injection: bool
other4_withdrawal: bool
other4_level: bool
other5_injection: bool
other5_withdrawal: bool
other5_level: bool
sts_cashflow_by_cluster: bool
ov_cost: bool = False
op_cost: bool = False
mrg_price: bool = False
co2_emis: bool = False
dtg_by_plant: bool = False
balance: bool = False
row_bal: bool = False
psp: bool = False
misc_ndg: bool = False
load: bool = False
h_ror: bool = False
wind: bool = False
solar: bool = False
nuclear: bool = False
lignite: bool = False
coal: bool = False
gas: bool = False
oil: bool = False
mix_fuel: bool = False
misc_dtg: bool = False
h_stor: bool = False
h_pump: bool = False
h_lev: bool = False
h_infl: bool = False
h_ovfl: bool = False
h_val: bool = False
h_cost: bool = False
unsp_enrg: bool = False
spil_enrg: bool = False
lold: bool = False
lolp: bool = False
avl_dtg: bool = False
dtg_mrg: bool = False
max_mrg: bool = False
np_cost: bool = False
np_cost_by_plant: bool = False
nodu: bool = False
nodu_by_plant: bool = False
flow_lin: bool = False
ucap_lin: bool = False
loop_flow: bool = False
flow_quad: bool = False
cong_fee_alg: bool = False
cong_fee_abs: bool = False
marg_cost: bool = False
cong_prob_plus: bool = False
cong_prob_minus: bool = False
hurdle_cost: bool = False
res_generation_by_plant: bool = False
misc_dtg_2: bool = False
misc_dtg_3: bool = False
misc_dtg_4: bool = False
wind_offshore: bool = False
wind_onshore: bool = False
solar_concrt: bool = False
solar_pv: bool = False
solar_rooft: bool = False
renw_1: bool = False
renw_2: bool = False
renw_3: bool = False
renw_4: bool = False
dens: bool = False
profit_by_plant: bool = False
sts_inj_by_plant: bool = False
sts_withdrawal_by_plant: bool = False
sts_lvl_by_plant: bool = False
psp_open_injection: bool = False
psp_open_withdrawal: bool = False
psp_open_level: bool = False
psp_closed_injection: bool = False
psp_closed_withdrawal: bool = False
psp_closed_level: bool = False
pondage_injection: bool = False
pondage_withdrawal: bool = False
pondage_level: bool = False
battery_injection: bool = False
battery_withdrawal: bool = False
battery_level: bool = False
other1_injection: bool = False
other1_withdrawal: bool = False
other1_level: bool = False
other2_injection: bool = False
other2_withdrawal: bool = False
other2_level: bool = False
other3_injection: bool = False
other3_withdrawal: bool = False
other3_level: bool = False
other4_injection: bool = False
other4_withdrawal: bool = False
other4_level: bool = False
other5_injection: bool = False
other5_withdrawal: bool = False
other5_level: bool = False
sts_cashflow_by_cluster: bool = False


@dataclass
Expand Down
Loading

0 comments on commit 82a190e

Please sign in to comment.