Code source de xhydro.extreme_value_analysis.structures.dataitem
"""DataItem, Variable and VariableStd classes. Python equivalents to classes of the same names in Extremes.jl."""
[docs]classDataItem:"""Abstract base class for Variable and VariableStd classes."""pass
[docs]classVariable(DataItem):r""" Variable class. Parameters ---------- name : str Name of the Variable. value : list of float Values of the Variable. """name:strvalue:list[float]def__init__(self,name:str,value:list[float]):self.name,self.value=name,valuedef__repr__(self):"""String representation of the Variable."""returnf"\t\t\t\tname: {self.name}\n\t\t\t\tvalue: {self.value}\n"
[docs]classVariableStd(DataItem):r""" VariableStd class. Parameters ---------- name : str Name of the VariableStd. value : list of float Values of the VariableStd. offset : float Offset applied to the values of the VariableStd. scale : float Scale factor applied to the values of the VariableStd. """name:strvalue:list[float]offset:floatscale:floatdef__init__(self,name:str,value:list[float],offset:float,scale:float):self.name,self.value,self.offset,self.scale=name,value,offset,scale