HydPy 6.2.dev1__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hydpy/__init__.py +275 -0
- hydpy/aliases.py +2554 -0
- hydpy/auxs/__init__.py +0 -0
- hydpy/auxs/anntools.py +1305 -0
- hydpy/auxs/armatools.py +883 -0
- hydpy/auxs/calibtools.py +3337 -0
- hydpy/auxs/interptools.py +1094 -0
- hydpy/auxs/iuhtools.py +543 -0
- hydpy/auxs/networktools.py +597 -0
- hydpy/auxs/ppolytools.py +809 -0
- hydpy/auxs/quadtools.py +61 -0
- hydpy/auxs/roottools.py +228 -0
- hydpy/auxs/smoothtools.py +273 -0
- hydpy/auxs/statstools.py +2125 -0
- hydpy/auxs/validtools.py +81 -0
- hydpy/conf/HydPyConfigBase.xsd +68637 -0
- hydpy/conf/HydPyConfigBase.xsdt +358 -0
- hydpy/conf/HydPyConfigMultipleRuns.xsd +25 -0
- hydpy/conf/HydPyConfigSingleRun.xsd +24 -0
- hydpy/conf/__init__.py +0 -0
- hydpy/conf/a_coefficients_explicit_lobatto_sequence.npy +0 -0
- hydpy/conf/support_points_for_smoothpar_logistic2.npy +0 -0
- hydpy/config.py +42 -0
- hydpy/core/__init__.py +0 -0
- hydpy/core/aliastools.py +214 -0
- hydpy/core/autodoctools.py +1947 -0
- hydpy/core/auxfiletools.py +1169 -0
- hydpy/core/devicetools.py +3810 -0
- hydpy/core/exceptiontools.py +269 -0
- hydpy/core/filetools.py +1985 -0
- hydpy/core/hydpytools.py +3089 -0
- hydpy/core/importtools.py +1398 -0
- hydpy/core/indextools.py +345 -0
- hydpy/core/itemtools.py +1849 -0
- hydpy/core/masktools.py +460 -0
- hydpy/core/modeltools.py +4868 -0
- hydpy/core/netcdftools.py +2683 -0
- hydpy/core/objecttools.py +2023 -0
- hydpy/core/optiontools.py +1045 -0
- hydpy/core/parametertools.py +4674 -0
- hydpy/core/printtools.py +222 -0
- hydpy/core/propertytools.py +643 -0
- hydpy/core/pubtools.py +254 -0
- hydpy/core/selectiontools.py +1571 -0
- hydpy/core/sequencetools.py +4476 -0
- hydpy/core/seriestools.py +339 -0
- hydpy/core/testtools.py +2483 -0
- hydpy/core/timetools.py +3567 -0
- hydpy/core/typingtools.py +333 -0
- hydpy/core/variabletools.py +2615 -0
- hydpy/cythons/__init__.py +24 -0
- hydpy/cythons/annutils.pxd +33 -0
- hydpy/cythons/annutils.pyi +25 -0
- hydpy/cythons/annutils.pyx +120 -0
- hydpy/cythons/autogen/__init__.py +0 -0
- hydpy/cythons/autogen/annutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/annutils.pxd +42 -0
- hydpy/cythons/autogen/annutils.pyx +129 -0
- hydpy/cythons/autogen/c_arma.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_arma.pxd +179 -0
- hydpy/cythons/autogen/c_arma.pyx +356 -0
- hydpy/cythons/autogen/c_arma_rimorido.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_arma_rimorido.pxd +179 -0
- hydpy/cythons/autogen/c_arma_rimorido.pyx +356 -0
- hydpy/cythons/autogen/c_conv.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv.pxd +198 -0
- hydpy/cythons/autogen/c_conv.pyx +491 -0
- hydpy/cythons/autogen/c_conv_idw.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_idw.pxd +124 -0
- hydpy/cythons/autogen/c_conv_idw.pyx +264 -0
- hydpy/cythons/autogen/c_conv_idw_ed.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_idw_ed.pxd +197 -0
- hydpy/cythons/autogen/c_conv_idw_ed.pyx +481 -0
- hydpy/cythons/autogen/c_conv_nn.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_conv_nn.pxd +120 -0
- hydpy/cythons/autogen/c_conv_nn.pyx +224 -0
- hydpy/cythons/autogen/c_dam.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam.pxd +805 -0
- hydpy/cythons/autogen/c_dam.pyx +1477 -0
- hydpy/cythons/autogen/c_dam_llake.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_llake.pxd +364 -0
- hydpy/cythons/autogen/c_dam_llake.pyx +705 -0
- hydpy/cythons/autogen/c_dam_lreservoir.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_lreservoir.pxd +365 -0
- hydpy/cythons/autogen/c_dam_lreservoir.pyx +708 -0
- hydpy/cythons/autogen/c_dam_lretention.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_lretention.pxd +340 -0
- hydpy/cythons/autogen/c_dam_lretention.pyx +625 -0
- hydpy/cythons/autogen/c_dam_pump.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_pump.pxd +402 -0
- hydpy/cythons/autogen/c_dam_pump.pyx +724 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.pxd +452 -0
- hydpy/cythons/autogen/c_dam_pump_sluice.pyx +829 -0
- hydpy/cythons/autogen/c_dam_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_sluice.pxd +404 -0
- hydpy/cythons/autogen/c_dam_sluice.pyx +726 -0
- hydpy/cythons/autogen/c_dam_v001.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v001.pxd +452 -0
- hydpy/cythons/autogen/c_dam_v001.pyx +816 -0
- hydpy/cythons/autogen/c_dam_v002.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v002.pxd +394 -0
- hydpy/cythons/autogen/c_dam_v002.pyx +703 -0
- hydpy/cythons/autogen/c_dam_v003.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v003.pxd +417 -0
- hydpy/cythons/autogen/c_dam_v003.pyx +744 -0
- hydpy/cythons/autogen/c_dam_v004.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v004.pxd +486 -0
- hydpy/cythons/autogen/c_dam_v004.pyx +891 -0
- hydpy/cythons/autogen/c_dam_v005.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dam_v005.pxd +524 -0
- hydpy/cythons/autogen/c_dam_v005.pyx +928 -0
- hydpy/cythons/autogen/c_dummy.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy.pxd +151 -0
- hydpy/cythons/autogen/c_dummy.pyx +263 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_interceptedwater.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_node2node.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_node2node.pxd +89 -0
- hydpy/cythons/autogen/c_dummy_node2node.pyx +148 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowalbedo.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_snowcover.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowcover.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowcover.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_snowycanopy.pyx +104 -0
- hydpy/cythons/autogen/c_dummy_soilwater.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_dummy_soilwater.pxd +69 -0
- hydpy/cythons/autogen/c_dummy_soilwater.pyx +104 -0
- hydpy/cythons/autogen/c_evap.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap.pxd +1029 -0
- hydpy/cythons/autogen/c_evap.pyx +2601 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.pxd +227 -0
- hydpy/cythons/autogen/c_evap_aet_hbv96.pyx +584 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.pxd +193 -0
- hydpy/cythons/autogen/c_evap_aet_minhas.pyx +478 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.pxd +681 -0
- hydpy/cythons/autogen/c_evap_aet_morsim.pyx +1642 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.pxd +532 -0
- hydpy/cythons/autogen/c_evap_pet_ambav1.pyx +1296 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.pxd +179 -0
- hydpy/cythons/autogen/c_evap_pet_hbv96.pyx +328 -0
- hydpy/cythons/autogen/c_evap_pet_m.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_m.pxd +124 -0
- hydpy/cythons/autogen/c_evap_pet_m.pyx +214 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.pxd +126 -0
- hydpy/cythons/autogen/c_evap_pet_mlc.pyx +214 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.pxd +305 -0
- hydpy/cythons/autogen/c_evap_ret_fao56.pyx +624 -0
- hydpy/cythons/autogen/c_evap_ret_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_io.pxd +112 -0
- hydpy/cythons/autogen/c_evap_ret_io.pyx +176 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.pxd +139 -0
- hydpy/cythons/autogen/c_evap_ret_tw2002.pyx +273 -0
- hydpy/cythons/autogen/c_exch.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch.pxd +230 -0
- hydpy/cythons/autogen/c_exch.pyx +462 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.pxd +134 -0
- hydpy/cythons/autogen/c_exch_branch_hbv96.pyx +255 -0
- hydpy/cythons/autogen/c_exch_waterlevel.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_waterlevel.pxd +54 -0
- hydpy/cythons/autogen/c_exch_waterlevel.pyx +78 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.pxd +156 -0
- hydpy/cythons/autogen/c_exch_weir_hbv96.pyx +282 -0
- hydpy/cythons/autogen/c_ga.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga.pxd +353 -0
- hydpy/cythons/autogen/c_ga.pyx +1204 -0
- hydpy/cythons/autogen/c_ga_garto.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga_garto.pxd +330 -0
- hydpy/cythons/autogen/c_ga_garto.pyx +1105 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.pxd +236 -0
- hydpy/cythons/autogen/c_ga_garto_submodel1.pyx +944 -0
- hydpy/cythons/autogen/c_gland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland.pxd +437 -0
- hydpy/cythons/autogen/c_gland.pyx +726 -0
- hydpy/cythons/autogen/c_gland_gr4.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr4.pxd +382 -0
- hydpy/cythons/autogen/c_gland_gr4.pyx +605 -0
- hydpy/cythons/autogen/c_gland_gr5.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr5.pxd +368 -0
- hydpy/cythons/autogen/c_gland_gr5.pyx +568 -0
- hydpy/cythons/autogen/c_gland_gr6.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_gland_gr6.pxd +420 -0
- hydpy/cythons/autogen/c_gland_gr6.pyx +673 -0
- hydpy/cythons/autogen/c_hland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland.pxd +855 -0
- hydpy/cythons/autogen/c_hland.pyx +2486 -0
- hydpy/cythons/autogen/c_hland_96.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96.pxd +631 -0
- hydpy/cythons/autogen/c_hland_96.pyx +1724 -0
- hydpy/cythons/autogen/c_hland_96c.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96c.pxd +621 -0
- hydpy/cythons/autogen/c_hland_96c.pyx +1822 -0
- hydpy/cythons/autogen/c_hland_96p.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_hland_96p.pxd +683 -0
- hydpy/cythons/autogen/c_hland_96p.pyx +1911 -0
- hydpy/cythons/autogen/c_kinw.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw.pxd +509 -0
- hydpy/cythons/autogen/c_kinw.pyx +965 -0
- hydpy/cythons/autogen/c_kinw_williams.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw_williams.pxd +409 -0
- hydpy/cythons/autogen/c_kinw_williams.pyx +763 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.pxd +220 -0
- hydpy/cythons/autogen/c_kinw_williams_ext.pyx +440 -0
- hydpy/cythons/autogen/c_lland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland.pxd +1386 -0
- hydpy/cythons/autogen/c_lland.pyx +3679 -0
- hydpy/cythons/autogen/c_lland_dd.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_dd.pxd +679 -0
- hydpy/cythons/autogen/c_lland_dd.pyx +1719 -0
- hydpy/cythons/autogen/c_lland_knauf.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_knauf.pxd +1096 -0
- hydpy/cythons/autogen/c_lland_knauf.pyx +2784 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.pxd +1369 -0
- hydpy/cythons/autogen/c_lland_knauf_ic.pyx +3625 -0
- hydpy/cythons/autogen/c_meteo.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo.pxd +469 -0
- hydpy/cythons/autogen/c_meteo.pyx +879 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.pxd +75 -0
- hydpy/cythons/autogen/c_meteo_clear_glob_io.pyx +107 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.pxd +209 -0
- hydpy/cythons/autogen/c_meteo_glob_fao56.pyx +339 -0
- hydpy/cythons/autogen/c_meteo_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_io.pxd +63 -0
- hydpy/cythons/autogen/c_meteo_glob_io.pyx +91 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.pxd +289 -0
- hydpy/cythons/autogen/c_meteo_glob_morsim.pyx +527 -0
- hydpy/cythons/autogen/c_meteo_precip_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_precip_io.pxd +112 -0
- hydpy/cythons/autogen/c_meteo_precip_io.pyx +176 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.pxd +87 -0
- hydpy/cythons/autogen/c_meteo_psun_sun_glob_io.pyx +123 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.pxd +209 -0
- hydpy/cythons/autogen/c_meteo_sun_fao56.pyx +343 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.pxd +286 -0
- hydpy/cythons/autogen/c_meteo_sun_morsim.pyx +519 -0
- hydpy/cythons/autogen/c_meteo_temp_io.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_meteo_temp_io.pxd +112 -0
- hydpy/cythons/autogen/c_meteo_temp_io.pyx +176 -0
- hydpy/cythons/autogen/c_musk.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk.pxd +282 -0
- hydpy/cythons/autogen/c_musk.pyx +605 -0
- hydpy/cythons/autogen/c_musk_classic.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk_classic.pxd +138 -0
- hydpy/cythons/autogen/c_musk_classic.pyx +226 -0
- hydpy/cythons/autogen/c_musk_mct.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_musk_mct.pxd +282 -0
- hydpy/cythons/autogen/c_musk_mct.pyx +609 -0
- hydpy/cythons/autogen/c_rconc.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc.pxd +119 -0
- hydpy/cythons/autogen/c_rconc.pyx +174 -0
- hydpy/cythons/autogen/c_rconc_nash.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc_nash.pxd +111 -0
- hydpy/cythons/autogen/c_rconc_nash.pyx +185 -0
- hydpy/cythons/autogen/c_rconc_uh.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_rconc_uh.pxd +92 -0
- hydpy/cythons/autogen/c_rconc_uh.pyx +125 -0
- hydpy/cythons/autogen/c_sw1d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d.pxd +511 -0
- hydpy/cythons/autogen/c_sw1d.pyx +1263 -0
- hydpy/cythons/autogen/c_sw1d_channel.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_channel.pxd +119 -0
- hydpy/cythons/autogen/c_sw1d_channel.pyx +300 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.pxd +240 -0
- hydpy/cythons/autogen/c_sw1d_gate_out.pyx +476 -0
- hydpy/cythons/autogen/c_sw1d_lias.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_lias.pxd +320 -0
- hydpy/cythons/autogen/c_sw1d_lias.pyx +619 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.pxd +325 -0
- hydpy/cythons/autogen/c_sw1d_lias_sluice.pyx +644 -0
- hydpy/cythons/autogen/c_sw1d_network.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_network.pxd +90 -0
- hydpy/cythons/autogen/c_sw1d_network.pyx +246 -0
- hydpy/cythons/autogen/c_sw1d_pump.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_pump.pxd +256 -0
- hydpy/cythons/autogen/c_sw1d_pump.pyx +502 -0
- hydpy/cythons/autogen/c_sw1d_q_in.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_q_in.pxd +224 -0
- hydpy/cythons/autogen/c_sw1d_q_in.pyx +383 -0
- hydpy/cythons/autogen/c_sw1d_q_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_q_out.pxd +224 -0
- hydpy/cythons/autogen/c_sw1d_q_out.pyx +383 -0
- hydpy/cythons/autogen/c_sw1d_storage.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_storage.pxd +193 -0
- hydpy/cythons/autogen/c_sw1d_storage.pyx +349 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.pxd +212 -0
- hydpy/cythons/autogen/c_sw1d_weir_out.pyx +404 -0
- hydpy/cythons/autogen/c_test.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test.pxd +175 -0
- hydpy/cythons/autogen/c_test.pyx +348 -0
- hydpy/cythons/autogen/c_test_discontinous.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_discontinous.pxd +146 -0
- hydpy/cythons/autogen/c_test_discontinous.pyx +256 -0
- hydpy/cythons/autogen/c_test_stiff0d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_stiff0d.pxd +146 -0
- hydpy/cythons/autogen/c_test_stiff0d.pyx +250 -0
- hydpy/cythons/autogen/c_test_stiff1d.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_test_stiff1d.pxd +145 -0
- hydpy/cythons/autogen/c_test_stiff1d.pyx +294 -0
- hydpy/cythons/autogen/c_whmod.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod.pxd +482 -0
- hydpy/cythons/autogen/c_whmod.pyx +1156 -0
- hydpy/cythons/autogen/c_whmod_rural.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod_rural.pxd +411 -0
- hydpy/cythons/autogen/c_whmod_rural.pyx +982 -0
- hydpy/cythons/autogen/c_whmod_urban.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_whmod_urban.pxd +482 -0
- hydpy/cythons/autogen/c_whmod_urban.pyx +1155 -0
- hydpy/cythons/autogen/c_wland.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland.pxd +842 -0
- hydpy/cythons/autogen/c_wland.pyx +1890 -0
- hydpy/cythons/autogen/c_wland_gd.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland_gd.pxd +829 -0
- hydpy/cythons/autogen/c_wland_gd.pyx +1847 -0
- hydpy/cythons/autogen/c_wland_wag.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wland_wag.pxd +810 -0
- hydpy/cythons/autogen/c_wland_wag.pyx +1780 -0
- hydpy/cythons/autogen/c_wq.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq.pxd +275 -0
- hydpy/cythons/autogen/c_wq.pyx +652 -0
- hydpy/cythons/autogen/c_wq_trapeze.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_trapeze.pxd +170 -0
- hydpy/cythons/autogen/c_wq_trapeze.pyx +400 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.pxd +243 -0
- hydpy/cythons/autogen/c_wq_trapeze_strickler.pyx +578 -0
- hydpy/cythons/autogen/c_wq_walrus.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/c_wq_walrus.pxd +61 -0
- hydpy/cythons/autogen/c_wq_walrus.pyx +82 -0
- hydpy/cythons/autogen/configutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/configutils.pxd +17 -0
- hydpy/cythons/autogen/configutils.pyx +119 -0
- hydpy/cythons/autogen/interfaceutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/interfaceutils.pxd +31 -0
- hydpy/cythons/autogen/interfaceutils.pyx +82 -0
- hydpy/cythons/autogen/interputils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/interputils.pxd +42 -0
- hydpy/cythons/autogen/interputils.pyx +118 -0
- hydpy/cythons/autogen/masterinterface.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/masterinterface.pxd +153 -0
- hydpy/cythons/autogen/masterinterface.pyx +222 -0
- hydpy/cythons/autogen/pointerutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/pointerutils.pxd +31 -0
- hydpy/cythons/autogen/pointerutils.pyx +650 -0
- hydpy/cythons/autogen/ppolyutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/ppolyutils.pxd +35 -0
- hydpy/cythons/autogen/ppolyutils.pyx +59 -0
- hydpy/cythons/autogen/quadutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/quadutils.pxd +26 -0
- hydpy/cythons/autogen/quadutils.pyx +973 -0
- hydpy/cythons/autogen/rootutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/rootutils.pxd +28 -0
- hydpy/cythons/autogen/rootutils.pyx +109 -0
- hydpy/cythons/autogen/sequenceutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/sequenceutils.pxd +45 -0
- hydpy/cythons/autogen/sequenceutils.pyx +101 -0
- hydpy/cythons/autogen/smoothutils.cp313-win_amd64.pyd +0 -0
- hydpy/cythons/autogen/smoothutils.pxd +29 -0
- hydpy/cythons/autogen/smoothutils.pyx +833 -0
- hydpy/cythons/configutils.pxd +8 -0
- hydpy/cythons/configutils.pyi +5 -0
- hydpy/cythons/configutils.pyx +110 -0
- hydpy/cythons/interfaceutils.pxd +22 -0
- hydpy/cythons/interfaceutils.pyi +15 -0
- hydpy/cythons/interfaceutils.pyx +73 -0
- hydpy/cythons/interputils.pxd +33 -0
- hydpy/cythons/interputils.pyi +32 -0
- hydpy/cythons/interputils.pyx +109 -0
- hydpy/cythons/modelutils.py +2990 -0
- hydpy/cythons/pointerutils.pxd +22 -0
- hydpy/cythons/pointerutils.pyi +89 -0
- hydpy/cythons/pointerutils.pyx +641 -0
- hydpy/cythons/ppolyutils.pxd +26 -0
- hydpy/cythons/ppolyutils.pyi +21 -0
- hydpy/cythons/ppolyutils.pyx +50 -0
- hydpy/cythons/quadutils.pxd +17 -0
- hydpy/cythons/quadutils.pyi +13 -0
- hydpy/cythons/quadutils.pyx +964 -0
- hydpy/cythons/rootutils.pxd +19 -0
- hydpy/cythons/rootutils.pyi +21 -0
- hydpy/cythons/rootutils.pyx +100 -0
- hydpy/cythons/sequenceutils.pxd +36 -0
- hydpy/cythons/sequenceutils.pyi +7 -0
- hydpy/cythons/sequenceutils.pyx +92 -0
- hydpy/cythons/smoothutils.pxd +20 -0
- hydpy/cythons/smoothutils.pyi +15 -0
- hydpy/cythons/smoothutils.pyx +824 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_dill_assl.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_kalk.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_leun.py +14 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/land_lahn_marb.py +13 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_dill_assl_lahn_leun.py +5 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_lahn_leun_lahn_kalk.py +5 -0
- hydpy/data/HydPy-H-Lahn/conditions/init_1996_01_01_00_00_00/stream_lahn_marb_lahn_leun.py +5 -0
- hydpy/data/HydPy-H-Lahn/control/default/land.py +9 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_dill_assl.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_kalk.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_leun.py +56 -0
- hydpy/data/HydPy-H-Lahn/control/default/land_lahn_marb.py +57 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_dill_assl_lahn_leun.py +7 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_lahn_leun_lahn_kalk.py +7 -0
- hydpy/data/HydPy-H-Lahn/control/default/stream_lahn_marb_lahn_leun.py +7 -0
- hydpy/data/HydPy-H-Lahn/multiple_runs.xml +309 -0
- hydpy/data/HydPy-H-Lahn/multiple_runs_alpha.xml +71 -0
- hydpy/data/HydPy-H-Lahn/network/default/headwaters.py +11 -0
- hydpy/data/HydPy-H-Lahn/network/default/nonheadwaters.py +11 -0
- hydpy/data/HydPy-H-Lahn/network/default/streams.py +8 -0
- hydpy/data/HydPy-H-Lahn/series/default/dill_assl_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/evap_pet_hbv96_input_normalairtemperature.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/evap_pet_hbv96_input_normalevapotranspiration.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/hland_96_input_p.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/hland_96_input_t.nc +0 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_kalk_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_leun_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/lahn_marb_obs_q.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_dill_assl_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_kalk_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_leun_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_evap_pet_hbv96_input_normalairtemperature.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_evap_pet_hbv96_input_normalevapotranspiration.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_hland_96_input_p.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/land_lahn_marb_hland_96_input_t.asc +11387 -0
- hydpy/data/HydPy-H-Lahn/series/default/obs_q.nc +0 -0
- hydpy/data/HydPy-H-Lahn/single_run.xml +152 -0
- hydpy/data/HydPy-H-Lahn/single_run.xmlt +143 -0
- hydpy/data/__init__.py +17 -0
- hydpy/docs/__init__.py +0 -0
- hydpy/docs/autofigs/__init__.py +0 -0
- hydpy/docs/bib/__init__.py +0 -0
- hydpy/docs/bib/refs.bib +566 -0
- hydpy/docs/combine_docversions.py +133 -0
- hydpy/docs/draw_model_sketches.py +1301 -0
- hydpy/docs/enable_autodoc.py +7 -0
- hydpy/docs/figs/HydPy-G-GR4.png +0 -0
- hydpy/docs/figs/HydPy-G-GR5.png +0 -0
- hydpy/docs/figs/HydPy-G-GR6.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96-COSERO.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96-PREVAH.png +0 -0
- hydpy/docs/figs/HydPy-H-HBV96.png +0 -0
- hydpy/docs/figs/HydPy-H-Lahn.png +0 -0
- hydpy/docs/figs/HydPy-KinW-Williams.png +0 -0
- hydpy/docs/figs/HydPy-L-DD.png +0 -0
- hydpy/docs/figs/HydPy-W-Wag.png +0 -0
- hydpy/docs/figs/HydPy_Logo.png +0 -0
- hydpy/docs/figs/HydPy_Logo_Text.png +0 -0
- hydpy/docs/figs/IDLE-editor.png +0 -0
- hydpy/docs/figs/IDLE-shell.png +0 -0
- hydpy/docs/figs/LAWA_river-basin-bumbers.png +0 -0
- hydpy/docs/figs/__init__.py +0 -0
- hydpy/docs/html_/__init__.py +0 -0
- hydpy/docs/polish_html.py +57 -0
- hydpy/docs/prepare.py +224 -0
- hydpy/docs/publish_docs.py +53 -0
- hydpy/docs/rst/HydPy-ARMA.rst +27 -0
- hydpy/docs/rst/HydPy-Conv.rst +22 -0
- hydpy/docs/rst/HydPy-Dam.rst +79 -0
- hydpy/docs/rst/HydPy-Dummy.rst +21 -0
- hydpy/docs/rst/HydPy-Evap.rst +26 -0
- hydpy/docs/rst/HydPy-Exch.rst +36 -0
- hydpy/docs/rst/HydPy-G.rst +40 -0
- hydpy/docs/rst/HydPy-GA.rst +34 -0
- hydpy/docs/rst/HydPy-H.rst +24 -0
- hydpy/docs/rst/HydPy-KinW.rst +32 -0
- hydpy/docs/rst/HydPy-L.rst +42 -0
- hydpy/docs/rst/HydPy-Meteo.rst +28 -0
- hydpy/docs/rst/HydPy-Musk.rst +21 -0
- hydpy/docs/rst/HydPy-Rconc.rst +17 -0
- hydpy/docs/rst/HydPy-SW1D.rst +49 -0
- hydpy/docs/rst/HydPy-Test.rst +19 -0
- hydpy/docs/rst/HydPy-W.rst +20 -0
- hydpy/docs/rst/HydPy-WHMod.rst +19 -0
- hydpy/docs/rst/HydPy-WQ.rst +20 -0
- hydpy/docs/rst/__init__.py +0 -0
- hydpy/docs/rst/additional_repositories.rst +40 -0
- hydpy/docs/rst/auxiliaries.rst +31 -0
- hydpy/docs/rst/continuous_integration.rst +75 -0
- hydpy/docs/rst/core.rst +75 -0
- hydpy/docs/rst/cythons.rst +47 -0
- hydpy/docs/rst/definitions.rst +506 -0
- hydpy/docs/rst/developer_guide.rst +54 -0
- hydpy/docs/rst/example_projects.rst +40 -0
- hydpy/docs/rst/execution.rst +22 -0
- hydpy/docs/rst/framework_tools.rst +56 -0
- hydpy/docs/rst/how_to_read_the_reference_manual.rst +156 -0
- hydpy/docs/rst/hydpydependencies.rst +55 -0
- hydpy/docs/rst/index.rst +125 -0
- hydpy/docs/rst/installation.rst +155 -0
- hydpy/docs/rst/model_families.rst +79 -0
- hydpy/docs/rst/model_overview.rst +291 -0
- hydpy/docs/rst/modelimports.rst +10 -0
- hydpy/docs/rst/options.rst +119 -0
- hydpy/docs/rst/programming_style.rst +572 -0
- hydpy/docs/rst/project_structure.rst +520 -0
- hydpy/docs/rst/quickstart.rst +304 -0
- hydpy/docs/rst/reference_manual.rst +29 -0
- hydpy/docs/rst/required_tools.rst +50 -0
- hydpy/docs/rst/simulation.rst +514 -0
- hydpy/docs/rst/submodel_interfaces.rst +32 -0
- hydpy/docs/rst/tests_and_documentation.rst +85 -0
- hydpy/docs/rst/user_guide.rst +38 -0
- hydpy/docs/rst/version_control.rst +116 -0
- hydpy/docs/rst/zbibliography.rst +8 -0
- hydpy/docs/sphinx/__init__.py +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/frameset.html +11 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/rstsource.html +15 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/changes/versionchanges.html +33 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/defindex.html +35 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/domainindex.html +56 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex-single.html +63 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex-split.html +41 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/genindex.html +76 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/globaltoc.html +11 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/layout.html +221 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/localtoc.html +15 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/opensearch.xml +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/page.html +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/relations.html +23 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/search.html +65 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/searchbox.html +21 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/searchfield.html +23 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/sourcelink.html +18 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/basic.css_t +925 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/doctools.js +156 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/documentation_options.js_t +13 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/file.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/language_data.js_t +26 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/minus.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/plus.png +0 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/searchtools.js +574 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/static/sphinx_highlight.js +154 -0
- hydpy/docs/sphinx/_themes/basic_hydpy/theme.conf +16 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/layout.html +23 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/static/classic.css_t +358 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/static/sidebar.js_t +72 -0
- hydpy/docs/sphinx/_themes/classic_hydpy/theme.conf +32 -0
- hydpy/docs/sphinx/conf.py +398 -0
- hydpy/docs/sphinx/defaultlinks_extension.py +36 -0
- hydpy/docs/sphinx/integrationtest_extension.py +104 -0
- hydpy/docs/sphinx/projectstructure_extension.py +58 -0
- hydpy/docs/sphinx/submodelgraph_extension.py +53 -0
- hydpy/exe/__init__.py +0 -0
- hydpy/exe/commandtools.py +651 -0
- hydpy/exe/hyd.py +277 -0
- hydpy/exe/modelimports.py +41 -0
- hydpy/exe/replacetools.py +216 -0
- hydpy/exe/servertools.py +2348 -0
- hydpy/exe/xmltools.py +3280 -0
- hydpy/interfaces/__init__.py +0 -0
- hydpy/interfaces/aetinterfaces.py +94 -0
- hydpy/interfaces/dischargeinterfaces.py +45 -0
- hydpy/interfaces/petinterfaces.py +117 -0
- hydpy/interfaces/precipinterfaces.py +42 -0
- hydpy/interfaces/radiationinterfaces.py +79 -0
- hydpy/interfaces/rconcinterfaces.py +30 -0
- hydpy/interfaces/routinginterfaces.py +324 -0
- hydpy/interfaces/soilinterfaces.py +96 -0
- hydpy/interfaces/stateinterfaces.py +98 -0
- hydpy/interfaces/tempinterfaces.py +46 -0
- hydpy/models/__init__.py +0 -0
- hydpy/models/arma/__init__.py +14 -0
- hydpy/models/arma/arma_control.py +383 -0
- hydpy/models/arma/arma_derived.py +204 -0
- hydpy/models/arma/arma_fluxes.py +41 -0
- hydpy/models/arma/arma_inlets.py +11 -0
- hydpy/models/arma/arma_logs.py +19 -0
- hydpy/models/arma/arma_model.py +461 -0
- hydpy/models/arma/arma_outlets.py +11 -0
- hydpy/models/arma_rimorido.py +381 -0
- hydpy/models/conv/__init__.py +12 -0
- hydpy/models/conv/conv_control.py +303 -0
- hydpy/models/conv/conv_derived.py +271 -0
- hydpy/models/conv/conv_fluxes.py +54 -0
- hydpy/models/conv/conv_inlets.py +11 -0
- hydpy/models/conv/conv_model.py +687 -0
- hydpy/models/conv/conv_outlets.py +11 -0
- hydpy/models/conv_idw.py +120 -0
- hydpy/models/conv_idw_ed.py +184 -0
- hydpy/models/conv_nn.py +112 -0
- hydpy/models/dam/__init__.py +16 -0
- hydpy/models/dam/dam_aides.py +17 -0
- hydpy/models/dam/dam_control.py +346 -0
- hydpy/models/dam/dam_derived.py +559 -0
- hydpy/models/dam/dam_factors.py +46 -0
- hydpy/models/dam/dam_fluxes.py +179 -0
- hydpy/models/dam/dam_inlets.py +29 -0
- hydpy/models/dam/dam_logs.py +52 -0
- hydpy/models/dam/dam_model.py +5011 -0
- hydpy/models/dam/dam_outlets.py +23 -0
- hydpy/models/dam/dam_receivers.py +41 -0
- hydpy/models/dam/dam_senders.py +23 -0
- hydpy/models/dam/dam_solver.py +75 -0
- hydpy/models/dam/dam_states.py +11 -0
- hydpy/models/dam_llake.py +499 -0
- hydpy/models/dam_lreservoir.py +548 -0
- hydpy/models/dam_lretention.py +343 -0
- hydpy/models/dam_pump.py +278 -0
- hydpy/models/dam_pump_sluice.py +339 -0
- hydpy/models/dam_sluice.py +319 -0
- hydpy/models/dam_v001.py +1127 -0
- hydpy/models/dam_v002.py +381 -0
- hydpy/models/dam_v003.py +422 -0
- hydpy/models/dam_v004.py +665 -0
- hydpy/models/dam_v005.py +479 -0
- hydpy/models/dummy/__init__.py +15 -0
- hydpy/models/dummy/dummy_control.py +22 -0
- hydpy/models/dummy/dummy_fluxes.py +11 -0
- hydpy/models/dummy/dummy_inlets.py +11 -0
- hydpy/models/dummy/dummy_inputs.py +41 -0
- hydpy/models/dummy/dummy_model.py +196 -0
- hydpy/models/dummy/dummy_outlets.py +11 -0
- hydpy/models/dummy_interceptedwater.py +85 -0
- hydpy/models/dummy_node2node.py +83 -0
- hydpy/models/dummy_snowalbedo.py +84 -0
- hydpy/models/dummy_snowcover.py +84 -0
- hydpy/models/dummy_snowycanopy.py +86 -0
- hydpy/models/dummy_soilwater.py +85 -0
- hydpy/models/evap/__init__.py +13 -0
- hydpy/models/evap/evap_control.py +354 -0
- hydpy/models/evap/evap_derived.py +236 -0
- hydpy/models/evap/evap_factors.py +188 -0
- hydpy/models/evap/evap_fixed.py +68 -0
- hydpy/models/evap/evap_fluxes.py +150 -0
- hydpy/models/evap/evap_inputs.py +54 -0
- hydpy/models/evap/evap_logs.py +91 -0
- hydpy/models/evap/evap_masks.py +48 -0
- hydpy/models/evap/evap_model.py +9170 -0
- hydpy/models/evap/evap_parameters.py +149 -0
- hydpy/models/evap/evap_sequences.py +32 -0
- hydpy/models/evap/evap_states.py +18 -0
- hydpy/models/evap_aet_hbv96.py +372 -0
- hydpy/models/evap_aet_minhas.py +331 -0
- hydpy/models/evap_aet_morsim.py +627 -0
- hydpy/models/evap_pet_ambav1.py +483 -0
- hydpy/models/evap_pet_hbv96.py +147 -0
- hydpy/models/evap_pet_m.py +94 -0
- hydpy/models/evap_pet_mlc.py +107 -0
- hydpy/models/evap_ret_fao56.py +265 -0
- hydpy/models/evap_ret_io.py +74 -0
- hydpy/models/evap_ret_tw2002.py +165 -0
- hydpy/models/exch/__init__.py +14 -0
- hydpy/models/exch/exch_control.py +262 -0
- hydpy/models/exch/exch_derived.py +36 -0
- hydpy/models/exch/exch_factors.py +26 -0
- hydpy/models/exch/exch_fluxes.py +48 -0
- hydpy/models/exch/exch_inlets.py +11 -0
- hydpy/models/exch/exch_logs.py +12 -0
- hydpy/models/exch/exch_model.py +451 -0
- hydpy/models/exch/exch_outlets.py +17 -0
- hydpy/models/exch/exch_receivers.py +17 -0
- hydpy/models/exch_branch_hbv96.py +186 -0
- hydpy/models/exch_waterlevel.py +73 -0
- hydpy/models/exch_weir_hbv96.py +609 -0
- hydpy/models/ga/__init__.py +14 -0
- hydpy/models/ga/ga_aides.py +17 -0
- hydpy/models/ga/ga_control.py +208 -0
- hydpy/models/ga/ga_derived.py +77 -0
- hydpy/models/ga/ga_fluxes.py +83 -0
- hydpy/models/ga/ga_inputs.py +26 -0
- hydpy/models/ga/ga_logs.py +17 -0
- hydpy/models/ga/ga_model.py +2952 -0
- hydpy/models/ga/ga_states.py +87 -0
- hydpy/models/ga_garto.py +1001 -0
- hydpy/models/ga_garto_submodel1.py +79 -0
- hydpy/models/gland/__init__.py +14 -0
- hydpy/models/gland/gland_control.py +90 -0
- hydpy/models/gland/gland_derived.py +113 -0
- hydpy/models/gland/gland_fluxes.py +137 -0
- hydpy/models/gland/gland_inputs.py +12 -0
- hydpy/models/gland/gland_model.py +1439 -0
- hydpy/models/gland/gland_outlets.py +11 -0
- hydpy/models/gland/gland_states.py +90 -0
- hydpy/models/gland_gr4.py +501 -0
- hydpy/models/gland_gr5.py +463 -0
- hydpy/models/gland_gr6.py +487 -0
- hydpy/models/hland/__init__.py +20 -0
- hydpy/models/hland/hland_aides.py +19 -0
- hydpy/models/hland/hland_constants.py +37 -0
- hydpy/models/hland/hland_control.py +1530 -0
- hydpy/models/hland/hland_derived.py +683 -0
- hydpy/models/hland/hland_factors.py +57 -0
- hydpy/models/hland/hland_fixed.py +42 -0
- hydpy/models/hland/hland_fluxes.py +279 -0
- hydpy/models/hland/hland_inputs.py +19 -0
- hydpy/models/hland/hland_masks.py +107 -0
- hydpy/models/hland/hland_model.py +4664 -0
- hydpy/models/hland/hland_outlets.py +11 -0
- hydpy/models/hland/hland_parameters.py +227 -0
- hydpy/models/hland/hland_sequences.py +382 -0
- hydpy/models/hland/hland_states.py +236 -0
- hydpy/models/hland_96.py +1812 -0
- hydpy/models/hland_96c.py +1196 -0
- hydpy/models/hland_96p.py +1204 -0
- hydpy/models/kinw/__init__.py +18 -0
- hydpy/models/kinw/kinw_aides.py +306 -0
- hydpy/models/kinw/kinw_control.py +270 -0
- hydpy/models/kinw/kinw_derived.py +197 -0
- hydpy/models/kinw/kinw_fixed.py +33 -0
- hydpy/models/kinw/kinw_fluxes.py +37 -0
- hydpy/models/kinw/kinw_inlets.py +11 -0
- hydpy/models/kinw/kinw_model.py +3026 -0
- hydpy/models/kinw/kinw_outlets.py +11 -0
- hydpy/models/kinw/kinw_solver.py +45 -0
- hydpy/models/kinw/kinw_states.py +17 -0
- hydpy/models/kinw_williams.py +1299 -0
- hydpy/models/kinw_williams_ext.py +768 -0
- hydpy/models/lland/__init__.py +42 -0
- hydpy/models/lland/lland_aides.py +38 -0
- hydpy/models/lland/lland_constants.py +88 -0
- hydpy/models/lland/lland_control.py +1329 -0
- hydpy/models/lland/lland_derived.py +380 -0
- hydpy/models/lland/lland_factors.py +18 -0
- hydpy/models/lland/lland_fixed.py +128 -0
- hydpy/models/lland/lland_fluxes.py +626 -0
- hydpy/models/lland/lland_inlets.py +12 -0
- hydpy/models/lland/lland_inputs.py +33 -0
- hydpy/models/lland/lland_logs.py +17 -0
- hydpy/models/lland/lland_masks.py +212 -0
- hydpy/models/lland/lland_model.py +7690 -0
- hydpy/models/lland/lland_outlets.py +12 -0
- hydpy/models/lland/lland_parameters.py +195 -0
- hydpy/models/lland/lland_sequences.py +67 -0
- hydpy/models/lland/lland_states.py +280 -0
- hydpy/models/lland_dd.py +2270 -0
- hydpy/models/lland_knauf.py +2156 -0
- hydpy/models/lland_knauf_ic.py +1920 -0
- hydpy/models/meteo/__init__.py +12 -0
- hydpy/models/meteo/meteo_control.py +154 -0
- hydpy/models/meteo/meteo_derived.py +159 -0
- hydpy/models/meteo/meteo_factors.py +88 -0
- hydpy/models/meteo/meteo_fixed.py +19 -0
- hydpy/models/meteo/meteo_fluxes.py +46 -0
- hydpy/models/meteo/meteo_inputs.py +47 -0
- hydpy/models/meteo/meteo_logs.py +30 -0
- hydpy/models/meteo/meteo_model.py +2904 -0
- hydpy/models/meteo/meteo_parameters.py +14 -0
- hydpy/models/meteo/meteo_sequences.py +22 -0
- hydpy/models/meteo_clear_glob_io.py +77 -0
- hydpy/models/meteo_glob_fao56.py +217 -0
- hydpy/models/meteo_glob_io.py +68 -0
- hydpy/models/meteo_glob_morsim.py +444 -0
- hydpy/models/meteo_precip_io.py +76 -0
- hydpy/models/meteo_psun_sun_glob_io.py +83 -0
- hydpy/models/meteo_sun_fao56.py +188 -0
- hydpy/models/meteo_sun_morsim.py +466 -0
- hydpy/models/meteo_temp_io.py +76 -0
- hydpy/models/musk/__init__.py +15 -0
- hydpy/models/musk/musk_control.py +328 -0
- hydpy/models/musk/musk_derived.py +32 -0
- hydpy/models/musk/musk_factors.py +53 -0
- hydpy/models/musk/musk_fluxes.py +24 -0
- hydpy/models/musk/musk_inlets.py +11 -0
- hydpy/models/musk/musk_masks.py +15 -0
- hydpy/models/musk/musk_model.py +838 -0
- hydpy/models/musk/musk_outlets.py +11 -0
- hydpy/models/musk/musk_sequences.py +88 -0
- hydpy/models/musk/musk_solver.py +68 -0
- hydpy/models/musk/musk_states.py +64 -0
- hydpy/models/musk_classic.py +228 -0
- hydpy/models/musk_mct.py +1247 -0
- hydpy/models/rconc/__init__.py +12 -0
- hydpy/models/rconc/rconc_control.py +473 -0
- hydpy/models/rconc/rconc_derived.py +76 -0
- hydpy/models/rconc/rconc_fluxes.py +19 -0
- hydpy/models/rconc/rconc_logs.py +74 -0
- hydpy/models/rconc/rconc_model.py +260 -0
- hydpy/models/rconc/rconc_states.py +11 -0
- hydpy/models/rconc_nash.py +48 -0
- hydpy/models/rconc_uh.py +53 -0
- hydpy/models/sw1d/__init__.py +17 -0
- hydpy/models/sw1d/sw1d_control.py +356 -0
- hydpy/models/sw1d/sw1d_derived.py +85 -0
- hydpy/models/sw1d/sw1d_factors.py +78 -0
- hydpy/models/sw1d/sw1d_fixed.py +12 -0
- hydpy/models/sw1d/sw1d_fluxes.py +55 -0
- hydpy/models/sw1d/sw1d_inlets.py +17 -0
- hydpy/models/sw1d/sw1d_model.py +3385 -0
- hydpy/models/sw1d/sw1d_outlets.py +11 -0
- hydpy/models/sw1d/sw1d_receivers.py +11 -0
- hydpy/models/sw1d/sw1d_senders.py +11 -0
- hydpy/models/sw1d/sw1d_states.py +23 -0
- hydpy/models/sw1d_channel.py +2051 -0
- hydpy/models/sw1d_gate_out.py +599 -0
- hydpy/models/sw1d_lias.py +105 -0
- hydpy/models/sw1d_lias_sluice.py +531 -0
- hydpy/models/sw1d_network.py +1219 -0
- hydpy/models/sw1d_pump.py +448 -0
- hydpy/models/sw1d_q_in.py +79 -0
- hydpy/models/sw1d_q_out.py +81 -0
- hydpy/models/sw1d_storage.py +78 -0
- hydpy/models/sw1d_weir_out.py +75 -0
- hydpy/models/test/__init__.py +14 -0
- hydpy/models/test/test_control.py +28 -0
- hydpy/models/test/test_fluxes.py +17 -0
- hydpy/models/test/test_model.py +201 -0
- hydpy/models/test/test_solver.py +48 -0
- hydpy/models/test/test_states.py +17 -0
- hydpy/models/test_discontinous.py +46 -0
- hydpy/models/test_stiff0d.py +47 -0
- hydpy/models/test_stiff1d.py +42 -0
- hydpy/models/whmod/__init__.py +21 -0
- hydpy/models/whmod/whmod_constants.py +77 -0
- hydpy/models/whmod/whmod_control.py +333 -0
- hydpy/models/whmod/whmod_derived.py +210 -0
- hydpy/models/whmod/whmod_factors.py +9 -0
- hydpy/models/whmod/whmod_fluxes.py +105 -0
- hydpy/models/whmod/whmod_inputs.py +15 -0
- hydpy/models/whmod/whmod_masks.py +178 -0
- hydpy/models/whmod/whmod_model.py +2091 -0
- hydpy/models/whmod/whmod_parameters.py +155 -0
- hydpy/models/whmod/whmod_sequences.py +193 -0
- hydpy/models/whmod/whmod_states.py +73 -0
- hydpy/models/whmod_rural.py +794 -0
- hydpy/models/whmod_urban.py +1011 -0
- hydpy/models/wland/__init__.py +43 -0
- hydpy/models/wland/wland_aides.py +55 -0
- hydpy/models/wland/wland_constants.py +103 -0
- hydpy/models/wland/wland_control.py +508 -0
- hydpy/models/wland/wland_derived.py +330 -0
- hydpy/models/wland/wland_factors.py +11 -0
- hydpy/models/wland/wland_fixed.py +12 -0
- hydpy/models/wland/wland_fluxes.py +166 -0
- hydpy/models/wland/wland_inputs.py +33 -0
- hydpy/models/wland/wland_masks.py +54 -0
- hydpy/models/wland/wland_model.py +3755 -0
- hydpy/models/wland/wland_outlets.py +11 -0
- hydpy/models/wland/wland_parameters.py +214 -0
- hydpy/models/wland/wland_sequences.py +108 -0
- hydpy/models/wland/wland_solver.py +45 -0
- hydpy/models/wland/wland_states.py +56 -0
- hydpy/models/wland_gd.py +888 -0
- hydpy/models/wland_wag.py +1244 -0
- hydpy/models/wq/__init__.py +14 -0
- hydpy/models/wq/wq_control.py +117 -0
- hydpy/models/wq/wq_derived.py +182 -0
- hydpy/models/wq/wq_factors.py +79 -0
- hydpy/models/wq/wq_fluxes.py +17 -0
- hydpy/models/wq/wq_model.py +1889 -0
- hydpy/models/wq_trapeze.py +168 -0
- hydpy/models/wq_trapeze_strickler.py +101 -0
- hydpy/models/wq_walrus.py +57 -0
- hydpy/py.typed +0 -0
- hydpy/tests/.coveragerc +22 -0
- hydpy/tests/__init__.py +0 -0
- hydpy/tests/check_consistency.py +32 -0
- hydpy/tests/hydpydoctestcustomize.pth +1 -0
- hydpy/tests/hydpydoctestcustomize.py +15 -0
- hydpy/tests/iotesting/__init__.py +0 -0
- hydpy/tests/run_doctests.py +233 -0
- hydpy-6.2.dev1.data/scripts/hyd.py +277 -0
- hydpy-6.2.dev1.dist-info/LICENSE +165 -0
- hydpy-6.2.dev1.dist-info/METADATA +163 -0
- hydpy-6.2.dev1.dist-info/RECORD +890 -0
- hydpy-6.2.dev1.dist-info/WHEEL +5 -0
- hydpy-6.2.dev1.dist-info/licenses_hydpy_installer.txt +42 -0
- hydpy-6.2.dev1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1219 @@
|
|
|
1
|
+
# pylint: disable=line-too-long, unused-wildcard-import
|
|
2
|
+
"""
|
|
3
|
+
The |sw1d.DOCNAME.long| model family member |sw1d_network| allows combining different
|
|
4
|
+
storage and routing submodels for representing the 1-dimensional flow processes within
|
|
5
|
+
a complete channel network.
|
|
6
|
+
|
|
7
|
+
Technically, |sw1d_network| is quite similar to |sw1d_channel|, but both serve
|
|
8
|
+
different purposes and complement each other. |sw1d_network| is a "composite model",
|
|
9
|
+
of which *HydPy* automatically creates instances, each of them combining the
|
|
10
|
+
submodels of multiple |sw1d_channel| instances. So, framework users do usually not
|
|
11
|
+
need to configure |sw1d_network| directly but do so indirectly by preparing seemingly
|
|
12
|
+
independent |sw1d_channel| models for the individual reaches of a channel network.
|
|
13
|
+
Nevertheless, reading the following notes (after reading the |sw1d_channel|
|
|
14
|
+
documentation) might give some relevant insights as |sw1d_network| actually does the
|
|
15
|
+
simulation job and makes some demands regarding the "completeness" of the underlying
|
|
16
|
+
|sw1d_channel| models.
|
|
17
|
+
|
|
18
|
+
Integration tests
|
|
19
|
+
=================
|
|
20
|
+
|
|
21
|
+
.. how_to_understand_integration_tests::
|
|
22
|
+
|
|
23
|
+
The following examples build on the ones of the |sw1d_channel| documentation. So, we
|
|
24
|
+
select the same simulation period:
|
|
25
|
+
|
|
26
|
+
>>> from hydpy import pub
|
|
27
|
+
>>> pub.timegrids = "2000-01-01 00:00", "2000-01-01 05:00", "5m"
|
|
28
|
+
|
|
29
|
+
We split the 20 km channel from the |sw1d_channel| documentation into two identical
|
|
30
|
+
parts.
|
|
31
|
+
|
|
32
|
+
We take the 20 km channel from the |sw1d_channel| documentation but split it into two
|
|
33
|
+
identical parts. So, one |sw1d_channel| model, handled by the |Element| `channel1a`,
|
|
34
|
+
covers the first four segments and another one, handled by the |Element| `channel2`,
|
|
35
|
+
covers the last four segments. But first, we need to define three nodes that are
|
|
36
|
+
connectable to the inlet sequence |sw1d_inlets.LongQ| and outlet sequence
|
|
37
|
+
|sw1d_outlets.LongQ|, which is simplest by defining their variable via a string:
|
|
38
|
+
|
|
39
|
+
>>> from hydpy import Node
|
|
40
|
+
>>> q_1a_in = Node("q_1a_in", variable="LongQ")
|
|
41
|
+
>>> q_1to2 = Node("q_1to2", variable="LongQ")
|
|
42
|
+
>>> q_2_out = Node("q_2_out", variable="LongQ")
|
|
43
|
+
|
|
44
|
+
The remarkable thing about defining the two elements is that we must associate them
|
|
45
|
+
with the same |Element.collective| so that *HydPy* knows it must combine their "user
|
|
46
|
+
models" into one "composite model":
|
|
47
|
+
|
|
48
|
+
>>> from hydpy import Element
|
|
49
|
+
>>> channel1a = Element("channel1a", collective="network", inlets=q_1a_in, outlets=q_1to2)
|
|
50
|
+
>>> channel2 = Element("channel2", collective="network", inlets=q_1to2, outlets=q_2_out)
|
|
51
|
+
|
|
52
|
+
Now, we set up all submodels as in the |sw1d_channel| documentation but assign each to
|
|
53
|
+
one of two main models, which in turn are handled by the two already available
|
|
54
|
+
elements:
|
|
55
|
+
|
|
56
|
+
>>> from hydpy import prepare_model
|
|
57
|
+
>>> from hydpy.models import sw1d_channel, sw1d_storage, sw1d_lias
|
|
58
|
+
>>> lengths = 2.0, 3.0, 2.0, 3.0
|
|
59
|
+
>>> for element in (channel1a, channel2):
|
|
60
|
+
... channel = prepare_model(sw1d_channel)
|
|
61
|
+
... channel.parameters.control.nmbsegments(4)
|
|
62
|
+
... for i, length_ in enumerate(lengths):
|
|
63
|
+
... with channel.add_storagemodel_v1(sw1d_storage, position=i):
|
|
64
|
+
... length(length_)
|
|
65
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
66
|
+
... nmbtrapezes(1)
|
|
67
|
+
... bottomlevels(5.0)
|
|
68
|
+
... bottomwidths(5.0)
|
|
69
|
+
... sideslopes(0.0)
|
|
70
|
+
... for i in range(1, 5 if element is channel1a else 4):
|
|
71
|
+
... with channel.add_routingmodel_v2(sw1d_lias, position=i):
|
|
72
|
+
... lengthupstream(2.0 if i % 2 else 3.0)
|
|
73
|
+
... lengthdownstream(3.0 if i % 2 else 2.0)
|
|
74
|
+
... stricklercoefficient(1.0/0.03)
|
|
75
|
+
... timestepfactor(0.7)
|
|
76
|
+
... diffusionfactor(0.2)
|
|
77
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
78
|
+
... nmbtrapezes(1)
|
|
79
|
+
... bottomlevels(5.0)
|
|
80
|
+
... bottomwidths(5.0)
|
|
81
|
+
... sideslopes(0.0)
|
|
82
|
+
... element.model = channel
|
|
83
|
+
|
|
84
|
+
The following test function object finds all nodes and elements automatically upon
|
|
85
|
+
initialisation:
|
|
86
|
+
|
|
87
|
+
>>> from hydpy.core.testtools import IntegrationTest
|
|
88
|
+
>>> test = IntegrationTest()
|
|
89
|
+
|
|
90
|
+
We again define a convenience function for preparing the initial conditions. This one
|
|
91
|
+
accepts individual water depths for different elements but generally sets the "old"
|
|
92
|
+
discharge to zero:
|
|
93
|
+
|
|
94
|
+
>>> def prepare_inits(**name2depth):
|
|
95
|
+
... inits = []
|
|
96
|
+
... for name, h in name2depth.items():
|
|
97
|
+
... e = Element(name)
|
|
98
|
+
... for s in e.model.storagemodels:
|
|
99
|
+
... length = s.parameters.control.length
|
|
100
|
+
... c = s.crosssection.parameters.control
|
|
101
|
+
... v = h * (c.bottomwidths[0] + h * c.sideslopes[0]) * length
|
|
102
|
+
... inits.append((s.sequences.states.watervolume, v))
|
|
103
|
+
... for r in e.model.routingmodels:
|
|
104
|
+
... if r is not None:
|
|
105
|
+
... inits.append((r.sequences.states.discharge, 0.0))
|
|
106
|
+
... test.inits = inits
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
.. _sw1d_network_zero_inflow_and_outflow:
|
|
110
|
+
|
|
111
|
+
Zero inflow and outflow
|
|
112
|
+
_______________________
|
|
113
|
+
|
|
114
|
+
The following water depths agree with the configuration of the
|
|
115
|
+
:ref:`sw1d_channel_zero_inflow_and_outflow` example of |sw1d_channel|:
|
|
116
|
+
|
|
117
|
+
>>> prepare_inits(channel1a=3.0, channel2=1.0)
|
|
118
|
+
|
|
119
|
+
Albeit irrelevant for the first simulation, we set the inflow represented by the (still
|
|
120
|
+
unused) node `q_1a_in` to zero to avoid `nan` values in the following result table:
|
|
121
|
+
|
|
122
|
+
>>> q_1a_in.sequences.sim.series = 0.0
|
|
123
|
+
|
|
124
|
+
The discharge simulated for node `q_1to2` is identical to the one simulated for the
|
|
125
|
+
middle position in the :ref:`sw1d_channel_zero_inflow_and_outflow` example of
|
|
126
|
+
|sw1d_channel|, which shows that the |sw1d_network| instance here works as a correct
|
|
127
|
+
composite of the two user models:
|
|
128
|
+
|
|
129
|
+
.. integration-test::
|
|
130
|
+
|
|
131
|
+
>>> conditions = test(get_conditions="2000-01-01 00:00")
|
|
132
|
+
| date | timestep | q_1a_in | q_1to2 | q_2_out |
|
|
133
|
+
-------------------------------------------------------------------
|
|
134
|
+
| 2000-01-01 00:00:00 | 41.932744 | 0.0 | 17.116697 | 0.0 |
|
|
135
|
+
| 2000-01-01 00:05:00 | 41.932744 | 0.0 | 6.434402 | 0.0 |
|
|
136
|
+
| 2000-01-01 00:10:00 | 41.86989 | 0.0 | 7.317577 | 0.0 |
|
|
137
|
+
| 2000-01-01 00:15:00 | 40.570615 | 0.0 | 6.771817 | 0.0 |
|
|
138
|
+
| 2000-01-01 00:20:00 | 38.464288 | 0.0 | 6.441228 | 0.0 |
|
|
139
|
+
| 2000-01-01 00:25:00 | 36.060713 | 0.0 | 6.111343 | 0.0 |
|
|
140
|
+
| 2000-01-01 00:30:00 | 33.726739 | 0.0 | 5.814913 | 0.0 |
|
|
141
|
+
| 2000-01-01 00:35:00 | 31.578426 | 0.0 | 5.548742 | 0.0 |
|
|
142
|
+
| 2000-01-01 00:40:00 | 29.590331 | 0.0 | 5.307354 | 0.0 |
|
|
143
|
+
| 2000-01-01 00:45:00 | 27.697934 | 0.0 | 5.084325 | 0.0 |
|
|
144
|
+
| 2000-01-01 00:50:00 | 25.854608 | 0.0 | 4.875904 | 0.0 |
|
|
145
|
+
| 2000-01-01 00:55:00 | 24.044617 | 0.0 | 4.680467 | 0.0 |
|
|
146
|
+
| 2000-01-01 01:00:00 | 22.271186 | 0.0 | 4.497034 | 0.0 |
|
|
147
|
+
| 2000-01-01 01:05:00 | 20.541621 | 0.0 | 4.324343 | 0.0 |
|
|
148
|
+
| 2000-01-01 01:10:00 | 18.859766 | 0.0 | 4.160846 | 0.0 |
|
|
149
|
+
| 2000-01-01 01:15:00 | 17.225223 | 0.0 | 4.00511 | 0.0 |
|
|
150
|
+
| 2000-01-01 01:20:00 | 15.635338 | 0.0 | 3.856098 | 0.0 |
|
|
151
|
+
| 2000-01-01 01:25:00 | 14.087165 | 0.0 | 3.713189 | 0.0 |
|
|
152
|
+
| 2000-01-01 01:30:00 | 12.578396 | 0.0 | 3.576035 | 0.0 |
|
|
153
|
+
| 2000-01-01 01:35:00 | 11.107466 | 0.0 | 3.444403 | 0.0 |
|
|
154
|
+
| 2000-01-01 01:40:00 | 9.67329 | 0.0 | 3.318058 | 0.0 |
|
|
155
|
+
| 2000-01-01 01:45:00 | 8.274999 | 0.0 | 3.196719 | 0.0 |
|
|
156
|
+
| 2000-01-01 01:50:00 | 6.91179 | 0.0 | 3.080056 | 0.0 |
|
|
157
|
+
| 2000-01-01 01:55:00 | 5.582889 | 0.0 | 2.967695 | 0.0 |
|
|
158
|
+
| 2000-01-01 02:00:00 | 4.287568 | 0.0 | 2.859236 | 0.0 |
|
|
159
|
+
| 2000-01-01 02:05:00 | 3.025166 | 0.0 | 2.754256 | 0.0 |
|
|
160
|
+
| 2000-01-01 02:10:00 | 1.795106 | 0.0 | 2.652318 | 0.0 |
|
|
161
|
+
| 2000-01-01 02:15:00 | 0.596896 | 0.0 | 2.552973 | 0.0 |
|
|
162
|
+
| 2000-01-01 02:20:00 | 300.0 | 0.0 | 2.455693 | 0.0 |
|
|
163
|
+
| 2000-01-01 02:25:00 | 300.0 | 0.0 | 2.370851 | 0.0 |
|
|
164
|
+
| 2000-01-01 02:30:00 | 300.0 | 0.0 | 2.278535 | 0.0 |
|
|
165
|
+
| 2000-01-01 02:35:00 | 300.0 | 0.0 | 2.186283 | 0.0 |
|
|
166
|
+
| 2000-01-01 02:40:00 | 300.0 | 0.0 | 2.094209 | 0.0 |
|
|
167
|
+
| 2000-01-01 02:45:00 | 300.0 | 0.0 | 2.001626 | 0.0 |
|
|
168
|
+
| 2000-01-01 02:50:00 | 300.0 | 0.0 | 1.908479 | 0.0 |
|
|
169
|
+
| 2000-01-01 02:55:00 | 300.0 | 0.0 | 1.814849 | 0.0 |
|
|
170
|
+
| 2000-01-01 03:00:00 | 300.0 | 0.0 | 1.720515 | 0.0 |
|
|
171
|
+
| 2000-01-01 03:05:00 | 300.0 | 0.0 | 1.625017 | 0.0 |
|
|
172
|
+
| 2000-01-01 03:10:00 | 300.0 | 0.0 | 1.527933 | 0.0 |
|
|
173
|
+
| 2000-01-01 03:15:00 | 300.0 | 0.0 | 1.429057 | 0.0 |
|
|
174
|
+
| 2000-01-01 03:20:00 | 300.0 | 0.0 | 1.328408 | 0.0 |
|
|
175
|
+
| 2000-01-01 03:25:00 | 300.0 | 0.0 | 1.22614 | 0.0 |
|
|
176
|
+
| 2000-01-01 03:30:00 | 300.0 | 0.0 | 1.122462 | 0.0 |
|
|
177
|
+
| 2000-01-01 03:35:00 | 300.0 | 0.0 | 1.017589 | 0.0 |
|
|
178
|
+
| 2000-01-01 03:40:00 | 300.0 | 0.0 | 0.911751 | 0.0 |
|
|
179
|
+
| 2000-01-01 03:45:00 | 300.0 | 0.0 | 0.805203 | 0.0 |
|
|
180
|
+
| 2000-01-01 03:50:00 | 300.0 | 0.0 | 0.698243 | 0.0 |
|
|
181
|
+
| 2000-01-01 03:55:00 | 300.0 | 0.0 | 0.591202 | 0.0 |
|
|
182
|
+
| 2000-01-01 04:00:00 | 300.0 | 0.0 | 0.484427 | 0.0 |
|
|
183
|
+
| 2000-01-01 04:05:00 | 300.0 | 0.0 | 0.378258 | 0.0 |
|
|
184
|
+
| 2000-01-01 04:10:00 | 300.0 | 0.0 | 0.273014 | 0.0 |
|
|
185
|
+
| 2000-01-01 04:15:00 | 300.0 | 0.0 | 0.16898 | 0.0 |
|
|
186
|
+
| 2000-01-01 04:20:00 | 300.0 | 0.0 | 0.066424 | 0.0 |
|
|
187
|
+
| 2000-01-01 04:25:00 | 300.0 | 0.0 | -0.034386 | 0.0 |
|
|
188
|
+
| 2000-01-01 04:30:00 | 300.0 | 0.0 | -0.131043 | 0.0 |
|
|
189
|
+
| 2000-01-01 04:35:00 | 300.0 | 0.0 | -0.214119 | 0.0 |
|
|
190
|
+
| 2000-01-01 04:40:00 | 300.0 | 0.0 | -0.278681 | 0.0 |
|
|
191
|
+
| 2000-01-01 04:45:00 | 300.0 | 0.0 | -0.323311 | 0.0 |
|
|
192
|
+
| 2000-01-01 04:50:00 | 300.0 | 0.0 | -0.349079 | 0.0 |
|
|
193
|
+
| 2000-01-01 04:55:00 | 300.0 | 0.0 | -0.358235 | 0.0 |
|
|
194
|
+
|
|
195
|
+
There is no indication of an error in the water balance:
|
|
196
|
+
|
|
197
|
+
>>> from hydpy import round_
|
|
198
|
+
>>> round_(test.hydpy.collectives[0].model.check_waterbalance(conditions))
|
|
199
|
+
0.0
|
|
200
|
+
|
|
201
|
+
.. _sw1d_network_weir_outflow:
|
|
202
|
+
|
|
203
|
+
Weir outflow
|
|
204
|
+
____________
|
|
205
|
+
|
|
206
|
+
Next, we repeat the :ref:`sw1d_channel_weir_outflow` example of |sw1d_channel| as a
|
|
207
|
+
more complex example considering inflow and outflow.
|
|
208
|
+
|
|
209
|
+
We add an identical |sw1d_q_in| submodel at the inflow position of the upper element's
|
|
210
|
+
model:
|
|
211
|
+
|
|
212
|
+
>>> from hydpy.models import sw1d_q_in
|
|
213
|
+
>>> with channel1a.model.add_routingmodel_v1(sw1d_q_in, position=0):
|
|
214
|
+
... lengthdownstream(2.0)
|
|
215
|
+
... timestepfactor(0.7)
|
|
216
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
217
|
+
... nmbtrapezes(1)
|
|
218
|
+
... bottomlevels(5.0)
|
|
219
|
+
... bottomwidths(5.0)
|
|
220
|
+
... sideslopes(0.0)
|
|
221
|
+
>>> channel1a.model.connect()
|
|
222
|
+
|
|
223
|
+
And we add an identical |sw1d_weir_out| submodel at the outflow position of the lower
|
|
224
|
+
element's model:
|
|
225
|
+
|
|
226
|
+
>>> from hydpy.models import sw1d_weir_out
|
|
227
|
+
>>> with channel2.model.add_routingmodel_v3(sw1d_weir_out, position=4):
|
|
228
|
+
... lengthupstream(3.0)
|
|
229
|
+
... crestheight(7.0)
|
|
230
|
+
... crestwidth(5.0)
|
|
231
|
+
... flowcoefficient(0.58)
|
|
232
|
+
... timestepfactor(0.7)
|
|
233
|
+
>>> channel2.model.connect()
|
|
234
|
+
|
|
235
|
+
Further, we set the time step factor, the constant inflow, and the initial conditions to
|
|
236
|
+
the same values as in the :ref:`sw1d_channel_weir_outflow` example:
|
|
237
|
+
|
|
238
|
+
>>> test = IntegrationTest()
|
|
239
|
+
>>> for element in (channel1a, channel2):
|
|
240
|
+
... for routingmodel in element.model.routingmodels.submodels:
|
|
241
|
+
... if routingmodel is not None:
|
|
242
|
+
... routingmodel.parameters.control.timestepfactor(0.1)
|
|
243
|
+
>>> q_1a_in.sequences.sim.series = 1.0
|
|
244
|
+
>>> prepare_inits(channel1a=2.0, channel2=2.0)
|
|
245
|
+
|
|
246
|
+
The following discharges are identical to those available in the results table of the
|
|
247
|
+
:ref:`sw1d_channel_weir_outflow` example of |sw1d_channel|:
|
|
248
|
+
|
|
249
|
+
.. integration-test::
|
|
250
|
+
|
|
251
|
+
>>> conditions = test(get_conditions="2000-01-01 00:00")
|
|
252
|
+
| date | timestep | q_1a_in | q_1to2 | q_2_out |
|
|
253
|
+
-------------------------------------------------------------------
|
|
254
|
+
| 2000-01-01 00:00:00 | 29.522473 | 1.0 | 0.000084 | 0.0 |
|
|
255
|
+
| 2000-01-01 00:05:00 | 30.437257 | 1.0 | 0.010297 | 0.0 |
|
|
256
|
+
| 2000-01-01 00:10:00 | 31.047327 | 1.0 | 0.057861 | 0.0 |
|
|
257
|
+
| 2000-01-01 00:15:00 | 31.487924 | 1.0 | 0.13627 | 0.000003 |
|
|
258
|
+
| 2000-01-01 00:20:00 | 31.831217 | 1.0 | 0.223131 | 0.000031 |
|
|
259
|
+
| 2000-01-01 00:25:00 | 32.115718 | 1.0 | 0.303889 | 0.000173 |
|
|
260
|
+
| 2000-01-01 00:30:00 | 32.362765 | 1.0 | 0.372712 | 0.000611 |
|
|
261
|
+
| 2000-01-01 00:35:00 | 32.584688 | 1.0 | 0.428534 | 0.001597 |
|
|
262
|
+
| 2000-01-01 00:40:00 | 32.788919 | 1.0 | 0.472255 | 0.003371 |
|
|
263
|
+
| 2000-01-01 00:45:00 | 32.980171 | 1.0 | 0.505411 | 0.006095 |
|
|
264
|
+
| 2000-01-01 00:50:00 | 33.161638 | 1.0 | 0.52966 | 0.009817 |
|
|
265
|
+
| 2000-01-01 00:55:00 | 33.335665 | 1.0 | 0.546602 | 0.014488 |
|
|
266
|
+
| 2000-01-01 01:00:00 | 33.5041 | 1.0 | 0.557716 | 0.019988 |
|
|
267
|
+
| 2000-01-01 01:05:00 | 33.668478 | 1.0 | 0.564322 | 0.02617 |
|
|
268
|
+
| 2000-01-01 01:10:00 | 33.830091 | 1.0 | 0.567571 | 0.032882 |
|
|
269
|
+
| 2000-01-01 01:15:00 | 33.990019 | 1.0 | 0.568434 | 0.039987 |
|
|
270
|
+
| 2000-01-01 01:20:00 | 34.149135 | 1.0 | 0.567713 | 0.047372 |
|
|
271
|
+
| 2000-01-01 01:25:00 | 34.308116 | 1.0 | 0.566046 | 0.054949 |
|
|
272
|
+
| 2000-01-01 01:30:00 | 34.467448 | 1.0 | 0.563931 | 0.062652 |
|
|
273
|
+
| 2000-01-01 01:35:00 | 34.627446 | 1.0 | 0.56174 | 0.070436 |
|
|
274
|
+
| 2000-01-01 01:40:00 | 34.788273 | 1.0 | 0.559739 | 0.078272 |
|
|
275
|
+
| 2000-01-01 01:45:00 | 34.949971 | 1.0 | 0.55811 | 0.086141 |
|
|
276
|
+
| 2000-01-01 01:50:00 | 35.112477 | 1.0 | 0.556964 | 0.094032 |
|
|
277
|
+
| 2000-01-01 01:55:00 | 35.275657 | 1.0 | 0.556359 | 0.101942 |
|
|
278
|
+
| 2000-01-01 02:00:00 | 35.439325 | 1.0 | 0.556315 | 0.109869 |
|
|
279
|
+
| 2000-01-01 02:05:00 | 35.603263 | 1.0 | 0.556821 | 0.117813 |
|
|
280
|
+
| 2000-01-01 02:10:00 | 35.767241 | 1.0 | 0.557846 | 0.125776 |
|
|
281
|
+
| 2000-01-01 02:15:00 | 35.931023 | 1.0 | 0.559348 | 0.133758 |
|
|
282
|
+
| 2000-01-01 02:20:00 | 36.094387 | 1.0 | 0.561277 | 0.141761 |
|
|
283
|
+
| 2000-01-01 02:25:00 | 36.257123 | 1.0 | 0.563583 | 0.149785 |
|
|
284
|
+
| 2000-01-01 02:30:00 | 36.419042 | 1.0 | 0.566213 | 0.15783 |
|
|
285
|
+
| 2000-01-01 02:35:00 | 36.579976 | 1.0 | 0.569119 | 0.165895 |
|
|
286
|
+
| 2000-01-01 02:40:00 | 36.739783 | 1.0 | 0.572257 | 0.17398 |
|
|
287
|
+
| 2000-01-01 02:45:00 | 36.89834 | 1.0 | 0.575586 | 0.182081 |
|
|
288
|
+
| 2000-01-01 02:50:00 | 37.055547 | 1.0 | 0.57907 | 0.190197 |
|
|
289
|
+
| 2000-01-01 02:55:00 | 37.21132 | 1.0 | 0.582678 | 0.198324 |
|
|
290
|
+
| 2000-01-01 03:00:00 | 37.365596 | 1.0 | 0.586386 | 0.20646 |
|
|
291
|
+
| 2000-01-01 03:05:00 | 37.518323 | 1.0 | 0.590169 | 0.2146 |
|
|
292
|
+
| 2000-01-01 03:10:00 | 37.669464 | 1.0 | 0.594011 | 0.222742 |
|
|
293
|
+
| 2000-01-01 03:15:00 | 37.81899 | 1.0 | 0.597895 | 0.230882 |
|
|
294
|
+
| 2000-01-01 03:20:00 | 37.966882 | 1.0 | 0.60181 | 0.239015 |
|
|
295
|
+
| 2000-01-01 03:25:00 | 38.113129 | 1.0 | 0.605746 | 0.247138 |
|
|
296
|
+
| 2000-01-01 03:30:00 | 38.257724 | 1.0 | 0.609694 | 0.255248 |
|
|
297
|
+
| 2000-01-01 03:35:00 | 38.400665 | 1.0 | 0.613648 | 0.263341 |
|
|
298
|
+
| 2000-01-01 03:40:00 | 38.541953 | 1.0 | 0.617604 | 0.271413 |
|
|
299
|
+
| 2000-01-01 03:45:00 | 38.681592 | 1.0 | 0.621557 | 0.279461 |
|
|
300
|
+
| 2000-01-01 03:50:00 | 38.81959 | 1.0 | 0.625503 | 0.287482 |
|
|
301
|
+
| 2000-01-01 03:55:00 | 38.955953 | 1.0 | 0.629441 | 0.295473 |
|
|
302
|
+
| 2000-01-01 04:00:00 | 39.090692 | 1.0 | 0.633368 | 0.30343 |
|
|
303
|
+
| 2000-01-01 04:05:00 | 39.223815 | 1.0 | 0.637282 | 0.311352 |
|
|
304
|
+
| 2000-01-01 04:10:00 | 39.355334 | 1.0 | 0.641182 | 0.319235 |
|
|
305
|
+
| 2000-01-01 04:15:00 | 39.48526 | 1.0 | 0.645068 | 0.327078 |
|
|
306
|
+
| 2000-01-01 04:20:00 | 39.613604 | 1.0 | 0.648937 | 0.334877 |
|
|
307
|
+
| 2000-01-01 04:25:00 | 39.740379 | 1.0 | 0.652788 | 0.342631 |
|
|
308
|
+
| 2000-01-01 04:30:00 | 39.865596 | 1.0 | 0.656622 | 0.350339 |
|
|
309
|
+
| 2000-01-01 04:35:00 | 39.989269 | 1.0 | 0.660437 | 0.357997 |
|
|
310
|
+
| 2000-01-01 04:40:00 | 40.111408 | 1.0 | 0.664232 | 0.365604 |
|
|
311
|
+
| 2000-01-01 04:45:00 | 40.232028 | 1.0 | 0.668006 | 0.37316 |
|
|
312
|
+
| 2000-01-01 04:50:00 | 40.351141 | 1.0 | 0.67176 | 0.380661 |
|
|
313
|
+
| 2000-01-01 04:55:00 | 40.46876 | 1.0 | 0.675491 | 0.388108 |
|
|
314
|
+
|
|
315
|
+
There is no indication of an error in the water balance:
|
|
316
|
+
|
|
317
|
+
>>> round_(test.hydpy.collectives[0].model.check_waterbalance(conditions))
|
|
318
|
+
0.0
|
|
319
|
+
|
|
320
|
+
.. _sw1d_network_confluences:
|
|
321
|
+
|
|
322
|
+
Confluences
|
|
323
|
+
___________
|
|
324
|
+
|
|
325
|
+
Now, we illustrate how to build real networks by connecting more than two elements with
|
|
326
|
+
the same node. We will handle the existing two subchannels as a main channel. The one
|
|
327
|
+
upstream of the junction (`channel1a`) has a width of 8 mm, and the one downstream of
|
|
328
|
+
the junction (`channel2`) has a width of 10 m:
|
|
329
|
+
|
|
330
|
+
>>> for element, width in ([channel1a, 8.0], [channel2, 10.0]):
|
|
331
|
+
... for storagemodel in element.model.storagemodels:
|
|
332
|
+
... storagemodel.crosssection.parameters.control.bottomwidths(width)
|
|
333
|
+
... for routingmodel in element.model.routingmodels:
|
|
334
|
+
... if isinstance(routingmodel, (sw1d_lias.Model, sw1d_q_in.Model)):
|
|
335
|
+
... routingmodel.crosssection.parameters.control.bottomwidths(width)
|
|
336
|
+
|
|
337
|
+
The new 10 km long side channel also consists of four segments but is only 2 m wide:
|
|
338
|
+
|
|
339
|
+
>>> channel = prepare_model("sw1d_channel")
|
|
340
|
+
>>> channel.parameters.control.nmbsegments(4)
|
|
341
|
+
>>> for i, length_ in enumerate(lengths[:4]):
|
|
342
|
+
... with channel.add_storagemodel_v1(sw1d_storage, position=i):
|
|
343
|
+
... length(length_)
|
|
344
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
345
|
+
... nmbtrapezes(1)
|
|
346
|
+
... bottomlevels(5.0)
|
|
347
|
+
... bottomwidths(2.0)
|
|
348
|
+
... sideslopes(0.0)
|
|
349
|
+
|
|
350
|
+
It receives a separate inflow via another |sw1d_q_in| instance:
|
|
351
|
+
|
|
352
|
+
>>> with channel.add_routingmodel_v1(sw1d_q_in, position=0):
|
|
353
|
+
... lengthdownstream(2.0)
|
|
354
|
+
... timestepfactor(0.7)
|
|
355
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
356
|
+
... nmbtrapezes(1)
|
|
357
|
+
... bottomlevels(5.0)
|
|
358
|
+
... bottomwidths(2.0)
|
|
359
|
+
... sideslopes(0.0)
|
|
360
|
+
|
|
361
|
+
We add |sw1d_lias| models for all other possible positions, including the last one:
|
|
362
|
+
|
|
363
|
+
>>> for i in range(1, 5):
|
|
364
|
+
... with channel.add_routingmodel_v2(sw1d_lias, position=i):
|
|
365
|
+
... lengthupstream(2.0 if i % 2 else 3.0)
|
|
366
|
+
... lengthdownstream(3.0 if i % 2 else 2.0)
|
|
367
|
+
... stricklercoefficient(1.0/0.03)
|
|
368
|
+
... timestepfactor(0.7)
|
|
369
|
+
... diffusionfactor(0.2)
|
|
370
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
371
|
+
... nmbtrapezes(1)
|
|
372
|
+
... bottomlevels(5.0)
|
|
373
|
+
... bottomwidths(2.0)
|
|
374
|
+
... sideslopes(0.0)
|
|
375
|
+
|
|
376
|
+
So, now the |sw1d_channel| models of the elements `channel1a` and `channel1b` have
|
|
377
|
+
routing models at their outflow locations, and the one of element `channel2` does not
|
|
378
|
+
have a routing model at its inflow location. This is the typical configuration for
|
|
379
|
+
modelling confluences, where one strives to couple each reach upstream of the junction
|
|
380
|
+
with the single reach downstream. This setting has the effect that `channel2`
|
|
381
|
+
exchanges water with `channel1a` and `channel1b` directly, while `channel1a` and
|
|
382
|
+
`channel1b` can do so only indirectly via the first segment of `channel2`.
|
|
383
|
+
|
|
384
|
+
We assign the third channel model to another element, that we connect to a new inlet
|
|
385
|
+
node (for adding inflow) and to the already existing node `q_1to2` (for coupling with
|
|
386
|
+
the main channel):
|
|
387
|
+
|
|
388
|
+
>>> q_1b_in = Node("q_1b_in", variable="LongQ")
|
|
389
|
+
>>> channel1b = Element("channel1b", collective="network", inlets=q_1b_in, outlets=q_1to2)
|
|
390
|
+
>>> channel1b.model = channel
|
|
391
|
+
|
|
392
|
+
The initial water depth is 1 m throughout the whole network:
|
|
393
|
+
|
|
394
|
+
>>> test = IntegrationTest()
|
|
395
|
+
>>> prepare_inits(channel1a=1.0, channel1b=1.0, channel2=1.0)
|
|
396
|
+
|
|
397
|
+
The main and the side channels receive constant inflows of 1 and 0.5 m³/s,
|
|
398
|
+
respectively:
|
|
399
|
+
|
|
400
|
+
>>> q_1a_in.sequences.sim.series = 1.0
|
|
401
|
+
>>> q_1b_in.sequences.sim.series = 0.5
|
|
402
|
+
|
|
403
|
+
Unfortunately, the usual standard table does not provide much information for in-depth
|
|
404
|
+
evaluations:
|
|
405
|
+
|
|
406
|
+
.. integration-test::
|
|
407
|
+
|
|
408
|
+
>>> conditions = test(get_conditions="2000-01-01 00:00")
|
|
409
|
+
| date | timestep | q_1a_in | q_1b_in | q_1to2 | q_2_out |
|
|
410
|
+
----------------------------------------------------------------------------
|
|
411
|
+
| 2000-01-01 00:00:00 | 45.030299 | 1.0 | 0.5 | 0.0 | 0.0 |
|
|
412
|
+
| 2000-01-01 00:05:00 | 46.242118 | 1.0 | 0.5 | 0.003008 | 0.0 |
|
|
413
|
+
| 2000-01-01 00:10:00 | 47.155436 | 1.0 | 0.5 | 0.025525 | 0.0 |
|
|
414
|
+
| 2000-01-01 00:15:00 | 47.892762 | 1.0 | 0.5 | 0.071726 | 0.0 |
|
|
415
|
+
| 2000-01-01 00:20:00 | 48.522333 | 1.0 | 0.5 | 0.129271 | 0.0 |
|
|
416
|
+
| 2000-01-01 00:25:00 | 49.080523 | 1.0 | 0.5 | 0.187172 | 0.0 |
|
|
417
|
+
| 2000-01-01 00:30:00 | 49.587791 | 1.0 | 0.5 | 0.240134 | 0.0 |
|
|
418
|
+
| 2000-01-01 00:35:00 | 50.056456 | 1.0 | 0.5 | 0.286648 | 0.0 |
|
|
419
|
+
| 2000-01-01 00:40:00 | 50.494442 | 1.0 | 0.5 | 0.326895 | 0.0 |
|
|
420
|
+
| 2000-01-01 00:45:00 | 50.90715 | 1.0 | 0.5 | 0.361611 | 0.0 |
|
|
421
|
+
| 2000-01-01 00:50:00 | 51.298454 | 1.0 | 0.5 | 0.391611 | 0.0 |
|
|
422
|
+
| 2000-01-01 00:55:00 | 51.671261 | 1.0 | 0.5 | 0.417633 | 0.0 |
|
|
423
|
+
| 2000-01-01 01:00:00 | 52.027843 | 1.0 | 0.5 | 0.44031 | 0.0 |
|
|
424
|
+
| 2000-01-01 01:05:00 | 52.370039 | 1.0 | 0.5 | 0.460176 | 0.0 |
|
|
425
|
+
| 2000-01-01 01:10:00 | 52.699381 | 1.0 | 0.5 | 0.47769 | 0.0 |
|
|
426
|
+
| 2000-01-01 01:15:00 | 53.017173 | 1.0 | 0.5 | 0.493237 | 0.0 |
|
|
427
|
+
| 2000-01-01 01:20:00 | 53.324545 | 1.0 | 0.5 | 0.50715 | 0.0 |
|
|
428
|
+
| 2000-01-01 01:25:00 | 53.622482 | 1.0 | 0.5 | 0.519705 | 0.0 |
|
|
429
|
+
| 2000-01-01 01:30:00 | 53.911854 | 1.0 | 0.5 | 0.531136 | 0.0 |
|
|
430
|
+
| 2000-01-01 01:35:00 | 54.193429 | 1.0 | 0.5 | 0.541633 | 0.0 |
|
|
431
|
+
| 2000-01-01 01:40:00 | 54.467891 | 1.0 | 0.5 | 0.551355 | 0.0 |
|
|
432
|
+
| 2000-01-01 01:45:00 | 54.735849 | 1.0 | 0.5 | 0.560428 | 0.0 |
|
|
433
|
+
| 2000-01-01 01:50:00 | 54.997846 | 1.0 | 0.5 | 0.568953 | 0.0 |
|
|
434
|
+
| 2000-01-01 01:55:00 | 55.254368 | 1.0 | 0.5 | 0.577012 | 0.0 |
|
|
435
|
+
| 2000-01-01 02:00:00 | 55.505854 | 1.0 | 0.5 | 0.584668 | 0.0 |
|
|
436
|
+
| 2000-01-01 02:05:00 | 55.752694 | 1.0 | 0.5 | 0.591971 | 0.0 |
|
|
437
|
+
| 2000-01-01 02:10:00 | 55.995245 | 1.0 | 0.5 | 0.598961 | 0.0 |
|
|
438
|
+
| 2000-01-01 02:15:00 | 56.233826 | 1.0 | 0.5 | 0.605669 | 0.0 |
|
|
439
|
+
| 2000-01-01 02:20:00 | 56.468727 | 1.0 | 0.5 | 0.612118 | 0.0 |
|
|
440
|
+
| 2000-01-01 02:25:00 | 56.700214 | 1.0 | 0.5 | 0.618328 | 0.0 |
|
|
441
|
+
| 2000-01-01 02:30:00 | 56.928527 | 1.0 | 0.5 | 0.624314 | 0.0 |
|
|
442
|
+
| 2000-01-01 02:35:00 | 57.153887 | 1.0 | 0.5 | 0.630087 | 0.0 |
|
|
443
|
+
| 2000-01-01 02:40:00 | 57.376496 | 1.0 | 0.5 | 0.635659 | 0.0 |
|
|
444
|
+
| 2000-01-01 02:45:00 | 57.59654 | 1.0 | 0.5 | 0.641038 | 0.0 |
|
|
445
|
+
| 2000-01-01 02:50:00 | 57.814191 | 1.0 | 0.5 | 0.646232 | 0.0 |
|
|
446
|
+
| 2000-01-01 02:55:00 | 58.029607 | 1.0 | 0.5 | 0.651246 | 0.0 |
|
|
447
|
+
| 2000-01-01 03:00:00 | 58.242934 | 1.0 | 0.5 | 0.656087 | 0.0 |
|
|
448
|
+
| 2000-01-01 03:05:00 | 58.45431 | 1.0 | 0.5 | 0.660761 | 0.0 |
|
|
449
|
+
| 2000-01-01 03:10:00 | 58.663861 | 1.0 | 0.5 | 0.665273 | 0.0 |
|
|
450
|
+
| 2000-01-01 03:15:00 | 58.871705 | 1.0 | 0.5 | 0.669628 | 0.0 |
|
|
451
|
+
| 2000-01-01 03:20:00 | 59.077952 | 1.0 | 0.5 | 0.67383 | 0.0 |
|
|
452
|
+
| 2000-01-01 03:25:00 | 59.282705 | 1.0 | 0.5 | 0.677885 | 0.0 |
|
|
453
|
+
| 2000-01-01 03:30:00 | 59.48606 | 1.0 | 0.5 | 0.681797 | 0.0 |
|
|
454
|
+
| 2000-01-01 03:35:00 | 59.688108 | 1.0 | 0.5 | 0.685571 | 0.0 |
|
|
455
|
+
| 2000-01-01 03:40:00 | 59.888932 | 1.0 | 0.5 | 0.689211 | 0.0 |
|
|
456
|
+
| 2000-01-01 03:45:00 | 0.135626 | 1.0 | 0.5 | 0.692729 | 0.0 |
|
|
457
|
+
| 2000-01-01 03:50:00 | 0.384228 | 1.0 | 0.5 | 0.698366 | 0.0 |
|
|
458
|
+
| 2000-01-01 03:55:00 | 0.632218 | 1.0 | 0.5 | 0.701582 | 0.0 |
|
|
459
|
+
| 2000-01-01 04:00:00 | 0.879114 | 1.0 | 0.5 | 0.704443 | 0.0 |
|
|
460
|
+
| 2000-01-01 04:05:00 | 1.124822 | 1.0 | 0.5 | 0.707155 | 0.0 |
|
|
461
|
+
| 2000-01-01 04:10:00 | 1.369384 | 1.0 | 0.5 | 0.709781 | 0.0 |
|
|
462
|
+
| 2000-01-01 04:15:00 | 1.612877 | 1.0 | 0.5 | 0.712341 | 0.0 |
|
|
463
|
+
| 2000-01-01 04:20:00 | 1.855383 | 1.0 | 0.5 | 0.714841 | 0.0 |
|
|
464
|
+
| 2000-01-01 04:25:00 | 2.096978 | 1.0 | 0.5 | 0.717279 | 0.0 |
|
|
465
|
+
| 2000-01-01 04:30:00 | 2.337734 | 1.0 | 0.5 | 0.719653 | 0.0 |
|
|
466
|
+
| 2000-01-01 04:35:00 | 2.577714 | 1.0 | 0.5 | 0.721961 | 0.0 |
|
|
467
|
+
| 2000-01-01 04:40:00 | 2.816978 | 1.0 | 0.5 | 0.724201 | 0.0 |
|
|
468
|
+
| 2000-01-01 04:45:00 | 3.05558 | 1.0 | 0.5 | 0.726373 | 0.0 |
|
|
469
|
+
| 2000-01-01 04:50:00 | 3.293568 | 1.0 | 0.5 | 0.728475 | 0.0 |
|
|
470
|
+
| 2000-01-01 04:55:00 | 3.53099 | 1.0 | 0.5 | 0.730509 | 0.0 |
|
|
471
|
+
|
|
472
|
+
Therefore, we define the following function for plotting the water level profiles
|
|
473
|
+
gained for the simulation period's end:
|
|
474
|
+
|
|
475
|
+
>>> def plot_waterlevels(figname):
|
|
476
|
+
... import numpy
|
|
477
|
+
... from matplotlib import pyplot
|
|
478
|
+
... from hydpy.core.testtools import save_autofig
|
|
479
|
+
... stations = ((cs := numpy.cumsum((0.0,) + lengths))[:-1] + cs[1:]) / 2.0
|
|
480
|
+
... for element in (channel1a, channel1b, channel2):
|
|
481
|
+
... ss = [s + sum(lengths) * (element is channel2) for s in stations]
|
|
482
|
+
... ws = [sm.sequences.factors.waterlevel for sm in element.model.storagemodels]
|
|
483
|
+
... _ = pyplot.plot(ss, ws, label=element.name)
|
|
484
|
+
... for element in (channel1a, channel1b):
|
|
485
|
+
... ss = stations[-1], stations[0] + sum(lengths)
|
|
486
|
+
... ws = (element.model.storagemodels[-1].sequences.factors.waterlevel.value,
|
|
487
|
+
... channel2.model.storagemodels[0].sequences.factors.waterlevel.value)
|
|
488
|
+
... _ = pyplot.plot(ss, ws, color="grey")
|
|
489
|
+
... _ = pyplot.legend()
|
|
490
|
+
... _ = pyplot.xlabel("station [km]")
|
|
491
|
+
... _ = pyplot.ylabel("water level [m]")
|
|
492
|
+
... save_autofig(figname)
|
|
493
|
+
|
|
494
|
+
The simulated water levels look reasonable and are sufficiently similar to those we
|
|
495
|
+
calculated with a fully hydrodynamic model for comparison:
|
|
496
|
+
|
|
497
|
+
>>> plot_waterlevels("sw1d_network_confluences.png")
|
|
498
|
+
|
|
499
|
+
.. image:: sw1d_network_confluences.png
|
|
500
|
+
|
|
501
|
+
There is no indication of an error in the water balance:
|
|
502
|
+
|
|
503
|
+
>>> round_(test.hydpy.collectives[0].model.check_waterbalance(conditions))
|
|
504
|
+
0.0
|
|
505
|
+
|
|
506
|
+
.. _sw1d_network_bifurcations:
|
|
507
|
+
|
|
508
|
+
Bifurcations
|
|
509
|
+
____________
|
|
510
|
+
|
|
511
|
+
|sw1d_network| also allows us to model the bifurcation of channels. We could
|
|
512
|
+
demonstrate this by building an entirely new setting but prefer to reuse the existing
|
|
513
|
+
network and just let the water flow "upstream", which is the same in the end.
|
|
514
|
+
|
|
515
|
+
First, we break the connections to the |sw1d_weir_out| submodel at the outlet location
|
|
516
|
+
of `channel2`:
|
|
517
|
+
|
|
518
|
+
>>> channel2.model.storagemodels[-1].routingmodelsdownstream.number = 0
|
|
519
|
+
>>> channel2.model.routingmodels[-2].routingmodelsdownstream.number = 0
|
|
520
|
+
|
|
521
|
+
Second, we replace the weir model with an instance of |sw1d_q_out|, which is
|
|
522
|
+
functionally nearly identical to |sw1d_q_in| but to be placed at outlet locations:
|
|
523
|
+
|
|
524
|
+
>>> from hydpy.models import sw1d_q_out
|
|
525
|
+
>>> with channel2.model.add_routingmodel_v3(sw1d_q_out, position=4):
|
|
526
|
+
... lengthupstream(2.0)
|
|
527
|
+
... timestepfactor(0.7)
|
|
528
|
+
... with model.add_crosssection_v2("wq_trapeze"):
|
|
529
|
+
... nmbtrapezes(1)
|
|
530
|
+
... bottomlevels(5.0)
|
|
531
|
+
... bottomwidths(5.0)
|
|
532
|
+
... sideslopes(0.0)
|
|
533
|
+
|
|
534
|
+
>>> channel2.model.connect()
|
|
535
|
+
|
|
536
|
+
We set the initial conditions as in the :ref:`sw1d_network_confluences` example:
|
|
537
|
+
|
|
538
|
+
>>> test = IntegrationTest()
|
|
539
|
+
>>> prepare_inits(channel1a=1.0, channel1b=1.0, channel2=1.0)
|
|
540
|
+
|
|
541
|
+
We let the same amount of water flow in the opposite direction by setting the inflow of
|
|
542
|
+
`channel1a` and `channel1b` to zero and the outflow of `channel2` to -1.5 m³/s:
|
|
543
|
+
|
|
544
|
+
>>> q_1a_in.sequences.sim.series = 0.0
|
|
545
|
+
>>> q_1b_in.sequences.sim.series = 0.0
|
|
546
|
+
>>> q_2_out.sequences.sim.series = -1.5
|
|
547
|
+
|
|
548
|
+
The outlet node `q_2_out` needs further attention. Usually, outlet nodes receive data
|
|
549
|
+
from their entry elements, but this one is supposed to send data "upstream", which is
|
|
550
|
+
possible by choosing one of the available "bidirectional" deploy modes. We select
|
|
551
|
+
`oldsim_bi` (the documentation on |Node.deploymode| explains this and the further
|
|
552
|
+
options in more detail):
|
|
553
|
+
|
|
554
|
+
>>> q_2_out.deploymode = "oldsim_bi"
|
|
555
|
+
|
|
556
|
+
Considering the absolute amount, the discharge simulated at the central node `q_1to2`
|
|
557
|
+
is quite similar to the one of the :ref:`sw1d_network_confluences` example:
|
|
558
|
+
|
|
559
|
+
.. integration-test::
|
|
560
|
+
|
|
561
|
+
>>> conditions = test("sw1d_network_branch", get_conditions="2000-01-01 00:00")
|
|
562
|
+
| date | timestep | q_1a_in | q_1b_in | q_1to2 | q_2_out |
|
|
563
|
+
-----------------------------------------------------------------------------
|
|
564
|
+
| 2000-01-01 00:00:00 | 44.830004 | 0.0 | 0.0 | 0.0 | -1.5 |
|
|
565
|
+
| 2000-01-01 00:05:00 | 45.741893 | 0.0 | 0.0 | -0.002955 | -1.5 |
|
|
566
|
+
| 2000-01-01 00:10:00 | 46.659139 | 0.0 | 0.0 | -0.026069 | -1.5 |
|
|
567
|
+
| 2000-01-01 00:15:00 | 47.456384 | 0.0 | 0.0 | -0.075937 | -1.5 |
|
|
568
|
+
| 2000-01-01 00:20:00 | 48.151282 | 0.0 | 0.0 | -0.140683 | -1.5 |
|
|
569
|
+
| 2000-01-01 00:25:00 | 48.772646 | 0.0 | 0.0 | -0.207348 | -1.5 |
|
|
570
|
+
| 2000-01-01 00:30:00 | 49.341144 | 0.0 | 0.0 | -0.268565 | -1.5 |
|
|
571
|
+
| 2000-01-01 00:35:00 | 49.870269 | 0.0 | 0.0 | -0.321749 | -1.5 |
|
|
572
|
+
| 2000-01-01 00:40:00 | 50.368827 | 0.0 | 0.0 | -0.366871 | -1.5 |
|
|
573
|
+
| 2000-01-01 00:45:00 | 50.842694 | 0.0 | 0.0 | -0.404905 | -1.5 |
|
|
574
|
+
| 2000-01-01 00:50:00 | 51.295919 | 0.0 | 0.0 | -0.437038 | -1.5 |
|
|
575
|
+
| 2000-01-01 00:55:00 | 51.731393 | 0.0 | 0.0 | -0.464363 | -1.5 |
|
|
576
|
+
| 2000-01-01 01:00:00 | 52.151263 | 0.0 | 0.0 | -0.487801 | -1.5 |
|
|
577
|
+
| 2000-01-01 01:05:00 | 52.557188 | 0.0 | 0.0 | -0.508095 | -1.5 |
|
|
578
|
+
| 2000-01-01 01:10:00 | 52.9505 | 0.0 | 0.0 | -0.525847 | -1.5 |
|
|
579
|
+
| 2000-01-01 01:15:00 | 53.332303 | 0.0 | 0.0 | -0.541542 | -1.5 |
|
|
580
|
+
| 2000-01-01 01:20:00 | 53.703533 | 0.0 | 0.0 | -0.55557 | -1.5 |
|
|
581
|
+
| 2000-01-01 01:25:00 | 54.065003 | 0.0 | 0.0 | -0.568243 | -1.5 |
|
|
582
|
+
| 2000-01-01 01:30:00 | 54.417423 | 0.0 | 0.0 | -0.579812 | -1.5 |
|
|
583
|
+
| 2000-01-01 01:35:00 | 54.761425 | 0.0 | 0.0 | -0.590476 | -1.5 |
|
|
584
|
+
| 2000-01-01 01:40:00 | 55.097571 | 0.0 | 0.0 | -0.600391 | -1.5 |
|
|
585
|
+
| 2000-01-01 01:45:00 | 55.426366 | 0.0 | 0.0 | -0.609678 | -1.5 |
|
|
586
|
+
| 2000-01-01 01:50:00 | 55.748265 | 0.0 | 0.0 | -0.618434 | -1.5 |
|
|
587
|
+
| 2000-01-01 01:55:00 | 56.063683 | 0.0 | 0.0 | -0.626729 | -1.5 |
|
|
588
|
+
| 2000-01-01 02:00:00 | 56.372995 | 0.0 | 0.0 | -0.634621 | -1.5 |
|
|
589
|
+
| 2000-01-01 02:05:00 | 56.676546 | 0.0 | 0.0 | -0.642152 | -1.5 |
|
|
590
|
+
| 2000-01-01 02:10:00 | 56.974651 | 0.0 | 0.0 | -0.649356 | -1.5 |
|
|
591
|
+
| 2000-01-01 02:15:00 | 57.267603 | 0.0 | 0.0 | -0.656257 | -1.5 |
|
|
592
|
+
| 2000-01-01 02:20:00 | 57.555671 | 0.0 | 0.0 | -0.662874 | -1.5 |
|
|
593
|
+
| 2000-01-01 02:25:00 | 57.839105 | 0.0 | 0.0 | -0.669225 | -1.5 |
|
|
594
|
+
| 2000-01-01 02:30:00 | 58.118138 | 0.0 | 0.0 | -0.675321 | -1.5 |
|
|
595
|
+
| 2000-01-01 02:35:00 | 58.392989 | 0.0 | 0.0 | -0.681174 | -1.5 |
|
|
596
|
+
| 2000-01-01 02:40:00 | 58.66386 | 0.0 | 0.0 | -0.686793 | -1.5 |
|
|
597
|
+
| 2000-01-01 02:45:00 | 58.930943 | 0.0 | 0.0 | -0.692186 | -1.5 |
|
|
598
|
+
| 2000-01-01 02:50:00 | 59.194418 | 0.0 | 0.0 | -0.69736 | -1.5 |
|
|
599
|
+
| 2000-01-01 02:55:00 | 59.454452 | 0.0 | 0.0 | -0.702325 | -1.5 |
|
|
600
|
+
| 2000-01-01 03:00:00 | 59.711205 | 0.0 | 0.0 | -0.707085 | -1.5 |
|
|
601
|
+
| 2000-01-01 03:05:00 | 59.964827 | 0.0 | 0.0 | -0.711648 | -1.5 |
|
|
602
|
+
| 2000-01-01 03:10:00 | 0.30038 | 0.0 | 0.0 | -0.716007 | -1.5 |
|
|
603
|
+
| 2000-01-01 03:15:00 | 0.611639 | 0.0 | 0.0 | -0.719329 | -1.5 |
|
|
604
|
+
| 2000-01-01 03:20:00 | 0.92016 | 0.0 | 0.0 | -0.72384 | -1.5 |
|
|
605
|
+
| 2000-01-01 03:25:00 | 1.224742 | 0.0 | 0.0 | -0.728033 | -1.5 |
|
|
606
|
+
| 2000-01-01 03:30:00 | 1.52568 | 0.0 | 0.0 | -0.731932 | -1.5 |
|
|
607
|
+
| 2000-01-01 03:35:00 | 1.82326 | 0.0 | 0.0 | -0.735573 | -1.5 |
|
|
608
|
+
| 2000-01-01 03:40:00 | 2.117718 | 0.0 | 0.0 | -0.738988 | -1.5 |
|
|
609
|
+
| 2000-01-01 03:45:00 | 2.409252 | 0.0 | 0.0 | -0.742203 | -1.5 |
|
|
610
|
+
| 2000-01-01 03:50:00 | 2.698035 | 0.0 | 0.0 | -0.74524 | -1.5 |
|
|
611
|
+
| 2000-01-01 03:55:00 | 2.98422 | 0.0 | 0.0 | -0.748116 | -1.5 |
|
|
612
|
+
| 2000-01-01 04:00:00 | 3.267941 | 0.0 | 0.0 | -0.750845 | -1.5 |
|
|
613
|
+
| 2000-01-01 04:05:00 | 3.549322 | 0.0 | 0.0 | -0.753437 | -1.5 |
|
|
614
|
+
| 2000-01-01 04:10:00 | 3.828473 | 0.0 | 0.0 | -0.755902 | -1.5 |
|
|
615
|
+
| 2000-01-01 04:15:00 | 4.105495 | 0.0 | 0.0 | -0.758246 | -1.5 |
|
|
616
|
+
| 2000-01-01 04:20:00 | 4.380482 | 0.0 | 0.0 | -0.760477 | -1.5 |
|
|
617
|
+
| 2000-01-01 04:25:00 | 4.653521 | 0.0 | 0.0 | -0.7626 | -1.5 |
|
|
618
|
+
| 2000-01-01 04:30:00 | 4.924693 | 0.0 | 0.0 | -0.76462 | -1.5 |
|
|
619
|
+
| 2000-01-01 04:35:00 | 5.194073 | 0.0 | 0.0 | -0.76654 | -1.5 |
|
|
620
|
+
| 2000-01-01 04:40:00 | 5.461733 | 0.0 | 0.0 | -0.768366 | -1.5 |
|
|
621
|
+
| 2000-01-01 04:45:00 | 5.727738 | 0.0 | 0.0 | -0.7701 | -1.5 |
|
|
622
|
+
| 2000-01-01 04:50:00 | 5.992153 | 0.0 | 0.0 | -0.771747 | -1.5 |
|
|
623
|
+
| 2000-01-01 04:55:00 | 6.255037 | 0.0 | 0.0 | -0.77331 | -1.5 |
|
|
624
|
+
|
|
625
|
+
Again, the simulated water levels at the end of the simulation period seem reasonable
|
|
626
|
+
and sufficiently similar to those we calculated with a fully hydrodynamic model:
|
|
627
|
+
|
|
628
|
+
>>> plot_waterlevels("sw1d_network_bifurcations.png")
|
|
629
|
+
|
|
630
|
+
.. image:: sw1d_network_bifurcations.png
|
|
631
|
+
|
|
632
|
+
There is no indication of an error in the water balance:
|
|
633
|
+
|
|
634
|
+
>>> round_(test.hydpy.collectives[0].model.check_waterbalance(conditions))
|
|
635
|
+
0.0
|
|
636
|
+
"""
|
|
637
|
+
# import...
|
|
638
|
+
# ...from standard library
|
|
639
|
+
from __future__ import annotations
|
|
640
|
+
|
|
641
|
+
# ...from HydPy
|
|
642
|
+
from hydpy.core import devicetools
|
|
643
|
+
from hydpy.core import importtools
|
|
644
|
+
from hydpy.core import modeltools
|
|
645
|
+
from hydpy.core import objecttools
|
|
646
|
+
from hydpy.core.typingtools import *
|
|
647
|
+
from hydpy.exe.modelimports import *
|
|
648
|
+
from hydpy.interfaces import routinginterfaces
|
|
649
|
+
|
|
650
|
+
# ...from sw1d
|
|
651
|
+
from hydpy.models.sw1d import sw1d_model
|
|
652
|
+
from hydpy.models.sw1d import sw1d_derived
|
|
653
|
+
from hydpy.models import sw1d_channel
|
|
654
|
+
|
|
655
|
+
ADDITIONAL_DERIVEDPARAMETERS = (sw1d_derived.Seconds,)
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
class Model(modeltools.SubstepModel):
|
|
659
|
+
"""|sw1d_network.DOCNAME.complete|."""
|
|
660
|
+
|
|
661
|
+
DOCNAME = modeltools.DocName(
|
|
662
|
+
short="SW1D-Network",
|
|
663
|
+
description=(
|
|
664
|
+
'"composite model" for solving the 1-dimensional shallow water equations '
|
|
665
|
+
"in channel networks"
|
|
666
|
+
),
|
|
667
|
+
)
|
|
668
|
+
__HYDPY_ROOTMODEL__ = None
|
|
669
|
+
|
|
670
|
+
COMPOSITE = True
|
|
671
|
+
"""|sw1d_network| is a composite model. (One usually only works with it
|
|
672
|
+
indirectly.)"""
|
|
673
|
+
|
|
674
|
+
INLET_METHODS = (sw1d_model.Trigger_Preprocessing_V1,)
|
|
675
|
+
RECEIVER_METHODS = ()
|
|
676
|
+
RUN_METHODS = (
|
|
677
|
+
sw1d_model.Calc_MaxTimeSteps_V1,
|
|
678
|
+
sw1d_model.Calc_TimeStep_V1,
|
|
679
|
+
sw1d_model.Send_TimeStep_V1,
|
|
680
|
+
sw1d_model.Calc_Discharges_V1,
|
|
681
|
+
sw1d_model.Update_Storages_V1,
|
|
682
|
+
)
|
|
683
|
+
INTERFACE_METHODS = ()
|
|
684
|
+
ADD_METHODS = ()
|
|
685
|
+
OUTLET_METHODS = (sw1d_model.Trigger_Postprocessing_V1,)
|
|
686
|
+
SENDER_METHODS = ()
|
|
687
|
+
SUBMODELINTERFACES = (
|
|
688
|
+
routinginterfaces.RoutingModel_V1,
|
|
689
|
+
routinginterfaces.RoutingModel_V2,
|
|
690
|
+
routinginterfaces.RoutingModel_V3,
|
|
691
|
+
routinginterfaces.StorageModel_V1,
|
|
692
|
+
routinginterfaces.ChannelModel_V1,
|
|
693
|
+
)
|
|
694
|
+
SUBMODELS = ()
|
|
695
|
+
|
|
696
|
+
channelmodels = modeltools.SubmodelsProperty(routinginterfaces.ChannelModel_V1)
|
|
697
|
+
storagemodels = modeltools.SubmodelsProperty(routinginterfaces.StorageModel_V1)
|
|
698
|
+
routingmodels = modeltools.SubmodelsProperty(
|
|
699
|
+
routinginterfaces.RoutingModel_V1,
|
|
700
|
+
routinginterfaces.RoutingModel_V2,
|
|
701
|
+
routinginterfaces.RoutingModel_V3,
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
def check_waterbalance(self, initial_conditions: ConditionsModel) -> float:
|
|
705
|
+
r"""Determine the water balance error of the previous simulation in 1000 m³.
|
|
706
|
+
|
|
707
|
+
Method |Model.check_waterbalance| calculates the balance error as follows:
|
|
708
|
+
|
|
709
|
+
.. math::
|
|
710
|
+
Error = \Sigma In - \Sigma Out + \Sigma Lat - \Delta Vol \\
|
|
711
|
+
\\
|
|
712
|
+
\Sigma In = \sum_{t=t_0}^{t_1} \sum_{i=1}^{R_1} DischargeVolume_t^i \\
|
|
713
|
+
\Sigma Out = \sum_{t=t_0}^{t_1} \sum_{i=1}^{R_3} DischargeVolume_t^i \\
|
|
714
|
+
\Sigma Lat = Seconds \cdot
|
|
715
|
+
\sum_{t=t_0}^{t_1} \sum_{i=1}^{S_1} LateralFlow_t^i \\
|
|
716
|
+
\Delta Vol = 1000 \cdot
|
|
717
|
+
\sum_{i=1}^{S_1} WaterVolume_{t_1}^i - WaterVolume_{t_0}^i \\
|
|
718
|
+
\\
|
|
719
|
+
S_1 = N(StorageModel\_V1) \\
|
|
720
|
+
R_1 = N(RoutingModel\_V1) \\
|
|
721
|
+
R_3 = N(RoutingModel\_V3)
|
|
722
|
+
|
|
723
|
+
The returned error should always be in scale with numerical precision so that
|
|
724
|
+
it does not affect the simulation results in any relevant manner.
|
|
725
|
+
|
|
726
|
+
Pick the required initial conditions before starting the simulation run via
|
|
727
|
+
property |Sequences.conditions|. See the application model |sw1d_network| for
|
|
728
|
+
integration tests some examples.
|
|
729
|
+
|
|
730
|
+
ToDo: So far, |Model.check_waterbalance| works only safely with application
|
|
731
|
+
models |sw1d_storage|, |sw1d_q_in|, |sw1d_lias|, |sw1d_q_out|, and
|
|
732
|
+
|sw1d_weir_out| and might fail for other models. We need to implement a
|
|
733
|
+
more general solution when we implement incompatible models.
|
|
734
|
+
"""
|
|
735
|
+
|
|
736
|
+
r1 = routinginterfaces.RoutingModel_V1
|
|
737
|
+
r3 = routinginterfaces.RoutingModel_V3
|
|
738
|
+
r2 = routinginterfaces.RoutingModel_V2
|
|
739
|
+
v2 = routinginterfaces.ChannelModel_V1
|
|
740
|
+
|
|
741
|
+
secs = self.parameters.derived.seconds.value
|
|
742
|
+
volume_old, volume_new, latflow = 0.0, 0.0, 0.0
|
|
743
|
+
inflow, outflow = 0.0, 0.0
|
|
744
|
+
for name, model in self.find_submodels(include_subsubmodels=False).items():
|
|
745
|
+
if isinstance(model, routinginterfaces.StorageModel_V1):
|
|
746
|
+
wv = initial_conditions[name]["states"]["watervolume"]
|
|
747
|
+
assert isinstance(wv, float)
|
|
748
|
+
volume_old += 1000.0 * wv
|
|
749
|
+
volume_new += 1000.0 * model.sequences.states.watervolume
|
|
750
|
+
latflow += secs * numpy.sum(model.sequences.fluxes.lateralflow.series)
|
|
751
|
+
elif isinstance(model, r1):
|
|
752
|
+
inflow += numpy.sum(model.sequences.fluxes.dischargevolume.series)
|
|
753
|
+
elif isinstance(model, r3):
|
|
754
|
+
outflow += numpy.sum(model.sequences.fluxes.dischargevolume.series)
|
|
755
|
+
else:
|
|
756
|
+
assert isinstance(model, (r2, v2))
|
|
757
|
+
return volume_old + inflow - outflow + latflow - volume_new
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
@modeltools.define_modelcoupler(inputtypes=(sw1d_channel.Model,), outputtype=Model)
|
|
761
|
+
def combine_channels(
|
|
762
|
+
*, nodes: devicetools.Nodes, elements: devicetools.Elements
|
|
763
|
+
) -> Model:
|
|
764
|
+
"""Combine all the submodels of the given |sw1d_channel| instances within a new
|
|
765
|
+
|sw1d_network| instance and build their missing connections.
|
|
766
|
+
|
|
767
|
+
|combine_channels| has to address many corner cases, especially for discovering
|
|
768
|
+
configuration errors. We define a helper function that returns a (hopefully
|
|
769
|
+
sufficiently complex) valid setting containing six |sw1d_channel| models, including
|
|
770
|
+
one bifurcation and one confluence:
|
|
771
|
+
|
|
772
|
+
>>> from hydpy import Element, Nodes, prepare_model
|
|
773
|
+
>>> def prepare_example():
|
|
774
|
+
...
|
|
775
|
+
... nodes = n12, n23, n34, n45 = Nodes("n12", "n23", "n34", "n45",
|
|
776
|
+
... defaultvariable="LongQ")
|
|
777
|
+
...
|
|
778
|
+
... e1 = Element("e1", outlets=n12)
|
|
779
|
+
... e2 = Element("e2", inlets=n12, outlets=n23)
|
|
780
|
+
... e3a = Element("e3a", inlets=n23, outlets=n34)
|
|
781
|
+
... e3b = Element("e3b", inlets=n23, outlets=n34)
|
|
782
|
+
... e4 = Element("e4", inlets=n34, outlets=n45)
|
|
783
|
+
... e5 = Element("e5", inlets=n45)
|
|
784
|
+
... elements = e1, e2, e3a, e3b, e4, e5
|
|
785
|
+
...
|
|
786
|
+
... m1 = prepare_model("sw1d_channel")
|
|
787
|
+
... m2 = prepare_model("sw1d_channel")
|
|
788
|
+
... m3a = prepare_model("sw1d_channel")
|
|
789
|
+
... m3b = prepare_model("sw1d_channel")
|
|
790
|
+
... m4 = prepare_model("sw1d_channel")
|
|
791
|
+
... m5 = prepare_model("sw1d_channel")
|
|
792
|
+
... models = m1, m2, m3a, m3b, m4, m5
|
|
793
|
+
...
|
|
794
|
+
... m1.parameters.control.nmbsegments(1)
|
|
795
|
+
... m2.parameters.control.nmbsegments(1)
|
|
796
|
+
... m3a.parameters.control.nmbsegments(2)
|
|
797
|
+
... m3b.parameters.control.nmbsegments(1)
|
|
798
|
+
... m4.parameters.control.nmbsegments(1)
|
|
799
|
+
... m5.parameters.control.nmbsegments(1)
|
|
800
|
+
...
|
|
801
|
+
... for m in models:
|
|
802
|
+
... for i in range(m.parameters.control.nmbsegments.value):
|
|
803
|
+
... with m.add_storagemodel_v1("sw1d_storage", position=i):
|
|
804
|
+
... pass
|
|
805
|
+
... for m, ps in ((m1, [1]), (m3a, [0, 1, 2]), (m3b, [0, 1]), (m5, [0])):
|
|
806
|
+
... for p in ps:
|
|
807
|
+
... with m.add_routingmodel_v2("sw1d_lias", position=p, update=False):
|
|
808
|
+
... pass
|
|
809
|
+
...
|
|
810
|
+
... e1.model = m1
|
|
811
|
+
... e2.model = m2
|
|
812
|
+
... e3a.model = m3a
|
|
813
|
+
... e3b.model = m3b
|
|
814
|
+
... e4.model = m4
|
|
815
|
+
... e5.model = m5
|
|
816
|
+
...
|
|
817
|
+
... return nodes, elements, models
|
|
818
|
+
|
|
819
|
+
The second helper function checks for this example if all |combine_channels| builds
|
|
820
|
+
all side-model connections correctly and does not break already existing ones:
|
|
821
|
+
|
|
822
|
+
>>> def apply_assertions(models):
|
|
823
|
+
... m1, m2, m3a, m3b, m4, m5 = models
|
|
824
|
+
...
|
|
825
|
+
... sm = m1.storagemodels[0]
|
|
826
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 1
|
|
827
|
+
... assert m1.routingmodels[1] in rmsd
|
|
828
|
+
...
|
|
829
|
+
... rm = m1.routingmodels[1]
|
|
830
|
+
... assert rm.routingmodelsupstream.number == 0
|
|
831
|
+
... assert rm.storagemodelupstream is m1.storagemodels[0]
|
|
832
|
+
... assert rm.storagemodeldownstream is m2.storagemodels[0]
|
|
833
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 2
|
|
834
|
+
... assert m3a.routingmodels[0] in rmsd
|
|
835
|
+
... assert m3b.routingmodels[0] in rmsd
|
|
836
|
+
...
|
|
837
|
+
... sm = m2.storagemodels[0]
|
|
838
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 1
|
|
839
|
+
... assert m1.routingmodels[1] in rmsu
|
|
840
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 2
|
|
841
|
+
... assert m3a.routingmodels[0] in rmsd
|
|
842
|
+
... assert m3a.routingmodels[0] in rmsd
|
|
843
|
+
...
|
|
844
|
+
... rm = m3a.routingmodels[0]
|
|
845
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 1
|
|
846
|
+
... assert m1.routingmodels[1] in rmsu
|
|
847
|
+
... assert rm.storagemodelupstream is m2.storagemodels[0]
|
|
848
|
+
... assert rm.storagemodeldownstream is m3a.storagemodels[0]
|
|
849
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 1
|
|
850
|
+
... assert m3a.routingmodels[1] in rmsd
|
|
851
|
+
...
|
|
852
|
+
... sm = m3a.storagemodels[0]
|
|
853
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 1
|
|
854
|
+
... assert m3a.routingmodels[0] in rmsu
|
|
855
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 1
|
|
856
|
+
... assert m3a.routingmodels[1] in rmsd
|
|
857
|
+
...
|
|
858
|
+
... rm = m3a.routingmodels[1]
|
|
859
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 1
|
|
860
|
+
... assert m3a.routingmodels[0] in rmsu
|
|
861
|
+
... assert rm.storagemodelupstream is m3a.storagemodels[0]
|
|
862
|
+
... assert rm.storagemodeldownstream is m3a.storagemodels[1]
|
|
863
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 1
|
|
864
|
+
... assert m3a.routingmodels[2] in rmsd
|
|
865
|
+
...
|
|
866
|
+
... sm = m3a.storagemodels[1]
|
|
867
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 1
|
|
868
|
+
... assert m3a.routingmodels[1] in rmsu
|
|
869
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 1
|
|
870
|
+
... assert m3a.routingmodels[2] in rmsd
|
|
871
|
+
...
|
|
872
|
+
... rm = m3a.routingmodels[2]
|
|
873
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 1
|
|
874
|
+
... assert m3a.routingmodels[1] in rmsu
|
|
875
|
+
... assert rm.storagemodelupstream is m3a.storagemodels[1]
|
|
876
|
+
... assert rm.storagemodeldownstream is m4.storagemodels[0]
|
|
877
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 1
|
|
878
|
+
... assert m5.routingmodels[0] in rmsd
|
|
879
|
+
...
|
|
880
|
+
... rm = m3b.routingmodels[0]
|
|
881
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 1
|
|
882
|
+
... assert m1.routingmodels[1] in rmsu
|
|
883
|
+
... assert rm.storagemodelupstream is m2.storagemodels[0]
|
|
884
|
+
... assert rm.storagemodeldownstream is m3b.storagemodels[0]
|
|
885
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 1
|
|
886
|
+
... assert m3b.routingmodels[1] in rmsd
|
|
887
|
+
...
|
|
888
|
+
... sm = m3b.storagemodels[0]
|
|
889
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 1
|
|
890
|
+
... assert m3b.routingmodels[0] in rmsu
|
|
891
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 1
|
|
892
|
+
... assert m3b.routingmodels[1] in rmsd
|
|
893
|
+
...
|
|
894
|
+
... rm = m3b.routingmodels[1]
|
|
895
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 1
|
|
896
|
+
... assert m3b.routingmodels[0] in rmsu
|
|
897
|
+
... assert rm.storagemodelupstream is m3b.storagemodels[0]
|
|
898
|
+
... assert rm.storagemodeldownstream is m4.storagemodels[0]
|
|
899
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 1
|
|
900
|
+
... assert m5.routingmodels[0] in rmsd
|
|
901
|
+
...
|
|
902
|
+
... sm = m4.storagemodels[0]
|
|
903
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 2
|
|
904
|
+
... assert m3a.routingmodels[2] in rmsu
|
|
905
|
+
... assert m3b.routingmodels[1] in rmsu
|
|
906
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 1
|
|
907
|
+
... assert m5.routingmodels[0] in rmsd
|
|
908
|
+
...
|
|
909
|
+
... rm = m5.routingmodels[0]
|
|
910
|
+
... assert (rmsu := rm.routingmodelsupstream).number == 2
|
|
911
|
+
... assert m3a.routingmodels[2] in rmsu
|
|
912
|
+
... assert m3b.routingmodels[1] in rmsu
|
|
913
|
+
... assert rm.storagemodelupstream is m4.storagemodels[0]
|
|
914
|
+
... assert rm.storagemodeldownstream is m5.storagemodels[0]
|
|
915
|
+
... assert (rmsd := rm.routingmodelsdownstream).number == 0
|
|
916
|
+
...
|
|
917
|
+
... sm = m5.storagemodels[0]
|
|
918
|
+
... assert (rmsu := sm.routingmodelsupstream).number == 1
|
|
919
|
+
... assert m5.routingmodels[0] in rmsu
|
|
920
|
+
... assert (rmsd := sm.routingmodelsdownstream).number == 0
|
|
921
|
+
|
|
922
|
+
According to the test functions, |combine_channels| works correctly:
|
|
923
|
+
|
|
924
|
+
>>> nodes, elements, models = prepare_example()
|
|
925
|
+
>>> from hydpy.models.sw1d_network import combine_channels
|
|
926
|
+
>>> network = combine_channels(nodes=nodes, elements=elements)
|
|
927
|
+
>>> apply_assertions(models)
|
|
928
|
+
|
|
929
|
+
Before building new connections, |combine_channels| deletes existing ones that it
|
|
930
|
+
is responsible for and might have ,ade in an earlier call. This preprocessing step
|
|
931
|
+
allows to use |combine_channels| multiple times without risking duplicate
|
|
932
|
+
connections:
|
|
933
|
+
|
|
934
|
+
>>> network = combine_channels(nodes=nodes, elements=elements)
|
|
935
|
+
>>> apply_assertions(models)
|
|
936
|
+
|
|
937
|
+
|combine_channels| performs various checks. We shortly explain the covered
|
|
938
|
+
configuration errors.
|
|
939
|
+
|
|
940
|
+
There must be one routing model between all neighbouring segments of a single
|
|
941
|
+
channel:
|
|
942
|
+
|
|
943
|
+
>>> models[2].routingmodels.delete_submodel(1)
|
|
944
|
+
>>> combine_channels(nodes=nodes, elements=elements)
|
|
945
|
+
Traceback (most recent call last):
|
|
946
|
+
...
|
|
947
|
+
RuntimeError: While trying to couple the given model instances to a composite \
|
|
948
|
+
model of type `sw1d_network` based on function `combine_channels`, the following \
|
|
949
|
+
error occurred: Model `sw1d_channel` of element `e3a` requires a routing model at \
|
|
950
|
+
position `1`, which is missing.
|
|
951
|
+
|
|
952
|
+
There must be one storage model for each channel segment:
|
|
953
|
+
|
|
954
|
+
>>> models[1].storagemodels.delete_submodel(0)
|
|
955
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
956
|
+
Traceback (most recent call last):
|
|
957
|
+
...
|
|
958
|
+
RuntimeError: ... Model `sw1d_channel` of element `e2` requires a storage model \
|
|
959
|
+
at position `0`, which is missing.
|
|
960
|
+
|
|
961
|
+
There must be one routing model between each pair of a channel's neighbouring
|
|
962
|
+
segments:
|
|
963
|
+
|
|
964
|
+
>>> nodes, elements, models = prepare_example()
|
|
965
|
+
>>> models[5].routingmodels.delete_submodel(0)
|
|
966
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
967
|
+
Traceback (most recent call last):
|
|
968
|
+
...
|
|
969
|
+
RuntimeError: ... Either model `sw1d_channel` of element `e4` requires a routing \
|
|
970
|
+
model at its last position or model `sw1d_channel` of element `e5` at its first \
|
|
971
|
+
position, but both are missing.
|
|
972
|
+
|
|
973
|
+
All routing models between two segments must allow building connections to upstream
|
|
974
|
+
models:
|
|
975
|
+
|
|
976
|
+
>>> with models[5].add_routingmodel_v1("sw1d_q_in", position=0, update=False):
|
|
977
|
+
... pass
|
|
978
|
+
>>> elements[5].model = models[5]
|
|
979
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
980
|
+
Traceback (most recent call last):
|
|
981
|
+
...
|
|
982
|
+
RuntimeError: ... Submodel `sw1d_q_in` of element `e5` does not allow to build an \
|
|
983
|
+
upstream connection to model `sw1d_channel` of element `e4`.
|
|
984
|
+
|
|
985
|
+
All routing models between two segments must allow building connections to
|
|
986
|
+
downstream models:
|
|
987
|
+
|
|
988
|
+
>>> with models[0].add_routingmodel_v3("sw1d_q_out", position=1, update=False):
|
|
989
|
+
... pass
|
|
990
|
+
>>> elements[0].model = models[0]
|
|
991
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
992
|
+
Traceback (most recent call last):
|
|
993
|
+
...
|
|
994
|
+
RuntimeError: ... Submodel `sw1d_q_out` of element `e1` does not allow to build \
|
|
995
|
+
a downstream connection to model `sw1d_channel` of element `e2`.
|
|
996
|
+
|
|
997
|
+
There cannot be multiple routing models between two segments:
|
|
998
|
+
|
|
999
|
+
>>> nodes, elements, models = prepare_example()
|
|
1000
|
+
>>> with models[4].add_routingmodel_v2("sw1d_lias", position=1, update=False):
|
|
1001
|
+
... pass
|
|
1002
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
1003
|
+
Traceback (most recent call last):
|
|
1004
|
+
...
|
|
1005
|
+
RuntimeError: ... Either model `sw1d_channel` of element `e4` must provide a \
|
|
1006
|
+
routing model at its last position or model `sw1d_channel` of element `e5` at its \
|
|
1007
|
+
first position, but both do.
|
|
1008
|
+
|
|
1009
|
+
One cannot connect a routing model to multiple upstream storage models:
|
|
1010
|
+
|
|
1011
|
+
>>> models[2].routingmodels.delete_submodel(2)
|
|
1012
|
+
>>> models[3].routingmodels.delete_submodel(1)
|
|
1013
|
+
>>> with models[4].add_routingmodel_v2("sw1d_lias", position=0, update=False):
|
|
1014
|
+
... pass
|
|
1015
|
+
>>> elements[4].model = models[4]
|
|
1016
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
1017
|
+
Traceback (most recent call last):
|
|
1018
|
+
...
|
|
1019
|
+
RuntimeError: ... The first routing submodel, `sw1d_lias` of element `e4`, can \
|
|
1020
|
+
only be connected to one upstream storage submodel but is requested to be at least \
|
|
1021
|
+
connected to `sw1d_storage` of element `e3a` and `sw1d_storage` of element `e3b`.
|
|
1022
|
+
|
|
1023
|
+
One cannot connect a routing model to multiple downstream storage models:
|
|
1024
|
+
|
|
1025
|
+
>>> models[2].routingmodels.delete_submodel(0)
|
|
1026
|
+
>>> models[3].routingmodels.delete_submodel(0)
|
|
1027
|
+
>>> with models[1].add_routingmodel_v2("sw1d_lias", position=1, update=False):
|
|
1028
|
+
... pass
|
|
1029
|
+
>>> elements[1].model = models[1]
|
|
1030
|
+
>>> combine_channels(nodes=nodes, elements=elements) # doctest: +ELLIPSIS
|
|
1031
|
+
Traceback (most recent call last):
|
|
1032
|
+
...
|
|
1033
|
+
RuntimeError: ... The last routing submodel, `sw1d_lias` of element `e2`, can \
|
|
1034
|
+
only be connected to one downstream storage submodel but is requested to be at least \
|
|
1035
|
+
connected to `sw1d_storage` of element `e3a` and `sw1d_storage` of element `e3b`.
|
|
1036
|
+
"""
|
|
1037
|
+
# pylint: disable=too-many-nested-blocks,too-many-branches,too-many-statements
|
|
1038
|
+
|
|
1039
|
+
c1 = routinginterfaces.ChannelModel_V1
|
|
1040
|
+
r1 = routinginterfaces.RoutingModel_V1
|
|
1041
|
+
r2 = routinginterfaces.RoutingModel_V2
|
|
1042
|
+
r3 = routinginterfaces.RoutingModel_V3
|
|
1043
|
+
network = importtools.prepare_model("sw1d_network")
|
|
1044
|
+
assert isinstance(network, Model)
|
|
1045
|
+
channelmodels = network.channelmodels
|
|
1046
|
+
storagemodels = network.storagemodels
|
|
1047
|
+
routingmodels = network.routingmodels
|
|
1048
|
+
ep = objecttools.elementphrase
|
|
1049
|
+
|
|
1050
|
+
for element in elements:
|
|
1051
|
+
cm = element.model
|
|
1052
|
+
assert isinstance(cm, c1)
|
|
1053
|
+
|
|
1054
|
+
# First check if all definitely required submodels are actually available:
|
|
1055
|
+
for i, sm in enumerate(cm.storagemodels):
|
|
1056
|
+
if sm is None:
|
|
1057
|
+
raise RuntimeError(
|
|
1058
|
+
f"Model {ep(cm)} requires a storage model at position `{i}`, "
|
|
1059
|
+
f"which is missing."
|
|
1060
|
+
)
|
|
1061
|
+
for i, rm in enumerate(cm.routingmodels.submodels[1:-1]):
|
|
1062
|
+
if rm is None:
|
|
1063
|
+
raise RuntimeError(
|
|
1064
|
+
f"Model {ep(cm)} requires a routing model at position `{i + 1}`, "
|
|
1065
|
+
f"which is missing."
|
|
1066
|
+
)
|
|
1067
|
+
|
|
1068
|
+
# Link the network to its submodels:
|
|
1069
|
+
channelmodels.append_submodel(submodel=cm)
|
|
1070
|
+
for sm in cm.storagemodels.submodels:
|
|
1071
|
+
if sm is not None:
|
|
1072
|
+
storagemodels.append_submodel(submodel=sm)
|
|
1073
|
+
for rm in cm.routingmodels.submodels:
|
|
1074
|
+
if rm is not None:
|
|
1075
|
+
routingmodels.append_submodel(submodel=rm)
|
|
1076
|
+
|
|
1077
|
+
# Prevent duplicate links when calling `combine_channels` twice:
|
|
1078
|
+
if (r_d1 := cm.routingmodels[0]) is None:
|
|
1079
|
+
assert (sm := cm.storagemodels[0]) is not None
|
|
1080
|
+
sm.routingmodelsupstream.number = 0
|
|
1081
|
+
if (r_d2 := cm.routingmodels[1]) is not None:
|
|
1082
|
+
if isinstance(r_d2, (r2, r3)):
|
|
1083
|
+
r_d2.routingmodelsupstream.number = 0
|
|
1084
|
+
else:
|
|
1085
|
+
assert not isinstance(r_d2, r1)
|
|
1086
|
+
assert_never(r_d2)
|
|
1087
|
+
else:
|
|
1088
|
+
if isinstance(r_d1, r2):
|
|
1089
|
+
r_d1.routingmodelsupstream.number = 0
|
|
1090
|
+
r_d1.storagemodelupstream = None
|
|
1091
|
+
r_d1.storagemodelupstream_typeid = 0
|
|
1092
|
+
elif isinstance(r_d1, r1):
|
|
1093
|
+
pass
|
|
1094
|
+
else:
|
|
1095
|
+
assert not isinstance(r_d1, r3)
|
|
1096
|
+
assert_never(r_d1)
|
|
1097
|
+
|
|
1098
|
+
if (r_u1 := cm.routingmodels[-1]) is None:
|
|
1099
|
+
assert (sm := cm.storagemodels[-1]) is not None
|
|
1100
|
+
sm.routingmodelsdownstream.number = 0
|
|
1101
|
+
if (r_u2 := cm.routingmodels[-2]) is not None:
|
|
1102
|
+
if isinstance(r_u2, (r1, r2)):
|
|
1103
|
+
r_u2.routingmodelsdownstream.number = 0
|
|
1104
|
+
else:
|
|
1105
|
+
assert not isinstance(r_u2, r3)
|
|
1106
|
+
assert_never(r_u2)
|
|
1107
|
+
else:
|
|
1108
|
+
if isinstance(r_u1, r2):
|
|
1109
|
+
r_u1.routingmodelsdownstream.number = 0
|
|
1110
|
+
r_u1.storagemodeldownstream = None
|
|
1111
|
+
r_u1.storagemodeldownstream_typeid = 0
|
|
1112
|
+
elif isinstance(r_u1, r3):
|
|
1113
|
+
pass
|
|
1114
|
+
else:
|
|
1115
|
+
assert not isinstance(r_u1, r1)
|
|
1116
|
+
assert_never(r_u1)
|
|
1117
|
+
|
|
1118
|
+
# Link the submodels at the channel end points:
|
|
1119
|
+
for node in nodes:
|
|
1120
|
+
for e_up in (e_up for e_up in node.entries if e_up in elements):
|
|
1121
|
+
assert isinstance(c_u := e_up.model, c1)
|
|
1122
|
+
if (r_u := c_u.routingmodels[-1]) is None:
|
|
1123
|
+
for e_down in (e_down for e_down in node.exits if e_down in elements):
|
|
1124
|
+
assert isinstance(c_d := e_down.model, c1)
|
|
1125
|
+
assert (s_u := c_u.storagemodels[-1]) is not None
|
|
1126
|
+
if (r_d := c_d.routingmodels[0]) is None:
|
|
1127
|
+
raise RuntimeError(
|
|
1128
|
+
f"Either model {ep(c_u)} requires a routing model at its "
|
|
1129
|
+
f"last position or model {ep(c_d)} at its first position, "
|
|
1130
|
+
f"but both are missing."
|
|
1131
|
+
)
|
|
1132
|
+
if isinstance(r_d, r2):
|
|
1133
|
+
pass
|
|
1134
|
+
elif isinstance(r_d, r1):
|
|
1135
|
+
raise RuntimeError(
|
|
1136
|
+
f"Submodel {ep(r_d)} does not allow to build an upstream "
|
|
1137
|
+
f"connection to model {ep(c_u)}."
|
|
1138
|
+
)
|
|
1139
|
+
else:
|
|
1140
|
+
assert not isinstance(r_d, r3)
|
|
1141
|
+
assert_never(r_d)
|
|
1142
|
+
if r_d.storagemodelupstream is not None:
|
|
1143
|
+
raise RuntimeError(
|
|
1144
|
+
f"The first routing submodel, {ep(r_d)}, can only be "
|
|
1145
|
+
f"connected to one upstream storage submodel but is "
|
|
1146
|
+
f"requested to be at least connected to "
|
|
1147
|
+
f"{ep(r_d.storagemodelupstream)} and {ep(s_u)}."
|
|
1148
|
+
)
|
|
1149
|
+
r_d.storagemodelupstream = s_u
|
|
1150
|
+
r_d.storagemodelupstream_typeid = c_u.storagemodels.typeids[-1]
|
|
1151
|
+
s_u.routingmodelsdownstream.append_submodel(r_d)
|
|
1152
|
+
if (r_uu := c_u.routingmodels[-2]) is None:
|
|
1153
|
+
# hint: this "None part" does not need to be repeated below
|
|
1154
|
+
n_u = e_up.inlets[0]
|
|
1155
|
+
for e_uu in (e_uu for e_uu in n_u.entries if e_uu in elements):
|
|
1156
|
+
assert isinstance(c_uu := e_uu.model, c1)
|
|
1157
|
+
if (r_uu := c_uu.routingmodels[-1]) is not None:
|
|
1158
|
+
# hint: exception for the None case handled above
|
|
1159
|
+
if isinstance(r_uu, r2):
|
|
1160
|
+
pass
|
|
1161
|
+
else:
|
|
1162
|
+
assert not isinstance(r_uu, (r1, r3))
|
|
1163
|
+
assert_never(r_uu)
|
|
1164
|
+
r_d.routingmodelsupstream.append_submodel(r_uu)
|
|
1165
|
+
r_uu.routingmodelsdownstream.append_submodel(r_d)
|
|
1166
|
+
else:
|
|
1167
|
+
if isinstance(r_uu, (r1, r2)):
|
|
1168
|
+
r_d.routingmodelsupstream.append_submodel(r_uu)
|
|
1169
|
+
r_uu.routingmodelsdownstream.append_submodel(r_d)
|
|
1170
|
+
else:
|
|
1171
|
+
assert not isinstance(r_uu, r3)
|
|
1172
|
+
assert_never(r_uu)
|
|
1173
|
+
else:
|
|
1174
|
+
for e_down in (e_down for e_down in node.exits if e_down in elements):
|
|
1175
|
+
assert isinstance(c_d := e_down.model, c1)
|
|
1176
|
+
if c_d.routingmodels[0] is not None:
|
|
1177
|
+
raise RuntimeError(
|
|
1178
|
+
f"Either model {ep(c_u)} must provide a routing model at "
|
|
1179
|
+
f"its last position or model {ep(c_d)} at its first "
|
|
1180
|
+
f"position, but both do."
|
|
1181
|
+
)
|
|
1182
|
+
|
|
1183
|
+
for e_down in (e_down for e_down in node.exits if e_down in elements):
|
|
1184
|
+
assert isinstance(c_d := e_down.model, c1)
|
|
1185
|
+
if (r_d := c_d.routingmodels[0]) is None:
|
|
1186
|
+
for e_up in (e_up for e_up in node.entries if e_up in elements):
|
|
1187
|
+
assert isinstance(c_u := e_up.model, c1)
|
|
1188
|
+
assert (s_d := c_d.storagemodels[0]) is not None
|
|
1189
|
+
assert (r_u := c_u.routingmodels[-1]) is not None
|
|
1190
|
+
if isinstance(r_u, r3):
|
|
1191
|
+
raise RuntimeError(
|
|
1192
|
+
f"Submodel {ep(r_u)} does not allow to build a "
|
|
1193
|
+
f"downstream connection to model {ep(c_d)}."
|
|
1194
|
+
)
|
|
1195
|
+
assert not isinstance(r_u, r1)
|
|
1196
|
+
if r_u.storagemodeldownstream is not None:
|
|
1197
|
+
raise RuntimeError(
|
|
1198
|
+
f"The last routing submodel, {ep(r_u)}, can only be "
|
|
1199
|
+
f"connected to one downstream storage submodel but is "
|
|
1200
|
+
f"requested to be at least connected to "
|
|
1201
|
+
f"{ep(r_u.storagemodeldownstream)} and {ep(s_d)}."
|
|
1202
|
+
)
|
|
1203
|
+
r_u.storagemodeldownstream = s_d
|
|
1204
|
+
r_u.storagemodeldownstream_typeid = c_d.storagemodels.typeids[0]
|
|
1205
|
+
s_d.routingmodelsupstream.append_submodel(r_u)
|
|
1206
|
+
if (r_dd := c_d.routingmodels[1]) is not None:
|
|
1207
|
+
# hint: the "None part" is already handled above
|
|
1208
|
+
if isinstance(r_dd, (r2, r3)):
|
|
1209
|
+
r_u.routingmodelsdownstream.append_submodel(r_dd)
|
|
1210
|
+
r_dd.routingmodelsupstream.append_submodel(r_u)
|
|
1211
|
+
else:
|
|
1212
|
+
assert not isinstance(r_dd, r1)
|
|
1213
|
+
assert_never(r_dd)
|
|
1214
|
+
|
|
1215
|
+
return network
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
tester = Tester()
|
|
1219
|
+
cythonizer = Cythonizer()
|