diff --git a/mlair/configuration/defaults.py b/mlair/configuration/defaults.py index dd59201da4a9e6ebb07a92a13e18b23a189855ff..0dd2a07b48a0a3789824391291978f98b216bb57 100644 --- a/mlair/configuration/defaults.py +++ b/mlair/configuration/defaults.py @@ -51,7 +51,7 @@ DEFAULT_BOOTSTRAP_METHOD = "shuffle" DEFAULT_PLOT_LIST = ["PlotMonthlySummary", "PlotStationMap", "PlotClimatologicalSkillScore", "PlotTimeSeries", "PlotCompetitiveSkillScore", "PlotBootstrapSkillScore", "PlotConditionalQuantiles", "PlotAvailability", "PlotAvailabilityHistogram", "PlotDataHistogram", "PlotPeriodogram", - "PlotOversampling", "PlotOversamplingContingency"] + "PlotOversampling", "PlotContingency"] DEFAULT_SAMPLING = "daily" DEFAULT_DATA_ORIGIN = {"cloudcover": "REA", "humidity": "REA", "pblheight": "REA", "press": "REA", "relhum": "REA", "temp": "REA", "totprecip": "REA", "u": "REA", "v": "REA", "no": "", "no2": "", "o3": "", diff --git a/mlair/plotting/postprocessing_plotting.py b/mlair/plotting/postprocessing_plotting.py index 4b41c497bc2527998e2c80b22cd63ba0b76c8ae3..6eba642b44bfee786529240cd21176b3c8cc039a 100644 --- a/mlair/plotting/postprocessing_plotting.py +++ b/mlair/plotting/postprocessing_plotting.py @@ -29,13 +29,13 @@ logging.getLogger('matplotlib').setLevel(logging.WARNING) # import matplotlib.pyplot as plt @TimeTrackingWrapper -class PlotOversamplingContingency(AbstractPlotClass): +class PlotContingency(AbstractPlotClass): #Todo: Get min and max_label def __init__(self, station_names, file_path, comp_path, file_name, plot_folder: str = ".", model_name: str = "nn", obs_name: str = "obs", comp_names: str = "IntelliO3", - plot_names=["oversampling_threat_score", "oversampling_hit_rate", "oversampling_false_alarm_rate", - "oversampling_bias", "oversampling_all_scores", "contingency_table"]): + plot_names=["contingency_threat_score", "contingency_hit_rate", "contingency_false_alarm_rate", + "contingency_bias", "contingency_all_scores", "contingency_table"]): super().__init__(plot_folder, plot_names[0]) self._stations = station_names diff --git a/mlair/run_modules/post_processing.py b/mlair/run_modules/post_processing.py index 0444ccf333b5c22df4f1b4e98c27a1013dfc02e8..e6da5f00ee7b978afdc9983c38878ccb398da3cc 100644 --- a/mlair/run_modules/post_processing.py +++ b/mlair/run_modules/post_processing.py @@ -21,7 +21,7 @@ from mlair.model_modules.linear_model import OrdinaryLeastSquaredModel from mlair.model_modules import AbstractModelClass from mlair.plotting.postprocessing_plotting import PlotMonthlySummary, PlotClimatologicalSkillScore, \ PlotCompetitiveSkillScore, PlotTimeSeries, PlotBootstrapSkillScore, PlotConditionalQuantiles,\ - PlotSeparationOfScales, PlotOversamplingContingency + PlotSeparationOfScales, PlotContingency from mlair.plotting.data_insight_plotting import PlotStationMap, PlotAvailability, PlotAvailabilityHistogram, \ PlotPeriodogram, PlotDataHistogram, PlotOversampling from mlair.run_modules.run_environment import RunEnvironment @@ -340,9 +340,8 @@ class PostProcessing(RunEnvironment): iter_dim = self.data_store.get("iter_dim") try: - if (self.data_store.get('oversampling_method')=='bin_oversampling') and ( - "PlotOversamplingContingency" in plot_list): - PlotOversamplingContingency(station_names=self.test_data.keys(), file_path=path, + if ("PlotContingency" in plot_list): + PlotContingency(station_names=self.test_data.keys(), file_path=path, comp_path=self.competitor_path, comp_names=self.competitors, file_name=r"forecasts_%s_test.nc", plot_folder=self.plot_path) except Exception as e: diff --git a/test/test_configuration/test_defaults.py b/test/test_configuration/test_defaults.py index bef3c982bde8070f74c913a1ba9486cf95054def..97d80eb2e1192c3cc41d2af11cdec1f5fc8a0ca2 100644 --- a/test/test_configuration/test_defaults.py +++ b/test/test_configuration/test_defaults.py @@ -69,4 +69,4 @@ class TestAllDefaults: "PlotTimeSeries", "PlotCompetitiveSkillScore", "PlotBootstrapSkillScore", "PlotConditionalQuantiles", "PlotAvailability", "PlotAvailabilityHistogram", "PlotDataHistogram", "PlotPeriodogram", "PlotOversampling", - "PlotOversamplingContingency"] + "PlotContingency"]