Skip to content

Commit

Permalink
fix: correct damage_curve field initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdtK committed Mar 21, 2024
1 parent 51fd97c commit 16c882a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ra2ce/analysis/analysis_config_data/analysis_config_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
from pathlib import Path
from typing import Optional

from ra2ce.analysis.analysis_config_data.enums import damage_curve_enum
from ra2ce.analysis.analysis_config_data.enums.analysis_direct_enum import (
AnalysisDirectEnum,
)
from ra2ce.analysis.analysis_config_data.enums.analysis_indirect_enum import (
AnalysisIndirectEnum,
)
from ra2ce.analysis.analysis_config_data.enums.damage_curve_enum import DamageCurveEnum
from ra2ce.analysis.analysis_config_data.enums.event_type_enum import EventTypeEnum
from ra2ce.analysis.analysis_config_data.enums.loss_type_enum import LossTypeEnum
from ra2ce.analysis.analysis_config_data.enums.risk_calculation_mode_enum import (
Expand Down Expand Up @@ -91,14 +91,18 @@ class AnalysisSectionIndirect(AnalysisSectionBase):
disruption_per_category: str = ""
traffic_cols: list[str] = field(default_factory=list)
# losses
duration_event: float = math.nan # TODO remove the deprecated attribute that have been replaced by csv
duration_event: float = (
math.nan
) # TODO remove the deprecated attribute that have been replaced by csv
duration_disruption: float = math.nan
fraction_detour: float = math.nan
fraction_drivethrough: float = 0.0
rest_capacity: float = math.nan
maximum_jam: float = math.nan
part_of_day: PartOfDayEnum = field(default_factory=lambda: PartOfDayEnum.DAY)
performance: str = "diff_time" # "diff_time" or "diff_length" relates to the used criticality metric
performance: str = (
"diff_time" # "diff_time" or "diff_length" relates to the used criticality metric
)
resilience_curve_file: Optional[Path] = None
traffic_intensities_file: Optional[Path] = None
values_of_time_file: Optional[Path] = None
Expand Down Expand Up @@ -134,8 +138,8 @@ class AnalysisSectionDirect(AnalysisSectionBase):
climate_period: float = math.nan
# road damage
event_type: EventTypeEnum = field(default_factory=lambda: EventTypeEnum.INVALID)
damage_curve: damage_curve_enum.DamageCurveEnum = field(
default_factory=lambda: EventTypeEnum.INVALID
damage_curve: DamageCurveEnum = field(
default_factory=lambda: DamageCurveEnum.INVALID
)
risk_calculation_mode: RiskCalculationModeEnum = field(
default_factory=lambda: RiskCalculationModeEnum.NONE
Expand Down

0 comments on commit 16c882a

Please sign in to comment.