From fef60e3b84a5a3516ac7ce80f7796674359f7f3e Mon Sep 17 00:00:00 2001 From: "Carles S. Soriano Perez" Date: Wed, 18 Oct 2023 13:58:21 +0200 Subject: [PATCH] chore: Processed review remarks --- .../standard_reinforcement_profile_builder.py | 21 ------------------- .../summary/koswat_summary_builder.py | 3 +++ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/koswat/calculations/standard_reinforcement/standard_reinforcement_profile_builder.py b/koswat/calculations/standard_reinforcement/standard_reinforcement_profile_builder.py index 806d0d5e..49090e3c 100644 --- a/koswat/calculations/standard_reinforcement/standard_reinforcement_profile_builder.py +++ b/koswat/calculations/standard_reinforcement/standard_reinforcement_profile_builder.py @@ -49,27 +49,6 @@ def get_standard_reinforcement_calculator( else: raise NotImplementedError(f"Type {reinforcement_type} not supported.") - def _get_corrected_koswat_scenario(self) -> KoswatScenario: - """ - Get a koswat scenario (`KoswatScenario`) whose values are not `math.nan`. - In practice this means that when a `KoswatScenario` value has not been set - the corresponding one from `KoswatProfileBase` will be used instead. - - Returns: - KoswatScenario: Valid scenario to be used in reinforcements. - """ - _new_koswat_scenario = KoswatScenario(**self.scenario.__dict__) - if math.isnan(_new_koswat_scenario.kruin_breedte): - _new_koswat_scenario.kruin_breedte = ( - self.base_profile.input_data.kruin_breedte - ) - if math.isnan(_new_koswat_scenario.buiten_talud): - _new_koswat_scenario.buiten_talud = ( - self.base_profile.input_data.buiten_talud - ) - - return _new_koswat_scenario - def _get_reinforcement_profile_input(self) -> ReinforcementInputProfileProtocol: _calculator = self.get_standard_reinforcement_calculator( self.reinforcement_profile_type diff --git a/koswat/cost_report/summary/koswat_summary_builder.py b/koswat/cost_report/summary/koswat_summary_builder.py index b8763b80..01b3d154 100644 --- a/koswat/cost_report/summary/koswat_summary_builder.py +++ b/koswat/cost_report/summary/koswat_summary_builder.py @@ -31,6 +31,9 @@ def _get_corrected_koswat_scenario( In practice this means that when a `KoswatScenario` value has not been set the corresponding one from `KoswatProfileBase` will be used instead. + By having this code here we *guarantee* that a summary can be built with only + the mandatory values of a `KoswatScenario`. + Returns: KoswatScenario: Valid scenario to be used in reinforcements. """