@@ -112,18 +112,22 @@ class UncOutput(ABC):
112112 @abstractmethod
113113 def __init__ (self , samples_df , unit = None ):
114114 """
115- Initialize Uncertainty Data object.
116-
117- Parameters
118- ----------
119- samples_df : pandas.DataFrame
120- input parameters samples
121- unit : str, optional
122- value unit
115+ Empty constructor to be overwritten by subclasses
123116 """
124- # Data
125- self .samples_df = samples_df
126- self .unit = unit
117+ # """
118+ # Initialize Uncertainty Data object.
119+
120+ #
121+ # Parameters
122+ # ----------
123+ # samples_df : pandas.DataFrame
124+ # input parameters samples
125+ # unit : str, optional
126+ # value unit
127+ # """
128+ ## Data
129+ # self.samples_df = samples_df
130+ # self.unit = unit
127131
128132 def order_samples (self , by_parameters ):
129133 """
@@ -1235,6 +1239,58 @@ def from_hdf5(filename):
12351239 return unc_data
12361240
12371241
1242+ class UncBaseOutput (UncOutput ):
1243+ """
1244+ Class to store and plot uncertainty and sensitivity analysis output data
1245+
1246+ This is the base class to store uncertainty and sensitivity outputs of an
1247+ analysis done on climada.engine.impact.Impact() or
1248+ climada.engine.costbenefit.CostBenefit() object.
1249+
1250+ Attributes
1251+ ----------
1252+ samples_df : pandas.DataFrame
1253+ Values of the sampled uncertainty parameters. It has n_samples rows
1254+ and one column per uncertainty parameter.
1255+ sampling_method : str
1256+ Name of the sampling method from SAlib.
1257+ https://salib.readthedocs.io/en/latest/api.html#
1258+ n_samples : int
1259+ Effective number of samples (number of rows of samples_df)
1260+ param_labels : list
1261+ Name of all the uncertainty parameters
1262+ distr_dict : dict
1263+ Comon flattened dictionary of all the distr_dict of all input variables.
1264+ It represents the distribution of all the uncertainty parameters.
1265+ problem_sa : dict
1266+ The description of the uncertainty variables and their
1267+ distribution as used in SALib.
1268+ https://salib.readthedocs.io/en/latest/basics.html.
1269+ """
1270+
1271+ _metadata = [
1272+ "sampling_method" ,
1273+ "sampling_kwargs" ,
1274+ "sensitivity_method" ,
1275+ "sensitivity_kwargs" ,
1276+ ]
1277+
1278+ def __init__ (self , samples_df , unit = None ):
1279+ """
1280+ Initialize Uncertainty Data object.
1281+
1282+ Parameters
1283+ ----------
1284+ samples_df : pandas.DataFrame
1285+ input parameters samples
1286+ unit : str, optional
1287+ value unit
1288+ """
1289+ # Data
1290+ self .samples_df = samples_df
1291+ self .unit = unit
1292+
1293+
12381294class UncImpactOutput (UncOutput ):
12391295 """Extension of UncOutput specific for CalcImpact, returned by the
12401296 uncertainty() method.
0 commit comments