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

599 remove outdated setup of adaptation attempts #603

Merged
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
7 changes: 0 additions & 7 deletions ra2ce/analysis/analysis_config_data/analysis_config_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ class AnalysisSectionDamages(AnalysisSectionBase):
analysis: AnalysisDamagesEnum = field(
default_factory=lambda: AnalysisDamagesEnum.INVALID
)
# adaptation/effectiveness measures
return_period: float = math.nan
repair_costs: float = math.nan
evaluation_period: float = math.nan
interest_rate: float = math.nan
climate_factor: float = math.nan
climate_period: float = math.nan
# road damage
representative_damage_percentage: float = 100
event_type: EventTypeEnum = field(default_factory=lambda: EventTypeEnum.NONE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,42 +218,7 @@ def _get_analysis_section_damages(
_section.save_csv = self._parser.getboolean(
section_name, "save_csv", fallback=_section.save_csv
)
# adaptation/effectiveness measures
_section.return_period = self._parser.getfloat(
section_name,
"return_period",
fallback=_section.return_period,
)
_section.repair_costs = self._parser.getfloat(
section_name,
"repair_costs",
fallback=_section.repair_costs,
)
_section.evaluation_period = self._parser.getfloat(
section_name,
"evaluation_period",
fallback=_section.evaluation_period,
)
_section.evaluation_period = self._parser.getfloat(
section_name,
"representative_damage_percentage",
fallback=_section.representative_damage_percentage,
)
_section.interest_rate = self._parser.getfloat(
section_name,
"interest_rate",
fallback=_section.interest_rate,
)
_section.climate_factor = self._parser.getfloat(
section_name,
"climate_factor",
fallback=_section.climate_factor,
)
_section.climate_period = self._parser.getfloat(
section_name,
"climate_period",
fallback=_section.climate_period,
)

# road damage
_section.event_type = EventTypeEnum.get_enum(
self._parser.get(section_name, "event_type", fallback=None)
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carsopre do you think it is worth keeping the enum if there's only 1 option left? Also for adaptation I don't create an enum.

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

class AnalysisDamagesEnum(Ra2ceEnumBase):
DAMAGES = 1
EFFECTIVENESS_MEASURES = 2
INVALID = 99
4 changes: 0 additions & 4 deletions ra2ce/analysis/analysis_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from ra2ce.analysis.analysis_input_wrapper import AnalysisInputWrapper
from ra2ce.analysis.damages.analysis_damages_protocol import AnalysisDamagesProtocol
from ra2ce.analysis.damages.damages import Damages
from ra2ce.analysis.damages.effectiveness_measures import EffectivenessMeasures
from ra2ce.analysis.losses.analysis_losses_protocol import AnalysisLossesProtocol
from ra2ce.analysis.losses.multi_link_isolated_locations import (
MultiLinkIsolatedLocations,
Expand Down Expand Up @@ -84,9 +83,6 @@ def get_damages_analysis(
if analysis.analysis == AnalysisDamagesEnum.DAMAGES:
return Damages(_analysis_input)

if analysis.analysis == AnalysisDamagesEnum.EFFECTIVENESS_MEASURES:
return EffectivenessMeasures(_analysis_input)

raise NotImplementedError(f"Analysis {analysis.analysis} not implemented")

@staticmethod
Expand Down
Loading