Commit db4a787f authored by Le Roux Erwan's avatar Le Roux Erwan
Browse files

[Confidence Interval] refactor shape visualizer

parent bcb48a9c
No related merge requests found
Showing with 4 additions and 41 deletions
+4 -41
from experiment.meteo_france_data.scm_models_data.crocus.crocus import CrocusSnowLoadTotal
from experiment.paper_past_snow_loads.check_mle_convergence_for_trends.study_visualizer_for_shape_repartition import \
StudyVisualizerForShape, StudyVisualizerGumbel, StudyVisualizerAll
StudyVisualizerForShape
from experiment.paper_past_snow_loads.paper_main_utils import load_altitude_to_visualizer
......@@ -28,6 +28,6 @@ if __name__ == '__main__':
# main_shape_repartition([900], save_to_file=False)
# main_shape_repartition([900, 1800, 2700])
# main_shape_repartition([300, 600, 900, 1200, 1500, 1800, 2700])
main_shape_repartition([900], study_visualizer_class=StudyVisualizerAll, save_to_file=False)
# main_shape_repartition([300, 600, 900, 1200, 1500, 1800, 2100, 2400, 2700, 3000, 3300, 3600, 3900, 4200],
# study_visualizer_class=StudyVisualizerAll, save_to_file=True)
# main_shape_repartition([900], study_visualizer_class=StudyVisualizerForShape, save_to_file=False)
main_shape_repartition([300, 600, 900, 1200, 1500, 1800, 2100, 2400, 2700, 3000, 3300, 3600, 3900, 4200],
study_visualizer_class=StudyVisualizerForShape, save_to_file=True)
......@@ -6,8 +6,6 @@ from experiment.meteo_france_data.scm_models_data.abstract_study import Abstract
from experiment.paper_past_snow_loads.study_visualizer_for_non_stationary_trends import \
StudyVisualizerForNonStationaryTrends
from experiment.trend_analysis.abstract_score import MeanScore
from experiment.trend_analysis.univariate_test.extreme_trend_test.trend_test_one_parameter import \
GevStationaryVersusGumbel
class StudyVisualizerForShape(StudyVisualizerForNonStationaryTrends):
......@@ -32,7 +30,6 @@ class StudyVisualizerForShape(StudyVisualizerForNonStationaryTrends):
@cached_property
def massif_name_to_change_value(self):
print(self.massif_name_to_unconstrained_shape_parameter)
return self.massif_name_to_unconstrained_shape_parameter
@property
......@@ -48,36 +45,3 @@ class StudyVisualizerForShape(StudyVisualizerForNonStationaryTrends):
return get_shifted_map(-self._max_abs_change, self._max_abs_change, matplotlib.cm.get_cmap('BrBG_r'))
class StudyVisualizerGumbel(StudyVisualizerForShape):
def __init__(self, study: AbstractStudy, show=True, save_to_file=False, only_one_graph=False, only_first_row=False,
vertical_kde_plot=False, year_for_kde_plot=None, plot_block_maxima_quantiles=False,
temporal_non_stationarity=False, transformation_class=None, verbose=False, multiprocessing=False,
complete_non_stationary_trend_analysis=False, normalization_under_one_observations=True,
score_class=MeanScore, uncertainty_methods=None, non_stationary_contexts=None,
uncertainty_massif_names=None, effective_temporal_covariate=2017, relative_change_trend_plot=True):
super().__init__(study, show, save_to_file, only_one_graph, only_first_row, vertical_kde_plot,
year_for_kde_plot, plot_block_maxima_quantiles, temporal_non_stationarity,
transformation_class, verbose, multiprocessing, complete_non_stationary_trend_analysis,
normalization_under_one_observations, score_class, uncertainty_methods,
non_stationary_contexts, uncertainty_massif_names, effective_temporal_covariate,
relative_change_trend_plot)
# Assign default argument for the non stationary trends
self.non_stationary_trend_test = [GevStationaryVersusGumbel]
self.non_stationary_trend_test_to_marker = dict(zip(self.non_stationary_trend_test, ["o"]))
class StudyVisualizerAll(StudyVisualizerForShape):
def __init__(self, study: AbstractStudy, show=True, save_to_file=False, only_one_graph=False, only_first_row=False,
vertical_kde_plot=False, year_for_kde_plot=None, plot_block_maxima_quantiles=False,
temporal_non_stationarity=False, transformation_class=None, verbose=False, multiprocessing=False,
complete_non_stationary_trend_analysis=False, normalization_under_one_observations=True,
score_class=MeanScore, uncertainty_methods=None, non_stationary_contexts=None,
uncertainty_massif_names=None, effective_temporal_covariate=2017, relative_change_trend_plot=True):
super().__init__(study, show, save_to_file, only_one_graph, only_first_row, vertical_kde_plot,
year_for_kde_plot, plot_block_maxima_quantiles, temporal_non_stationarity,
transformation_class, verbose, multiprocessing, complete_non_stationary_trend_analysis,
normalization_under_one_observations, score_class, uncertainty_methods,
non_stationary_contexts, uncertainty_massif_names, effective_temporal_covariate,
relative_change_trend_plot)
......@@ -76,7 +76,6 @@ class StudyVisualizerForNonStationaryTrends(StudyVisualizer):
GevLocationAgainstGumbel, GevScaleAgainstGumbel, GevLocationAndScaleTrendTestAgainstGumbel
]
self.non_stationary_trend_test_to_marker = {t: t.marker for t in self.non_stationary_trend_test}
# ["v", "^", "D", "X", "x", 7, 6, "d"]))
else:
self.non_stationary_trend_test = list(self.non_stationary_trend_test_to_marker.keys())
self.global_max_abs_change = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment