def test_getMedianFlow(self): self.assertEqual( type(1.0), type( float( sig.getMedianFlow(self.simulation, self.observation, mode="get_signature")))) self.assertEqual( type(1.0), type( float( sig.getMedianFlow(self.simulation, None, mode="get_signature")))) self.assertEqual( type(1.0), type( float( sig.getMedianFlow(self.simulation, self.observation, mode="get_raw_data")))) self.assertEqual( type(1.0), type( float( sig.getMedianFlow(self.simulation, None, mode="get_raw_data")))) self.assertEqual( type(1.0), type( float( sig.getMedianFlow(self.simulation, self.observation, mode="calc_Dev"))))
import pandas as pd import spotpy.signatures as sig print( "INFO: For this example you need the folder >hymod< in the examples folder" ) spot_setup = spot_setup() parameterset = spot_setup.parameters()['random'] simulation = spot_setup.simulation(parameterset) observation = spot_setup.evaluation() timespanlen = simulation.__len__() ddd = pd.date_range("2015-01-01 11:00", freq="5min", periods=timespanlen) dd_daily = pd.date_range("2015-05-01", periods=timespanlen) print(sig.getMedianFlow(simulation, observation)) print( sig.getFloodFrequency(simulation, observation, pd.date_range("2015-05-01", periods=timespanlen), 3, "day")) sig.__calcFloodDuration(simulation, ddd, 3, "year", "drought") print( sig.getAverageFloodOverflowPerSection(simulation, observation, dd_daily, threshold_factor=1, section="day")) print( sig.getAverageFloodDuration(simulation, observation,