repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.prepare_sequencemanager | def prepare_sequencemanager(self) -> None:
"""Configure the |SequenceManager| object available in module
|pub| following the definitions of the actual XML `reader` or
`writer` element when available; if not use those of the XML
`series_io` element.
Compare the following results ... | python | def prepare_sequencemanager(self) -> None:
"""Configure the |SequenceManager| object available in module
|pub| following the definitions of the actual XML `reader` or
`writer` element when available; if not use those of the XML
`series_io` element.
Compare the following results ... | [
"def",
"prepare_sequencemanager",
"(",
"self",
")",
"->",
"None",
":",
"for",
"config",
",",
"convert",
"in",
"(",
"(",
"'filetype'",
",",
"lambda",
"x",
":",
"x",
")",
",",
"(",
"'aggregation'",
",",
"lambda",
"x",
":",
"x",
")",
",",
"(",
"'overwri... | Configure the |SequenceManager| object available in module
|pub| following the definitions of the actual XML `reader` or
`writer` element when available; if not use those of the XML
`series_io` element.
Compare the following results with `single_run.xml` to see that the
first `w... | [
"Configure",
"the",
"|SequenceManager|",
"object",
"available",
"in",
"module",
"|pub|",
"following",
"the",
"definitions",
"of",
"the",
"actual",
"XML",
"reader",
"or",
"writer",
"element",
"when",
"available",
";",
"if",
"not",
"use",
"those",
"of",
"the",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L973-L1041 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.model2subs2seqs | def model2subs2seqs(self) -> Dict[str, Dict[str, List[str]]]:
"""A nested |collections.defaultdict| containing the model specific
information provided by the XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLI... | python | def model2subs2seqs(self) -> Dict[str, Dict[str, List[str]]]:
"""A nested |collections.defaultdict| containing the model specific
information provided by the XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLI... | [
"def",
"model2subs2seqs",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"List",
"[",
"str",
"]",
"]",
"]",
":",
"model2subs2seqs",
"=",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"collections",
".",
"defaultdict",
... | A nested |collections.defaultdict| containing the model specific
information provided by the XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> series_io ... | [
"A",
"nested",
"|collections",
".",
"defaultdict|",
"containing",
"the",
"model",
"specific",
"information",
"provided",
"by",
"the",
"XML",
"sequences",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1044-L1071 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.subs2seqs | def subs2seqs(self) -> Dict[str, List[str]]:
"""A |collections.defaultdict| containing the node-specific
information provided by XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', da... | python | def subs2seqs(self) -> Dict[str, List[str]]:
"""A |collections.defaultdict| containing the node-specific
information provided by XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', da... | [
"def",
"subs2seqs",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"List",
"[",
"str",
"]",
"]",
":",
"subs2seqs",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"nodes",
"=",
"find",
"(",
"self",
".",
"find",
"(",
"'sequences'",
")",
... | A |collections.defaultdict| containing the node-specific
information provided by XML `sequences` element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> series_io = interface.... | [
"A",
"|collections",
".",
"defaultdict|",
"containing",
"the",
"node",
"-",
"specific",
"information",
"provided",
"by",
"XML",
"sequences",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1074-L1092 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.prepare_series | def prepare_series(self, memory: set) -> None:
"""Call |IOSequence.activate_ram| of all sequences selected by
the given output element of the actual XML file.
Use the memory argument to pass in already prepared sequences;
newly prepared sequences will be added.
>>> from hydpy.c... | python | def prepare_series(self, memory: set) -> None:
"""Call |IOSequence.activate_ram| of all sequences selected by
the given output element of the actual XML file.
Use the memory argument to pass in already prepared sequences;
newly prepared sequences will be added.
>>> from hydpy.c... | [
"def",
"prepare_series",
"(",
"self",
",",
"memory",
":",
"set",
")",
"->",
"None",
":",
"for",
"sequence",
"in",
"self",
".",
"_iterate_sequences",
"(",
")",
":",
"if",
"sequence",
"not",
"in",
"memory",
":",
"memory",
".",
"add",
"(",
"sequence",
")"... | Call |IOSequence.activate_ram| of all sequences selected by
the given output element of the actual XML file.
Use the memory argument to pass in already prepared sequences;
newly prepared sequences will be added.
>>> from hydpy.core.examples import prepare_full_example_1
>>> pre... | [
"Call",
"|IOSequence",
".",
"activate_ram|",
"of",
"all",
"sequences",
"selected",
"by",
"the",
"given",
"output",
"element",
"of",
"the",
"actual",
"XML",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1114-L1153 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.load_series | def load_series(self) -> None:
"""Load time series data as defined by the actual XML `reader`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | python | def load_series(self) -> None:
"""Load time series data as defined by the actual XML `reader`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | [
"def",
"load_series",
"(",
"self",
")",
"->",
"None",
":",
"kwargs",
"=",
"{",
"}",
"for",
"keyword",
"in",
"(",
"'flattennetcdf'",
",",
"'isolatenetcdf'",
",",
"'timeaxisnetcdf'",
")",
":",
"argument",
"=",
"getattr",
"(",
"hydpy",
".",
"pub",
".",
"opt... | Load time series data as defined by the actual XML `reader`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
>>> with TestIO():
... hp.p... | [
"Load",
"time",
"series",
"data",
"as",
"defined",
"by",
"the",
"actual",
"XML",
"reader",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1155-L1187 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSubseries.save_series | def save_series(self) -> None:
"""Save time series data as defined by the actual XML `writer`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | python | def save_series(self) -> None:
"""Save time series data as defined by the actual XML `writer`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | [
"def",
"save_series",
"(",
"self",
")",
"->",
"None",
":",
"hydpy",
".",
"pub",
".",
"sequencemanager",
".",
"open_netcdf_writer",
"(",
"flatten",
"=",
"hydpy",
".",
"pub",
".",
"options",
".",
"flattennetcdf",
",",
"isolate",
"=",
"hydpy",
".",
"pub",
"... | Save time series data as defined by the actual XML `writer`
element.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
>>> with TestIO():
... hp.p... | [
"Save",
"time",
"series",
"data",
"as",
"defined",
"by",
"the",
"actual",
"XML",
"writer",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1189-L1231 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLVar.item | def item(self):
""" ToDo
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface, pub
>>> hp = HydPy('LahnH')
>>> pub.timegrids = '1996-01-01', '1996-01-06', '1d'
>>> with TestIO()... | python | def item(self):
""" ToDo
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface, pub
>>> hp = HydPy('LahnH')
>>> pub.timegrids = '1996-01-01', '1996-01-06', '1d'
>>> with TestIO()... | [
"def",
"item",
"(",
"self",
")",
":",
"target",
"=",
"f'{self.master.name}.{self.name}'",
"if",
"self",
".",
"master",
".",
"name",
"==",
"'nodes'",
":",
"master",
"=",
"self",
".",
"master",
".",
"name",
"itemgroup",
"=",
"self",
".",
"master",
".",
"ma... | ToDo
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface, pub
>>> hp = HydPy('LahnH')
>>> pub.timegrids = '1996-01-01', '1996-01-06', '1d'
>>> with TestIO():
... hp.prepare... | [
"ToDo"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1396-L1516 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.write_xsd | def write_xsd(cls) -> None:
"""Write the complete base schema file `HydPyConfigBase.xsd` based
on the template file `HydPyConfigBase.xsdt`.
Method |XSDWriter.write_xsd| adds model specific information to the
general information of template file `HydPyConfigBase.xsdt` regarding
r... | python | def write_xsd(cls) -> None:
"""Write the complete base schema file `HydPyConfigBase.xsd` based
on the template file `HydPyConfigBase.xsdt`.
Method |XSDWriter.write_xsd| adds model specific information to the
general information of template file `HydPyConfigBase.xsdt` regarding
r... | [
"def",
"write_xsd",
"(",
"cls",
")",
"->",
"None",
":",
"with",
"open",
"(",
"cls",
".",
"filepath_source",
")",
"as",
"file_",
":",
"template",
"=",
"file_",
".",
"read",
"(",
")",
"template",
"=",
"template",
".",
"replace",
"(",
"'<!--include model se... | Write the complete base schema file `HydPyConfigBase.xsd` based
on the template file `HydPyConfigBase.xsdt`.
Method |XSDWriter.write_xsd| adds model specific information to the
general information of template file `HydPyConfigBase.xsdt` regarding
reading and writing of time series data ... | [
"Write",
"the",
"complete",
"base",
"schema",
"file",
"HydPyConfigBase",
".",
"xsd",
"based",
"on",
"the",
"template",
"file",
"HydPyConfigBase",
".",
"xsdt",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1556-L1591 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_modelnames | def get_modelnames() -> List[str]:
"""Return a sorted |list| containing all application model names.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS
[...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...]
""... | python | def get_modelnames() -> List[str]:
"""Return a sorted |list| containing all application model names.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS
[...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...]
""... | [
"def",
"get_modelnames",
"(",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"sorted",
"(",
"str",
"(",
"fn",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
")",
"for",
"fn",
"in",
"os",
".",
"listdir",
"(",
"models",
".",
"__path__",
"[",
"... | Return a sorted |list| containing all application model names.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_modelnames()) # doctest: +ELLIPSIS
[...'dam_v001', 'dam_v002', 'dam_v003', 'dam_v004', 'dam_v005',...] | [
"Return",
"a",
"sorted",
"|list|",
"containing",
"all",
"application",
"model",
"names",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1594-L1603 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_insertion | def get_insertion(cls) -> str:
"""Return the complete string to be inserted into the string of the
template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_insertion()) # doctest: +ELLIPSIS
<element name="arma_v1"
substit... | python | def get_insertion(cls) -> str:
"""Return the complete string to be inserted into the string of the
template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_insertion()) # doctest: +ELLIPSIS
<element name="arma_v1"
substit... | [
"def",
"get_insertion",
"(",
"cls",
")",
"->",
"str",
":",
"indent",
"=",
"1",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"+",
"4",
")",
"subs",
"=",
"[",
"]",
"for",
"name",
"in",
"cls",
".",
"get_modelnames",
"(",
")",
":",
"subs",
".",
"extend"... | Return the complete string to be inserted into the string of the
template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_insertion()) # doctest: +ELLIPSIS
<element name="arma_v1"
substitutionGroup="hpcb:sequenceGroup"
... | [
"Return",
"the",
"complete",
"string",
"to",
"be",
"inserted",
"into",
"the",
"string",
"of",
"the",
"template",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1606-L1658 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_modelinsertion | def get_modelinsertion(cls, model, indent) -> str:
"""Return the insertion string required for the given application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_modelinsert... | python | def get_modelinsertion(cls, model, indent) -> str:
"""Return the insertion string required for the given application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_modelinsert... | [
"def",
"get_modelinsertion",
"(",
"cls",
",",
"model",
",",
"indent",
")",
"->",
"str",
":",
"texts",
"=",
"[",
"]",
"for",
"name",
"in",
"(",
"'inputs'",
",",
"'fluxes'",
",",
"'states'",
")",
":",
"subsequences",
"=",
"getattr",
"(",
"model",
".",
... | Return the insertion string required for the given application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_modelinsertion(model, 1)) # doctest: +ELLIPSIS
<element nam... | [
"Return",
"the",
"insertion",
"string",
"required",
"for",
"the",
"given",
"application",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1661-L1692 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_subsequencesinsertion | def get_subsequencesinsertion(cls, subsequences, indent) -> str:
"""Return the insertion string required for the given group of
sequences.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XS... | python | def get_subsequencesinsertion(cls, subsequences, indent) -> str:
"""Return the insertion string required for the given group of
sequences.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XS... | [
"def",
"get_subsequencesinsertion",
"(",
"cls",
",",
"subsequences",
",",
"indent",
")",
"->",
"str",
":",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"lines",
"=",
"[",
"f'{blanks}<element name=\"{subsequences.name}\"'",
",",
"f'{blanks} minO... | Return the insertion string required for the given group of
sequences.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> from hydpy import prepare_model
>>> model = prepare_model('hland_v1')
>>> print(XSDWriter.get_subsequencesinsertion(
... model.sequences.fluxes, 1... | [
"Return",
"the",
"insertion",
"string",
"required",
"for",
"the",
"given",
"group",
"of",
"sequences",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1695-L1733 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_exchangeinsertion | def get_exchangeinsertion(cls):
"""Return the complete string related to the definition of exchange
items to be inserted into the string of the template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_exchangeinsertion()) # doctest: +ELLIPSIS
<... | python | def get_exchangeinsertion(cls):
"""Return the complete string related to the definition of exchange
items to be inserted into the string of the template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_exchangeinsertion()) # doctest: +ELLIPSIS
<... | [
"def",
"get_exchangeinsertion",
"(",
"cls",
")",
":",
"indent",
"=",
"1",
"subs",
"=",
"[",
"cls",
".",
"get_mathitemsinsertion",
"(",
"indent",
")",
"]",
"for",
"groupname",
"in",
"(",
"'setitems'",
",",
"'additems'",
",",
"'getitems'",
")",
":",
"subs",
... | Return the complete string related to the definition of exchange
items to be inserted into the string of the template file.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_exchangeinsertion()) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathitemType">
... | [
"Return",
"the",
"complete",
"string",
"related",
"to",
"the",
"definition",
"of",
"exchange",
"items",
"to",
"be",
"inserted",
"into",
"the",
"string",
"of",
"the",
"template",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1753-L1775 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_mathitemsinsertion | def get_mathitemsinsertion(cls, indent) -> str:
"""Return a string defining a model specific XML type extending
`ItemType`.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_mathitemsinsertion(1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathite... | python | def get_mathitemsinsertion(cls, indent) -> str:
"""Return a string defining a model specific XML type extending
`ItemType`.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_mathitemsinsertion(1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathite... | [
"def",
"get_mathitemsinsertion",
"(",
"cls",
",",
"indent",
")",
"->",
"str",
":",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"subs",
"=",
"[",
"]",
"for",
"modelname",
"in",
"cls",
".",
"get_modelnames",
"(",
")",
":",
"model",
"=",
... | Return a string defining a model specific XML type extending
`ItemType`.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_mathitemsinsertion(1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_mathitemType">
<complexContent>
... | [
"Return",
"a",
"string",
"defining",
"a",
"model",
"specific",
"XML",
"type",
"extending",
"ItemType",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1778-L1819 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_itemsinsertion | def get_itemsinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the XML element for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemsinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
... | python | def get_itemsinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the XML element for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemsinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
... | [
"def",
"get_itemsinsertion",
"(",
"cls",
",",
"itemgroup",
",",
"indent",
")",
"->",
"str",
":",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"subs",
"=",
"[",
"]",
"subs",
".",
"extend",
"(",
"[",
"f'{blanks}<element name=\"{itemgroup}\">'",
... | Return a string defining the XML element for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemsinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<element name="setitems">
<complexType>
... | [
"Return",
"a",
"string",
"defining",
"the",
"XML",
"element",
"for",
"the",
"given",
"exchange",
"item",
"group",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1826-L1884 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_itemtypesinsertion | def get_itemtypesinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the required types for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypesinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
... | python | def get_itemtypesinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the required types for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypesinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
... | [
"def",
"get_itemtypesinsertion",
"(",
"cls",
",",
"itemgroup",
",",
"indent",
")",
"->",
"str",
":",
"subs",
"=",
"[",
"]",
"for",
"modelname",
"in",
"cls",
".",
"get_modelnames",
"(",
")",
":",
"subs",
".",
"append",
"(",
"cls",
".",
"get_itemtypeinsert... | Return a string defining the required types for the given
exchange item group.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypesinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<complexType name="arma_v1_setitemsType">
...
... | [
"Return",
"a",
"string",
"defining",
"the",
"required",
"types",
"for",
"the",
"given",
"exchange",
"item",
"group",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1887-L1907 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_itemtypeinsertion | def get_itemtypeinsertion(cls, itemgroup, modelname, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypeinsertion(
... | python | def get_itemtypeinsertion(cls, itemgroup, modelname, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypeinsertion(
... | [
"def",
"get_itemtypeinsertion",
"(",
"cls",
",",
"itemgroup",
",",
"modelname",
",",
"indent",
")",
"->",
"str",
":",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"type_",
"=",
"cls",
".",
"_get_itemstype",
"(",
"modelname",
",",
"itemgroup",... | Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_itemtypeinsertion(
... 'setitems', 'hland_v1', 1)) # doctest: +ELLIPSIS
<com... | [
"Return",
"a",
"string",
"defining",
"the",
"required",
"types",
"for",
"the",
"given",
"combination",
"of",
"an",
"exchange",
"item",
"group",
"and",
"an",
"application",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1910-L1944 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_nodesitemtypeinsertion | def get_nodesitemtypeinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and |Node| objects.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_nodesitemtypeinsertion(
...... | python | def get_nodesitemtypeinsertion(cls, itemgroup, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and |Node| objects.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_nodesitemtypeinsertion(
...... | [
"def",
"get_nodesitemtypeinsertion",
"(",
"cls",
",",
"itemgroup",
",",
"indent",
")",
"->",
"str",
":",
"blanks",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"subs",
"=",
"[",
"f'{blanks}<complexType name=\"nodes_{itemgroup}Type\">'",
",",
"f'{blanks} <sequ... | Return a string defining the required types for the given
combination of an exchange item group and |Node| objects.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_nodesitemtypeinsertion(
... 'setitems', 1)) # doctest: +ELLIPSIS
<complexType name... | [
"Return",
"a",
"string",
"defining",
"the",
"required",
"types",
"for",
"the",
"given",
"combination",
"of",
"an",
"exchange",
"item",
"group",
"and",
"|Node|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L1947-L1999 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_subgroupsiteminsertion | def get_subgroupsiteminsertion(cls, itemgroup, modelname, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_subgroupsiteminser... | python | def get_subgroupsiteminsertion(cls, itemgroup, modelname, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_subgroupsiteminser... | [
"def",
"get_subgroupsiteminsertion",
"(",
"cls",
",",
"itemgroup",
",",
"modelname",
",",
"indent",
")",
"->",
"str",
":",
"subs",
"=",
"[",
"]",
"model",
"=",
"importtools",
".",
"prepare_model",
"(",
"modelname",
")",
"for",
"subvars",
"in",
"cls",
".",
... | Return a string defining the required types for the given
combination of an exchange item group and an application model.
>>> from hydpy.auxs.xmltools import XSDWriter
>>> print(XSDWriter.get_subgroupsiteminsertion(
... 'setitems', 'hland_v1', 1)) # doctest: +ELLIPSIS
... | [
"Return",
"a",
"string",
"defining",
"the",
"required",
"types",
"for",
"the",
"given",
"combination",
"of",
"an",
"exchange",
"item",
"group",
"and",
"an",
"application",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L2002-L2028 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XSDWriter.get_subgroupiteminsertion | def get_subgroupiteminsertion(
cls, itemgroup, model, subgroup, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and a specific variable
subgroup of an application model or class |Node|.
Note that for `setitem... | python | def get_subgroupiteminsertion(
cls, itemgroup, model, subgroup, indent) -> str:
"""Return a string defining the required types for the given
combination of an exchange item group and a specific variable
subgroup of an application model or class |Node|.
Note that for `setitem... | [
"def",
"get_subgroupiteminsertion",
"(",
"cls",
",",
"itemgroup",
",",
"model",
",",
"subgroup",
",",
"indent",
")",
"->",
"str",
":",
"blanks1",
"=",
"' '",
"*",
"(",
"indent",
"*",
"4",
")",
"blanks2",
"=",
"' '",
"*",
"(",
"(",
"indent",
"+",
"5",... | Return a string defining the required types for the given
combination of an exchange item group and a specific variable
subgroup of an application model or class |Node|.
Note that for `setitems` and `getitems` `setitemType` and
`getitemType` are referenced, respectively, and for all oth... | [
"Return",
"a",
"string",
"defining",
"the",
"required",
"types",
"for",
"the",
"given",
"combination",
"of",
"an",
"exchange",
"item",
"group",
"and",
"a",
"specific",
"variable",
"subgroup",
"of",
"an",
"application",
"model",
"or",
"class",
"|Node|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L2039-L2143 | train |
hydpy-dev/hydpy | hydpy/core/masktools.py | BaseMask.array2mask | def array2mask(cls, array=None, **kwargs):
"""Create a new mask object based on the given |numpy.ndarray|
and return it."""
kwargs['dtype'] = bool
if array is None:
return numpy.ndarray.__new__(cls, 0, **kwargs)
return numpy.asarray(array, **kwargs).view(cls) | python | def array2mask(cls, array=None, **kwargs):
"""Create a new mask object based on the given |numpy.ndarray|
and return it."""
kwargs['dtype'] = bool
if array is None:
return numpy.ndarray.__new__(cls, 0, **kwargs)
return numpy.asarray(array, **kwargs).view(cls) | [
"def",
"array2mask",
"(",
"cls",
",",
"array",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'dtype'",
"]",
"=",
"bool",
"if",
"array",
"is",
"None",
":",
"return",
"numpy",
".",
"ndarray",
".",
"__new__",
"(",
"cls",
",",
"0",
... | Create a new mask object based on the given |numpy.ndarray|
and return it. | [
"Create",
"a",
"new",
"mask",
"object",
"based",
"on",
"the",
"given",
"|numpy",
".",
"ndarray|",
"and",
"return",
"it",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/masktools.py#L37-L43 | train |
hydpy-dev/hydpy | hydpy/core/masktools.py | DefaultMask.new | def new(cls, variable, **kwargs):
"""Return a new |DefaultMask| object associated with the
given |Variable| object."""
return cls.array2mask(numpy.full(variable.shape, True)) | python | def new(cls, variable, **kwargs):
"""Return a new |DefaultMask| object associated with the
given |Variable| object."""
return cls.array2mask(numpy.full(variable.shape, True)) | [
"def",
"new",
"(",
"cls",
",",
"variable",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"cls",
".",
"array2mask",
"(",
"numpy",
".",
"full",
"(",
"variable",
".",
"shape",
",",
"True",
")",
")"
] | Return a new |DefaultMask| object associated with the
given |Variable| object. | [
"Return",
"a",
"new",
"|DefaultMask|",
"object",
"associated",
"with",
"the",
"given",
"|Variable|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/masktools.py#L149-L152 | train |
hydpy-dev/hydpy | hydpy/core/masktools.py | IndexMask.new | def new(cls, variable, **kwargs):
"""Return a new |IndexMask| object of the same shape as the
parameter referenced by |property| |IndexMask.refindices|.
Entries are only |True|, if the integer values of the
respective entries of the referenced parameter are contained
in the |Inde... | python | def new(cls, variable, **kwargs):
"""Return a new |IndexMask| object of the same shape as the
parameter referenced by |property| |IndexMask.refindices|.
Entries are only |True|, if the integer values of the
respective entries of the referenced parameter are contained
in the |Inde... | [
"def",
"new",
"(",
"cls",
",",
"variable",
",",
"*",
"*",
"kwargs",
")",
":",
"indices",
"=",
"cls",
".",
"get_refindices",
"(",
"variable",
")",
"if",
"numpy",
".",
"min",
"(",
"getattr",
"(",
"indices",
",",
"'values'",
",",
"0",
")",
")",
"<",
... | Return a new |IndexMask| object of the same shape as the
parameter referenced by |property| |IndexMask.refindices|.
Entries are only |True|, if the integer values of the
respective entries of the referenced parameter are contained
in the |IndexMask| class attribute tuple `RELEVANT_VALUES... | [
"Return",
"a",
"new",
"|IndexMask|",
"object",
"of",
"the",
"same",
"shape",
"as",
"the",
"parameter",
"referenced",
"by",
"|property|",
"|IndexMask",
".",
"refindices|",
".",
"Entries",
"are",
"only",
"|True|",
"if",
"the",
"integer",
"values",
"of",
"the",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/masktools.py#L169-L186 | train |
hydpy-dev/hydpy | hydpy/core/masktools.py | IndexMask.relevantindices | def relevantindices(self) -> List[int]:
"""A |list| of all currently relevant indices, calculated as an
intercection of the (constant) class attribute `RELEVANT_VALUES`
and the (variable) property |IndexMask.refindices|."""
return [idx for idx in numpy.unique(self.refindices.values)
... | python | def relevantindices(self) -> List[int]:
"""A |list| of all currently relevant indices, calculated as an
intercection of the (constant) class attribute `RELEVANT_VALUES`
and the (variable) property |IndexMask.refindices|."""
return [idx for idx in numpy.unique(self.refindices.values)
... | [
"def",
"relevantindices",
"(",
"self",
")",
"->",
"List",
"[",
"int",
"]",
":",
"return",
"[",
"idx",
"for",
"idx",
"in",
"numpy",
".",
"unique",
"(",
"self",
".",
"refindices",
".",
"values",
")",
"if",
"idx",
"in",
"self",
".",
"RELEVANT_VALUES",
"... | A |list| of all currently relevant indices, calculated as an
intercection of the (constant) class attribute `RELEVANT_VALUES`
and the (variable) property |IndexMask.refindices|. | [
"A",
"|list|",
"of",
"all",
"currently",
"relevant",
"indices",
"calculated",
"as",
"an",
"intercection",
"of",
"the",
"(",
"constant",
")",
"class",
"attribute",
"RELEVANT_VALUES",
"and",
"the",
"(",
"variable",
")",
"property",
"|IndexMask",
".",
"refindices|"... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/masktools.py#L220-L225 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qref_v1 | def calc_qref_v1(self):
"""Determine the reference discharge within the given space-time interval.
Required state sequences:
|QZ|
|QA|
Calculated flux sequence:
|QRef|
Basic equation:
:math:`QRef = \\frac{QZ_{new}+QZ_{old}+QA_{old}}{3}`
Example:
>>> from hydpy.mo... | python | def calc_qref_v1(self):
"""Determine the reference discharge within the given space-time interval.
Required state sequences:
|QZ|
|QA|
Calculated flux sequence:
|QRef|
Basic equation:
:math:`QRef = \\frac{QZ_{new}+QZ_{old}+QA_{old}}{3}`
Example:
>>> from hydpy.mo... | [
"def",
"calc_qref_v1",
"(",
"self",
")",
":",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"."... | Determine the reference discharge within the given space-time interval.
Required state sequences:
|QZ|
|QA|
Calculated flux sequence:
|QRef|
Basic equation:
:math:`QRef = \\frac{QZ_{new}+QZ_{old}+QA_{old}}{3}`
Example:
>>> from hydpy.models.lstream import *
>... | [
"Determine",
"the",
"reference",
"discharge",
"within",
"the",
"given",
"space",
"-",
"time",
"interval",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L15-L42 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_rk_v1 | def calc_rk_v1(self):
"""Determine the actual traveling time of the water (not of the wave!).
Required derived parameter:
|Sek|
Required flux sequences:
|AG|
|QRef|
Calculated flux sequence:
|RK|
Basic equation:
:math:`RK = \\frac{Laen \\cdot A}{QRef}`
Examples... | python | def calc_rk_v1(self):
"""Determine the actual traveling time of the water (not of the wave!).
Required derived parameter:
|Sek|
Required flux sequences:
|AG|
|QRef|
Calculated flux sequence:
|RK|
Basic equation:
:math:`RK = \\frac{Laen \\cdot A}{QRef}`
Examples... | [
"def",
"calc_rk_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"f... | Determine the actual traveling time of the water (not of the wave!).
Required derived parameter:
|Sek|
Required flux sequences:
|AG|
|QRef|
Calculated flux sequence:
|RK|
Basic equation:
:math:`RK = \\frac{Laen \\cdot A}{QRef}`
Examples:
First, note that t... | [
"Determine",
"the",
"actual",
"traveling",
"time",
"of",
"the",
"water",
"(",
"not",
"of",
"the",
"wave!",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L45-L97 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_am_um_v1 | def calc_am_um_v1(self):
"""Calculate the flown through area and the wetted perimeter
of the main channel.
Note that the main channel is assumed to have identical slopes on
both sides and that water flowing exactly above the main channel is
contributing to |AM|. Both theoretical surfaces seperatin... | python | def calc_am_um_v1(self):
"""Calculate the flown through area and the wetted perimeter
of the main channel.
Note that the main channel is assumed to have identical slopes on
both sides and that water flowing exactly above the main channel is
contributing to |AM|. Both theoretical surfaces seperatin... | [
"def",
"calc_am_um_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"if",
"flu",
".",
"h",
"<=",
"0.",
":",
"flu",
".",
"am",... | Calculate the flown through area and the wetted perimeter
of the main channel.
Note that the main channel is assumed to have identical slopes on
both sides and that water flowing exactly above the main channel is
contributing to |AM|. Both theoretical surfaces seperating water
above the main chann... | [
"Calculate",
"the",
"flown",
"through",
"area",
"and",
"the",
"wetted",
"perimeter",
"of",
"the",
"main",
"channel",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L100-L187 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qm_v1 | def calc_qm_v1(self):
"""Calculate the discharge of the main channel after Manning-Strickler.
Required control parameters:
|EKM|
|SKM|
|Gef|
Required flux sequence:
|AM|
|UM|
Calculated flux sequence:
|lstream_fluxes.QM|
Examples:
For appropriate stri... | python | def calc_qm_v1(self):
"""Calculate the discharge of the main channel after Manning-Strickler.
Required control parameters:
|EKM|
|SKM|
|Gef|
Required flux sequence:
|AM|
|UM|
Calculated flux sequence:
|lstream_fluxes.QM|
Examples:
For appropriate stri... | [
"def",
"calc_qm_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"if",
"(",
"flu",
".",
"am",
">",
"0.",
")",
"and",
"(",
"... | Calculate the discharge of the main channel after Manning-Strickler.
Required control parameters:
|EKM|
|SKM|
|Gef|
Required flux sequence:
|AM|
|UM|
Calculated flux sequence:
|lstream_fluxes.QM|
Examples:
For appropriate strictly positive values:
... | [
"Calculate",
"the",
"discharge",
"of",
"the",
"main",
"channel",
"after",
"Manning",
"-",
"Strickler",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L190-L240 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_av_uv_v1 | def calc_av_uv_v1(self):
"""Calculate the flown through area and the wetted perimeter of both
forelands.
Note that the each foreland lies between the main channel and one
outer embankment and that water flowing exactly above the a foreland
is contributing to |AV|. The theoretical surface seperatin... | python | def calc_av_uv_v1(self):
"""Calculate the flown through area and the wetted perimeter of both
forelands.
Note that the each foreland lies between the main channel and one
outer embankment and that water flowing exactly above the a foreland
is contributing to |AV|. The theoretical surface seperatin... | [
"def",
"calc_av_uv_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate the flown through area and the wetted perimeter of both
forelands.
Note that the each foreland lies between the main channel and one
outer embankment and that water flowing exactly above the a foreland
is contributing to |AV|. The theoretical surface seperating water
above the main chann... | [
"Calculate",
"the",
"flown",
"through",
"area",
"and",
"the",
"wetted",
"perimeter",
"of",
"both",
"forelands",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L243-L342 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qv_v1 | def calc_qv_v1(self):
"""Calculate the discharge of both forelands after Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AV|
|UV|
Calculated flux sequence:
|lstream_fluxes.QV|
Examples:
For appropriate strict... | python | def calc_qv_v1(self):
"""Calculate the discharge of both forelands after Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AV|
|UV|
Calculated flux sequence:
|lstream_fluxes.QV|
Examples:
For appropriate strict... | [
"def",
"calc_qv_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"i",
"in",
"range",
"(",
"2",
")",
":",
"if",
"(",
... | Calculate the discharge of both forelands after Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AV|
|UV|
Calculated flux sequence:
|lstream_fluxes.QV|
Examples:
For appropriate strictly positive values:
... | [
"Calculate",
"the",
"discharge",
"of",
"both",
"forelands",
"after",
"Manning",
"-",
"Strickler",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L345-L391 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_avr_uvr_v1 | def calc_avr_uvr_v1(self):
"""Calculate the flown through area and the wetted perimeter of both
outer embankments.
Note that each outer embankment lies beyond its foreland and that all
water flowing exactly above the a embankment is added to |AVR|.
The theoretical surface seperating water above the... | python | def calc_avr_uvr_v1(self):
"""Calculate the flown through area and the wetted perimeter of both
outer embankments.
Note that each outer embankment lies beyond its foreland and that all
water flowing exactly above the a embankment is added to |AVR|.
The theoretical surface seperating water above the... | [
"def",
"calc_avr_uvr_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",... | Calculate the flown through area and the wetted perimeter of both
outer embankments.
Note that each outer embankment lies beyond its foreland and that all
water flowing exactly above the a embankment is added to |AVR|.
The theoretical surface seperating water above the foreland from water
above its... | [
"Calculate",
"the",
"flown",
"through",
"area",
"and",
"the",
"wetted",
"perimeter",
"of",
"both",
"outer",
"embankments",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L394-L469 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qvr_v1 | def calc_qvr_v1(self):
"""Calculate the discharge of both outer embankments after
Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AVR|
|UVR|
Calculated flux sequence:
|QVR|
Examples:
For appropriate stric... | python | def calc_qvr_v1(self):
"""Calculate the discharge of both outer embankments after
Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AVR|
|UVR|
Calculated flux sequence:
|QVR|
Examples:
For appropriate stric... | [
"def",
"calc_qvr_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"i",
"in",
"range",
"(",
"2",
")",
":",
"if",
"(",
... | Calculate the discharge of both outer embankments after
Manning-Strickler.
Required control parameters:
|EKV|
|SKV|
|Gef|
Required flux sequence:
|AVR|
|UVR|
Calculated flux sequence:
|QVR|
Examples:
For appropriate strictly positive values:
... | [
"Calculate",
"the",
"discharge",
"of",
"both",
"outer",
"embankments",
"after",
"Manning",
"-",
"Strickler",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L472-L519 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_ag_v1 | def calc_ag_v1(self):
"""Sum the through flown area of the total cross section.
Required flux sequences:
|AM|
|AV|
|AVR|
Calculated flux sequence:
|AG|
Example:
>>> from hydpy.models.lstream import *
>>> parameterstep()
>>> fluxes.am = 1.0
>>> ... | python | def calc_ag_v1(self):
"""Sum the through flown area of the total cross section.
Required flux sequences:
|AM|
|AV|
|AVR|
Calculated flux sequence:
|AG|
Example:
>>> from hydpy.models.lstream import *
>>> parameterstep()
>>> fluxes.am = 1.0
>>> ... | [
"def",
"calc_ag_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"ag",
"=",
"flu",
".",
"am",
"+",
"flu",
".",
"av",
"[",
"0",
"]",
"+",
"flu",
".",
"av",
"[",
"1",
"]",
"+",
"flu... | Sum the through flown area of the total cross section.
Required flux sequences:
|AM|
|AV|
|AVR|
Calculated flux sequence:
|AG|
Example:
>>> from hydpy.models.lstream import *
>>> parameterstep()
>>> fluxes.am = 1.0
>>> fluxes.av= 2.0, 3.0
>... | [
"Sum",
"the",
"through",
"flown",
"area",
"of",
"the",
"total",
"cross",
"section",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L522-L545 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qg_v1 | def calc_qg_v1(self):
"""Calculate the discharge of the total cross section.
Method |calc_qg_v1| applies the actual versions of all methods for
calculating the flown through areas, wetted perimeters and discharges
of the different cross section compartments. Hence its requirements
might be differe... | python | def calc_qg_v1(self):
"""Calculate the discharge of the total cross section.
Method |calc_qg_v1| applies the actual versions of all methods for
calculating the flown through areas, wetted perimeters and discharges
of the different cross section compartments. Hence its requirements
might be differe... | [
"def",
"calc_qg_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"self",
".",
"calc_am_um",
"(",
")",
"self",
".",
"calc_qm",
"(",
")",
"self",
".",
"calc_av_uv",
"(",
")",
"self",
".",
"calc_qv",
"(... | Calculate the discharge of the total cross section.
Method |calc_qg_v1| applies the actual versions of all methods for
calculating the flown through areas, wetted perimeters and discharges
of the different cross section compartments. Hence its requirements
might be different for various application mo... | [
"Calculate",
"the",
"discharge",
"of",
"the",
"total",
"cross",
"section",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L548-L563 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_hmin_qmin_hmax_qmax_v1 | def calc_hmin_qmin_hmax_qmax_v1(self):
"""Determine an starting interval for iteration methods as the one
implemented in method |calc_h_v1|.
The resulting interval is determined in a manner, that on the
one hand :math:`Qmin \\leq QRef \\leq Qmax` is fulfilled and on the
other hand the results of me... | python | def calc_hmin_qmin_hmax_qmax_v1(self):
"""Determine an starting interval for iteration methods as the one
implemented in method |calc_h_v1|.
The resulting interval is determined in a manner, that on the
one hand :math:`Qmin \\leq QRef \\leq Qmax` is fulfilled and on the
other hand the results of me... | [
"def",
"calc_hmin_qmin_hmax_qmax_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"flu... | Determine an starting interval for iteration methods as the one
implemented in method |calc_h_v1|.
The resulting interval is determined in a manner, that on the
one hand :math:`Qmin \\leq QRef \\leq Qmax` is fulfilled and on the
other hand the results of method |calc_qg_v1| are continuous
for :math... | [
"Determine",
"an",
"starting",
"interval",
"for",
"iteration",
"methods",
"as",
"the",
"one",
"implemented",
"in",
"method",
"|calc_h_v1|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L566-L632 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_h_v1 | def calc_h_v1(self):
"""Approximate the water stage resulting in a certain reference discarge
with the Pegasus iteration method.
Required control parameters:
|QTol|
|HTol|
Required flux sequence:
|QRef|
Modified aide sequences:
|HMin|
|HMax|
|QMin|
|QMax|... | python | def calc_h_v1(self):
"""Approximate the water stage resulting in a certain reference discarge
with the Pegasus iteration method.
Required control parameters:
|QTol|
|HTol|
Required flux sequence:
|QRef|
Modified aide sequences:
|HMin|
|HMax|
|QMin|
|QMax|... | [
"def",
"calc_h_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
".",
"fasta... | Approximate the water stage resulting in a certain reference discarge
with the Pegasus iteration method.
Required control parameters:
|QTol|
|HTol|
Required flux sequence:
|QRef|
Modified aide sequences:
|HMin|
|HMax|
|QMin|
|QMax|
Calculated flux sequen... | [
"Approximate",
"the",
"water",
"stage",
"resulting",
"in",
"a",
"certain",
"reference",
"discarge",
"with",
"the",
"Pegasus",
"iteration",
"method",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L635-L875 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | calc_qa_v1 | def calc_qa_v1(self):
"""Calculate outflow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required flux sequence:
|RK|
Required state sequence:
|QZ|
Updated sta... | python | def calc_qa_v1(self):
"""Calculate outflow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required flux sequence:
|RK|
Required state sequence:
|QZ|
Updated sta... | [
"def",
"calc_qa_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"f... | Calculate outflow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required flux sequence:
|RK|
Required state sequence:
|QZ|
Updated state sequence:
|QA|
... | [
"Calculate",
"outflow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L878-L939 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | pick_q_v1 | def pick_q_v1(self):
"""Update inflow."""
sta = self.sequences.states.fastaccess
inl = self.sequences.inlets.fastaccess
sta.qz = 0.
for idx in range(inl.len_q):
sta.qz += inl.q[idx][0] | python | def pick_q_v1(self):
"""Update inflow."""
sta = self.sequences.states.fastaccess
inl = self.sequences.inlets.fastaccess
sta.qz = 0.
for idx in range(inl.len_q):
sta.qz += inl.q[idx][0] | [
"def",
"pick_q_v1",
"(",
"self",
")",
":",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"sta",
".",
"qz",
"=",
"0.",
"for",
"idx",
"in",
"range",
"(",
... | Update inflow. | [
"Update",
"inflow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L942-L948 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_model.py | pass_q_v1 | def pass_q_v1(self):
"""Update outflow."""
sta = self.sequences.states.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += sta.qa | python | def pass_q_v1(self):
"""Update outflow."""
sta = self.sequences.states.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += sta.qa | [
"def",
"pass_q_v1",
"(",
"self",
")",
":",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"q",
"[",
"0",
"]",
"+=",
"sta",
".",
"qa"
] | Update outflow. | [
"Update",
"outflow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_model.py#L951-L955 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_tc_v1 | def calc_tc_v1(self):
"""Adjust the measured air temperature to the altitude of the
individual zones.
Required control parameters:
|NmbZones|
|TCAlt|
|ZoneZ|
|ZRelT|
Required input sequence:
|hland_inputs.T|
Calculated flux sequences:
|TC|
Basic equation:
... | python | def calc_tc_v1(self):
"""Adjust the measured air temperature to the altitude of the
individual zones.
Required control parameters:
|NmbZones|
|TCAlt|
|ZoneZ|
|ZRelT|
Required input sequence:
|hland_inputs.T|
Calculated flux sequences:
|TC|
Basic equation:
... | [
"def",
"calc_tc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fas... | Adjust the measured air temperature to the altitude of the
individual zones.
Required control parameters:
|NmbZones|
|TCAlt|
|ZoneZ|
|ZRelT|
Required input sequence:
|hland_inputs.T|
Calculated flux sequences:
|TC|
Basic equation:
:math:`TC = T - TCAlt \... | [
"Adjust",
"the",
"measured",
"air",
"temperature",
"to",
"the",
"altitude",
"of",
"the",
"individual",
"zones",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L13-L57 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_tmean_v1 | def calc_tmean_v1(self):
"""Calculate the areal mean temperature of the subbasin.
Required derived parameter:
|RelZoneArea|
Required flux sequence:
|TC|
Calculated flux sequences:
|TMean|
Examples:
Prepare two zones, the first one being twice as large
as the se... | python | def calc_tmean_v1(self):
"""Calculate the areal mean temperature of the subbasin.
Required derived parameter:
|RelZoneArea|
Required flux sequence:
|TC|
Calculated flux sequences:
|TMean|
Examples:
Prepare two zones, the first one being twice as large
as the se... | [
"def",
"calc_tmean_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate the areal mean temperature of the subbasin.
Required derived parameter:
|RelZoneArea|
Required flux sequence:
|TC|
Calculated flux sequences:
|TMean|
Examples:
Prepare two zones, the first one being twice as large
as the second one:
>>> from hydp... | [
"Calculate",
"the",
"areal",
"mean",
"temperature",
"of",
"the",
"subbasin",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L60-L95 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_fracrain_v1 | def calc_fracrain_v1(self):
"""Determine the temperature-dependent fraction of (liquid) rainfall
and (total) precipitation.
Required control parameters:
|NmbZones|
|TT|,
|TTInt|
Required flux sequence:
|TC|
Calculated flux sequences:
|FracRain|
Basic equation:
... | python | def calc_fracrain_v1(self):
"""Determine the temperature-dependent fraction of (liquid) rainfall
and (total) precipitation.
Required control parameters:
|NmbZones|
|TT|,
|TTInt|
Required flux sequence:
|TC|
Calculated flux sequences:
|FracRain|
Basic equation:
... | [
"def",
"calc_fracrain_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"k",
"in",
"range",
"(",
"con",
".",
"nmbzones",
... | Determine the temperature-dependent fraction of (liquid) rainfall
and (total) precipitation.
Required control parameters:
|NmbZones|
|TT|,
|TTInt|
Required flux sequence:
|TC|
Calculated flux sequences:
|FracRain|
Basic equation:
:math:`FracRain = \\frac{TC-(T... | [
"Determine",
"the",
"temperature",
"-",
"dependent",
"fraction",
"of",
"(",
"liquid",
")",
"rainfall",
"and",
"(",
"total",
")",
"precipitation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L98-L156 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_rfc_sfc_v1 | def calc_rfc_sfc_v1(self):
"""Calculate the corrected fractions rainfall/snowfall and total
precipitation.
Required control parameters:
|NmbZones|
|RfCF|
|SfCF|
Calculated flux sequences:
|RfC|
|SfC|
Basic equations:
:math:`RfC = RfCF \\cdot FracRain` \n
... | python | def calc_rfc_sfc_v1(self):
"""Calculate the corrected fractions rainfall/snowfall and total
precipitation.
Required control parameters:
|NmbZones|
|RfCF|
|SfCF|
Calculated flux sequences:
|RfC|
|SfC|
Basic equations:
:math:`RfC = RfCF \\cdot FracRain` \n
... | [
"def",
"calc_rfc_sfc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"k",
"in",
"range",
"(",
"con",
".",
"nmbzones",
"... | Calculate the corrected fractions rainfall/snowfall and total
precipitation.
Required control parameters:
|NmbZones|
|RfCF|
|SfCF|
Calculated flux sequences:
|RfC|
|SfC|
Basic equations:
:math:`RfC = RfCF \\cdot FracRain` \n
:math:`SfC = SfCF \\cdot (1 - Frac... | [
"Calculate",
"the",
"corrected",
"fractions",
"rainfall",
"/",
"snowfall",
"and",
"total",
"precipitation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L159-L214 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_pc_v1 | def calc_pc_v1(self):
"""Apply the precipitation correction factors and adjust precipitation
to the altitude of the individual zones.
Required control parameters:
|NmbZones|
|PCorr|
|PCAlt|
|ZoneZ|
|ZRelP|
Required input sequence:
|P|
Required flux sequences:
... | python | def calc_pc_v1(self):
"""Apply the precipitation correction factors and adjust precipitation
to the altitude of the individual zones.
Required control parameters:
|NmbZones|
|PCorr|
|PCAlt|
|ZoneZ|
|ZRelP|
Required input sequence:
|P|
Required flux sequences:
... | [
"def",
"calc_pc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fas... | Apply the precipitation correction factors and adjust precipitation
to the altitude of the individual zones.
Required control parameters:
|NmbZones|
|PCorr|
|PCAlt|
|ZoneZ|
|ZRelP|
Required input sequence:
|P|
Required flux sequences:
|RfC|
|SfC|
C... | [
"Apply",
"the",
"precipitation",
"correction",
"factors",
"and",
"adjust",
"precipitation",
"to",
"the",
"altitude",
"of",
"the",
"individual",
"zones",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L217-L290 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_ep_v1 | def calc_ep_v1(self):
"""Adjust potential norm evaporation to the actual temperature.
Required control parameters:
|NmbZones|
|ETF|
Required input sequence:
|EPN|
|TN|
Required flux sequence:
|TMean|
Calculated flux sequences:
|EP|
Basic equation:
:... | python | def calc_ep_v1(self):
"""Adjust potential norm evaporation to the actual temperature.
Required control parameters:
|NmbZones|
|ETF|
Required input sequence:
|EPN|
|TN|
Required flux sequence:
|TMean|
Calculated flux sequences:
|EP|
Basic equation:
:... | [
"def",
"calc_ep_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fas... | Adjust potential norm evaporation to the actual temperature.
Required control parameters:
|NmbZones|
|ETF|
Required input sequence:
|EPN|
|TN|
Required flux sequence:
|TMean|
Calculated flux sequences:
|EP|
Basic equation:
:math:`EP = EPN \\cdot (1 + ET... | [
"Adjust",
"potential",
"norm",
"evaporation",
"to",
"the",
"actual",
"temperature",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L293-L355 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_epc_v1 | def calc_epc_v1(self):
"""Apply the evaporation correction factors and adjust evaporation
to the altitude of the individual zones.
Calculate the areal mean of (uncorrected) potential evaporation
for the subbasin, adjust it to the individual zones in accordance
with their heights and perform some co... | python | def calc_epc_v1(self):
"""Apply the evaporation correction factors and adjust evaporation
to the altitude of the individual zones.
Calculate the areal mean of (uncorrected) potential evaporation
for the subbasin, adjust it to the individual zones in accordance
with their heights and perform some co... | [
"def",
"calc_epc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"k",
"in",
"range",
"(",
"con",
".",
"nmbzones",
")",
... | Apply the evaporation correction factors and adjust evaporation
to the altitude of the individual zones.
Calculate the areal mean of (uncorrected) potential evaporation
for the subbasin, adjust it to the individual zones in accordance
with their heights and perform some corrections, among which one
... | [
"Apply",
"the",
"evaporation",
"correction",
"factors",
"and",
"adjust",
"evaporation",
"to",
"the",
"altitude",
"of",
"the",
"individual",
"zones",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L358-L434 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_tf_ic_v1 | def calc_tf_ic_v1(self):
"""Calculate throughfall and update the interception storage
accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
|IcMax|
Required flux sequences:
|PC|
Calculated fluxes sequences:
|TF|
Updated state sequence:
|Ic|
... | python | def calc_tf_ic_v1(self):
"""Calculate throughfall and update the interception storage
accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
|IcMax|
Required flux sequences:
|PC|
Calculated fluxes sequences:
|TF|
Updated state sequence:
|Ic|
... | [
"def",
"calc_tf_ic_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate throughfall and update the interception storage
accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
|IcMax|
Required flux sequences:
|PC|
Calculated fluxes sequences:
|TF|
Updated state sequence:
|Ic|
Basic equation:
:math:`TF ... | [
"Calculate",
"throughfall",
"and",
"update",
"the",
"interception",
"storage",
"accordingly",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L437-L523 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_ei_ic_v1 | def calc_ei_ic_v1(self):
"""Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|EPC|
Calculated fluxes sequences:
|EI|
Updated state sequence:
|Ic|
... | python | def calc_ei_ic_v1(self):
"""Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|EPC|
Calculated fluxes sequences:
|EI|
Updated state sequence:
|Ic|
... | [
"def",
"calc_ei_ic_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|EPC|
Calculated fluxes sequences:
|EI|
Updated state sequence:
|Ic|
Basic equation:
:math:`EI ... | [
"Calculate",
"interception",
"evaporation",
"and",
"update",
"the",
"interception",
"storage",
"accordingly",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L526-L608 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_sp_wc_v1 | def calc_sp_wc_v1(self):
"""Add throughfall to the snow layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|TF|
|RfC|
|SfC|
Updated state sequences:
|WC|
|SP|
Basic equations:
:math:`\\frac{dSP}{dt} = TF \\cdot \\fra... | python | def calc_sp_wc_v1(self):
"""Add throughfall to the snow layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|TF|
|RfC|
|SfC|
Updated state sequences:
|WC|
|SP|
Basic equations:
:math:`\\frac{dSP}{dt} = TF \\cdot \\fra... | [
"def",
"calc_sp_wc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Add throughfall to the snow layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required flux sequences:
|TF|
|RfC|
|SfC|
Updated state sequences:
|WC|
|SP|
Basic equations:
:math:`\\frac{dSP}{dt} = TF \\cdot \\frac{SfC}{SfC+RfC}` \n
:math:... | [
"Add",
"throughfall",
"to",
"the",
"snow",
"layer",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L611-L684 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_refr_sp_wc_v1 | def calc_refr_sp_wc_v1(self):
"""Calculate refreezing of the water content within the snow layer and
update both the snow layers ice and the water content.
Required control parameters:
|NmbZones|
|ZoneType|
|CFMax|
|CFR|
Required derived parameter:
|TTM|
Required flu... | python | def calc_refr_sp_wc_v1(self):
"""Calculate refreezing of the water content within the snow layer and
update both the snow layers ice and the water content.
Required control parameters:
|NmbZones|
|ZoneType|
|CFMax|
|CFR|
Required derived parameter:
|TTM|
Required flu... | [
"def",
"calc_refr_sp_wc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"... | Calculate refreezing of the water content within the snow layer and
update both the snow layers ice and the water content.
Required control parameters:
|NmbZones|
|ZoneType|
|CFMax|
|CFR|
Required derived parameter:
|TTM|
Required flux sequences:
|TC|
Calculat... | [
"Calculate",
"refreezing",
"of",
"the",
"water",
"content",
"within",
"the",
"snow",
"layer",
"and",
"update",
"both",
"the",
"snow",
"layers",
"ice",
"and",
"the",
"water",
"content",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L804-L940 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_in_wc_v1 | def calc_in_wc_v1(self):
"""Calculate the actual water release from the snow layer due to the
exceedance of the snow layers capacity for (liquid) water.
Required control parameters:
|NmbZones|
|ZoneType|
|WHC|
Required state sequence:
|SP|
Required flux sequence
|TF|... | python | def calc_in_wc_v1(self):
"""Calculate the actual water release from the snow layer due to the
exceedance of the snow layers capacity for (liquid) water.
Required control parameters:
|NmbZones|
|ZoneType|
|WHC|
Required state sequence:
|SP|
Required flux sequence
|TF|... | [
"def",
"calc_in_wc_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate the actual water release from the snow layer due to the
exceedance of the snow layers capacity for (liquid) water.
Required control parameters:
|NmbZones|
|ZoneType|
|WHC|
Required state sequence:
|SP|
Required flux sequence
|TF|
Calculated fluxes sequence... | [
"Calculate",
"the",
"actual",
"water",
"release",
"from",
"the",
"snow",
"layer",
"due",
"to",
"the",
"exceedance",
"of",
"the",
"snow",
"layers",
"capacity",
"for",
"(",
"liquid",
")",
"water",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L943-L1031 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_glmelt_in_v1 | def calc_glmelt_in_v1(self):
"""Calculate melting from glaciers which are actually not covered by
a snow layer and add it to the water release of the snow module.
Required control parameters:
|NmbZones|
|ZoneType|
|GMelt|
Required state sequence:
|SP|
Required flux sequenc... | python | def calc_glmelt_in_v1(self):
"""Calculate melting from glaciers which are actually not covered by
a snow layer and add it to the water release of the snow module.
Required control parameters:
|NmbZones|
|ZoneType|
|GMelt|
Required state sequence:
|SP|
Required flux sequenc... | [
"def",
"calc_glmelt_in_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".... | Calculate melting from glaciers which are actually not covered by
a snow layer and add it to the water release of the snow module.
Required control parameters:
|NmbZones|
|ZoneType|
|GMelt|
Required state sequence:
|SP|
Required flux sequence:
|TC|
Calculated fluxes... | [
"Calculate",
"melting",
"from",
"glaciers",
"which",
"are",
"actually",
"not",
"covered",
"by",
"a",
"snow",
"layer",
"and",
"add",
"it",
"to",
"the",
"water",
"release",
"of",
"the",
"snow",
"module",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1034-L1107 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_r_sm_v1 | def calc_r_sm_v1(self):
"""Calculate effective precipitation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|Beta|
Required fluxes sequence:
|In_|
Calculated flux sequence:
|R|
Updated state sequence:
|SM|
Basic eq... | python | def calc_r_sm_v1(self):
"""Calculate effective precipitation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|Beta|
Required fluxes sequence:
|In_|
Calculated flux sequence:
|R|
Updated state sequence:
|SM|
Basic eq... | [
"def",
"calc_r_sm_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"f... | Calculate effective precipitation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|Beta|
Required fluxes sequence:
|In_|
Calculated flux sequence:
|R|
Updated state sequence:
|SM|
Basic equations:
:math:`\\frac{dS... | [
"Calculate",
"effective",
"precipitation",
"and",
"update",
"soil",
"moisture",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1110-L1199 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_cf_sm_v1 | def calc_cf_sm_v1(self):
"""Calculate capillary flow and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|CFlux|
Required fluxes sequence:
|R|
Required state sequence:
|UZ|
Calculated flux sequence:
|CF|
Updated state s... | python | def calc_cf_sm_v1(self):
"""Calculate capillary flow and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|CFlux|
Required fluxes sequence:
|R|
Required state sequence:
|UZ|
Calculated flux sequence:
|CF|
Updated state s... | [
"def",
"calc_cf_sm_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate capillary flow and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|CFlux|
Required fluxes sequence:
|R|
Required state sequence:
|UZ|
Calculated flux sequence:
|CF|
Updated state sequence:
|SM|
Basic e... | [
"Calculate",
"capillary",
"flow",
"and",
"update",
"soil",
"moisture",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1202-L1341 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_ea_sm_v1 | def calc_ea_sm_v1(self):
"""Calculate soil evaporation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|LP|
|ERed|
Required fluxes sequences:
|EPC|
|EI|
Required state sequence:
|SP|
Calculated flux sequence:
... | python | def calc_ea_sm_v1(self):
"""Calculate soil evaporation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|LP|
|ERed|
Required fluxes sequences:
|EPC|
|EI|
Required state sequence:
|SP|
Calculated flux sequence:
... | [
"def",
"calc_ea_sm_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate soil evaporation and update soil moisture.
Required control parameters:
|NmbZones|
|ZoneType|
|FC|
|LP|
|ERed|
Required fluxes sequences:
|EPC|
|EI|
Required state sequence:
|SP|
Calculated flux sequence:
|EA|
Updated state sequenc... | [
"Calculate",
"soil",
"evaporation",
"and",
"update",
"soil",
"moisture",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1344-L1473 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_inuz_v1 | def calc_inuz_v1(self):
"""Accumulate the total inflow into the upper zone layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandZoneArea|
Required fluxes sequences:
|R|
|CF|
Calculated flux sequence:
|InUZ|
Basic ... | python | def calc_inuz_v1(self):
"""Accumulate the total inflow into the upper zone layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandZoneArea|
Required fluxes sequences:
|R|
|CF|
Calculated flux sequence:
|InUZ|
Basic ... | [
"def",
"calc_inuz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Accumulate the total inflow into the upper zone layer.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandZoneArea|
Required fluxes sequences:
|R|
|CF|
Calculated flux sequence:
|InUZ|
Basic equation:
:math:`InUZ = R... | [
"Accumulate",
"the",
"total",
"inflow",
"into",
"the",
"upper",
"zone",
"layer",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1476-L1528 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_contriarea_v1 | def calc_contriarea_v1(self):
"""Determine the relative size of the contributing area of the whole
subbasin.
Required control parameters:
|NmbZones|
|ZoneType|
|RespArea|
|FC|
|Beta|
Required derived parameter:
|RelSoilArea|
Required state sequence:
|SM|
... | python | def calc_contriarea_v1(self):
"""Determine the relative size of the contributing area of the whole
subbasin.
Required control parameters:
|NmbZones|
|ZoneType|
|RespArea|
|FC|
|Beta|
Required derived parameter:
|RelSoilArea|
Required state sequence:
|SM|
... | [
"def",
"calc_contriarea_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"... | Determine the relative size of the contributing area of the whole
subbasin.
Required control parameters:
|NmbZones|
|ZoneType|
|RespArea|
|FC|
|Beta|
Required derived parameter:
|RelSoilArea|
Required state sequence:
|SM|
Calculated fluxes sequences:
... | [
"Determine",
"the",
"relative",
"size",
"of",
"the",
"contributing",
"area",
"of",
"the",
"whole",
"subbasin",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1531-L1635 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_q0_perc_uz_v1 | def calc_q0_perc_uz_v1(self):
"""Perform the upper zone layer routine which determines percolation
to the lower zone layer and the fast response of the hland model.
Note that the system behaviour of this method depends strongly on the
specifications of the options |RespArea| and |RecStep|.
Required... | python | def calc_q0_perc_uz_v1(self):
"""Perform the upper zone layer routine which determines percolation
to the lower zone layer and the fast response of the hland model.
Note that the system behaviour of this method depends strongly on the
specifications of the options |RespArea| and |RecStep|.
Required... | [
"def",
"calc_q0_perc_uz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"... | Perform the upper zone layer routine which determines percolation
to the lower zone layer and the fast response of the hland model.
Note that the system behaviour of this method depends strongly on the
specifications of the options |RespArea| and |RecStep|.
Required control parameters:
|RecStep|
... | [
"Perform",
"the",
"upper",
"zone",
"layer",
"routine",
"which",
"determines",
"percolation",
"to",
"the",
"lower",
"zone",
"layer",
"and",
"the",
"fast",
"response",
"of",
"the",
"hland",
"model",
".",
"Note",
"that",
"the",
"system",
"behaviour",
"of",
"thi... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1638-L1821 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_lz_v1 | def calc_lz_v1(self):
"""Update the lower zone layer in accordance with percolation from
upper groundwater to lower groundwater and/or in accordance with
lake precipitation.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandArea|
|RelZo... | python | def calc_lz_v1(self):
"""Update the lower zone layer in accordance with percolation from
upper groundwater to lower groundwater and/or in accordance with
lake precipitation.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandArea|
|RelZo... | [
"def",
"calc_lz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"f... | Update the lower zone layer in accordance with percolation from
upper groundwater to lower groundwater and/or in accordance with
lake precipitation.
Required control parameters:
|NmbZones|
|ZoneType|
Required derived parameters:
|RelLandArea|
|RelZoneArea|
Required fluxes ... | [
"Update",
"the",
"lower",
"zone",
"layer",
"in",
"accordance",
"with",
"percolation",
"from",
"upper",
"groundwater",
"to",
"lower",
"groundwater",
"and",
"/",
"or",
"in",
"accordance",
"with",
"lake",
"precipitation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1824-L1892 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_el_lz_v1 | def calc_el_lz_v1(self):
"""Calculate lake evaporation.
Required control parameters:
|NmbZones|
|ZoneType|
|TTIce|
Required derived parameters:
|RelZoneArea|
Required fluxes sequences:
|TC|
|EPC|
Updated state sequence:
|LZ|
Basic equa... | python | def calc_el_lz_v1(self):
"""Calculate lake evaporation.
Required control parameters:
|NmbZones|
|ZoneType|
|TTIce|
Required derived parameters:
|RelZoneArea|
Required fluxes sequences:
|TC|
|EPC|
Updated state sequence:
|LZ|
Basic equa... | [
"def",
"calc_el_lz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate lake evaporation.
Required control parameters:
|NmbZones|
|ZoneType|
|TTIce|
Required derived parameters:
|RelZoneArea|
Required fluxes sequences:
|TC|
|EPC|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ... | [
"Calculate",
"lake",
"evaporation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1895-L1966 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_q1_lz_v1 | def calc_q1_lz_v1(self):
"""Calculate the slow response of the lower zone layer.
Required control parameters:
|K4|
|Gamma|
Calculated fluxes sequence:
|Q1|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ}{dt} = -Q1` \n
:math:`Q1 = \... | python | def calc_q1_lz_v1(self):
"""Calculate the slow response of the lower zone layer.
Required control parameters:
|K4|
|Gamma|
Calculated fluxes sequence:
|Q1|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ}{dt} = -Q1` \n
:math:`Q1 = \... | [
"def",
"calc_q1_lz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Calculate the slow response of the lower zone layer.
Required control parameters:
|K4|
|Gamma|
Calculated fluxes sequence:
|Q1|
Updated state sequence:
|LZ|
Basic equations:
:math:`\\frac{dLZ}{dt} = -Q1` \n
:math:`Q1 = \\Bigl \\lbrace
{
... | [
"Calculate",
"the",
"slow",
"response",
"of",
"the",
"lower",
"zone",
"layer",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L1969-L2051 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_inuh_v1 | def calc_inuh_v1(self):
"""Calculate the unit hydrograph input.
Required derived parameters:
|RelLandArea|
Required flux sequences:
|Q0|
|Q1|
Calculated flux sequence:
|InUH|
Basic equation:
:math:`InUH = Q0 + Q1`
Example:
The unit hydrographs receiv... | python | def calc_inuh_v1(self):
"""Calculate the unit hydrograph input.
Required derived parameters:
|RelLandArea|
Required flux sequences:
|Q0|
|Q1|
Calculated flux sequence:
|InUH|
Basic equation:
:math:`InUH = Q0 + Q1`
Example:
The unit hydrographs receiv... | [
"def",
"calc_inuh_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"inuh",
"=",
"der",
".",
"rellandarea",
"*",
"fl... | Calculate the unit hydrograph input.
Required derived parameters:
|RelLandArea|
Required flux sequences:
|Q0|
|Q1|
Calculated flux sequence:
|InUH|
Basic equation:
:math:`InUH = Q0 + Q1`
Example:
The unit hydrographs receives base flow from the whole sub... | [
"Calculate",
"the",
"unit",
"hydrograph",
"input",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L2054-L2089 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_outuh_quh_v1 | def calc_outuh_quh_v1(self):
"""Calculate the unit hydrograph output (convolution).
Required derived parameters:
|UH|
Required flux sequences:
|Q0|
|Q1|
|InUH|
Updated log sequence:
|QUH|
Calculated flux sequence:
|OutUH|
Examples:
Pr... | python | def calc_outuh_quh_v1(self):
"""Calculate the unit hydrograph output (convolution).
Required derived parameters:
|UH|
Required flux sequences:
|Q0|
|Q1|
|InUH|
Updated log sequence:
|QUH|
Calculated flux sequence:
|OutUH|
Examples:
Pr... | [
"def",
"calc_outuh_quh_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
... | Calculate the unit hydrograph output (convolution).
Required derived parameters:
|UH|
Required flux sequences:
|Q0|
|Q1|
|InUH|
Updated log sequence:
|QUH|
Calculated flux sequence:
|OutUH|
Examples:
Prepare a unit hydrograph with only th... | [
"Calculate",
"the",
"unit",
"hydrograph",
"output",
"(",
"convolution",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L2092-L2181 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_model.py | calc_qt_v1 | def calc_qt_v1(self):
"""Calculate the total discharge after possible abstractions.
Required control parameter:
|Abstr|
Required flux sequence:
|OutUH|
Calculated flux sequence:
|QT|
Basic equation:
:math:`QT = max(OutUH - Abstr, 0)`
Examples:
Trying to ab... | python | def calc_qt_v1(self):
"""Calculate the total discharge after possible abstractions.
Required control parameter:
|Abstr|
Required flux sequence:
|OutUH|
Calculated flux sequence:
|QT|
Basic equation:
:math:`QT = max(OutUH - Abstr, 0)`
Examples:
Trying to ab... | [
"def",
"calc_qt_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"qt",
"=",
"max",
"(",
"flu",
".",
"outuh",
"-",... | Calculate the total discharge after possible abstractions.
Required control parameter:
|Abstr|
Required flux sequence:
|OutUH|
Calculated flux sequence:
|QT|
Basic equation:
:math:`QT = max(OutUH - Abstr, 0)`
Examples:
Trying to abstract less then available, a... | [
"Calculate",
"the",
"total",
"discharge",
"after",
"possible",
"abstractions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_model.py#L2184-L2231 | train |
hydpy-dev/hydpy | hydpy/core/auxfiletools.py | Auxfiler.save | def save(self, parameterstep=None, simulationstep=None):
"""Save all defined auxiliary control files.
The target path is taken from the |ControlManager| object stored
in module |pub|. Hence we initialize one and override its
|property| `currentpath` with a simple |str| object defining ... | python | def save(self, parameterstep=None, simulationstep=None):
"""Save all defined auxiliary control files.
The target path is taken from the |ControlManager| object stored
in module |pub|. Hence we initialize one and override its
|property| `currentpath` with a simple |str| object defining ... | [
"def",
"save",
"(",
"self",
",",
"parameterstep",
"=",
"None",
",",
"simulationstep",
"=",
"None",
")",
":",
"par",
"=",
"parametertools",
".",
"Parameter",
"for",
"(",
"modelname",
",",
"var2aux",
")",
"in",
"self",
":",
"for",
"filename",
"in",
"var2au... | Save all defined auxiliary control files.
The target path is taken from the |ControlManager| object stored
in module |pub|. Hence we initialize one and override its
|property| `currentpath` with a simple |str| object defining the
test target path:
>>> from hydpy import pub
... | [
"Save",
"all",
"defined",
"auxiliary",
"control",
"files",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/auxfiletools.py#L235-L297 | train |
hydpy-dev/hydpy | hydpy/core/auxfiletools.py | Variable2Auxfile.remove | def remove(self, *values):
"""Remove the defined variables.
The variables to be removed can be selected in two ways. But the
first example shows that passing nothing or an empty iterable to
method |Variable2Auxfile.remove| does not remove any variable:
>>> from hydpy import du... | python | def remove(self, *values):
"""Remove the defined variables.
The variables to be removed can be selected in two ways. But the
first example shows that passing nothing or an empty iterable to
method |Variable2Auxfile.remove| does not remove any variable:
>>> from hydpy import du... | [
"def",
"remove",
"(",
"self",
",",
"*",
"values",
")",
":",
"for",
"value",
"in",
"objecttools",
".",
"extract",
"(",
"values",
",",
"(",
"str",
",",
"variabletools",
".",
"Variable",
")",
")",
":",
"try",
":",
"deleted_something",
"=",
"False",
"for",... | Remove the defined variables.
The variables to be removed can be selected in two ways. But the
first example shows that passing nothing or an empty iterable to
method |Variable2Auxfile.remove| does not remove any variable:
>>> from hydpy import dummies
>>> v2af = dummies.v2af
... | [
"Remove",
"the",
"defined",
"variables",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/auxfiletools.py#L473-L546 | train |
hydpy-dev/hydpy | hydpy/core/auxfiletools.py | Variable2Auxfile.filenames | def filenames(self):
"""A list of all handled auxiliary file names.
>>> from hydpy import dummies
>>> dummies.v2af.filenames
['file1', 'file2']
"""
fns = set()
for fn2var in self._type2filename2variable.values():
fns.update(fn2var.keys())
retu... | python | def filenames(self):
"""A list of all handled auxiliary file names.
>>> from hydpy import dummies
>>> dummies.v2af.filenames
['file1', 'file2']
"""
fns = set()
for fn2var in self._type2filename2variable.values():
fns.update(fn2var.keys())
retu... | [
"def",
"filenames",
"(",
"self",
")",
":",
"fns",
"=",
"set",
"(",
")",
"for",
"fn2var",
"in",
"self",
".",
"_type2filename2variable",
".",
"values",
"(",
")",
":",
"fns",
".",
"update",
"(",
"fn2var",
".",
"keys",
"(",
")",
")",
"return",
"sorted",
... | A list of all handled auxiliary file names.
>>> from hydpy import dummies
>>> dummies.v2af.filenames
['file1', 'file2'] | [
"A",
"list",
"of",
"all",
"handled",
"auxiliary",
"file",
"names",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/auxfiletools.py#L560-L570 | train |
hydpy-dev/hydpy | hydpy/core/auxfiletools.py | Variable2Auxfile.get_filename | def get_filename(self, variable):
"""Return the auxiliary file name the given variable is allocated
to or |None| if the given variable is not allocated to any
auxiliary file name.
>>> from hydpy import dummies
>>> eqb = dummies.v2af.eqb[0]
>>> dummies.v2af.get_filename(e... | python | def get_filename(self, variable):
"""Return the auxiliary file name the given variable is allocated
to or |None| if the given variable is not allocated to any
auxiliary file name.
>>> from hydpy import dummies
>>> eqb = dummies.v2af.eqb[0]
>>> dummies.v2af.get_filename(e... | [
"def",
"get_filename",
"(",
"self",
",",
"variable",
")",
":",
"fn2var",
"=",
"self",
".",
"_type2filename2variable",
".",
"get",
"(",
"type",
"(",
"variable",
")",
",",
"{",
"}",
")",
"for",
"(",
"fn_",
",",
"var",
")",
"in",
"fn2var",
".",
"items",... | Return the auxiliary file name the given variable is allocated
to or |None| if the given variable is not allocated to any
auxiliary file name.
>>> from hydpy import dummies
>>> eqb = dummies.v2af.eqb[0]
>>> dummies.v2af.get_filename(eqb)
'file1'
>>> eqb += 500.0
... | [
"Return",
"the",
"auxiliary",
"file",
"name",
"the",
"given",
"variable",
"is",
"allocated",
"to",
"or",
"|None|",
"if",
"the",
"given",
"variable",
"is",
"not",
"allocated",
"to",
"any",
"auxiliary",
"file",
"name",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/auxfiletools.py#L595-L611 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_derived.py | RemoteDischargeSmoothPar.update | def update(self):
"""Calculate the smoothing parameter values.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy import pub
>>> pub.timegrids = '2000.01.01', '2000.01.03', '1d'
>>> from hydpy.models.dam import *
>>> parame... | python | def update(self):
"""Calculate the smoothing parameter values.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy import pub
>>> pub.timegrids = '2000.01.01', '2000.01.03', '1d'
>>> from hydpy.models.dam import *
>>> parame... | [
"def",
"update",
"(",
"self",
")",
":",
"metapar",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"remotedischargesafety",
"self",
".",
"shape",
"=",
"metapar",
".",
"shape",
"self",
"(",
"tuple",
"(",
"smoothtools",
".",
"calc_smoothpar_lo... | Calculate the smoothing parameter values.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy import pub
>>> pub.timegrids = '2000.01.01', '2000.01.03', '1d'
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> remoted... | [
"Calculate",
"the",
"smoothing",
"parameter",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_derived.py#L27-L50 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_derived.py | WaterLevelMinimumRemoteSmoothPar.update | def update(self):
"""Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> waterlevelminimumremotetolerance(0.0)
>>> derived.waterlevelminimu... | python | def update(self):
"""Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> waterlevelminimumremotetolerance(0.0)
>>> derived.waterlevelminimu... | [
"def",
"update",
"(",
"self",
")",
":",
"metapar",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"waterlevelminimumremotetolerance",
"self",
"(",
"smoothtools",
".",
"calc_smoothpar_logistic1",
"(",
"metapar",
")",
")"
] | Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> waterlevelminimumremotetolerance(0.0)
>>> derived.waterlevelminimumremotesmoothpar.update()
... | [
"Calculate",
"the",
"smoothing",
"parameter",
"value",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_derived.py#L151-L173 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_derived.py | HighestRemoteSmoothPar.update | def update(self):
"""Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> highestremotedischarge(1.0)
>>> highestremotetolerance(0.0)
... | python | def update(self):
"""Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> highestremotedischarge(1.0)
>>> highestremotetolerance(0.0)
... | [
"def",
"update",
"(",
"self",
")",
":",
"control",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
"if",
"numpy",
".",
"isinf",
"(",
"control",
".",
"highestremotedischarge",
")",
":",
"self",
"(",
"0.0",
")",
"else",
":",
"self",
"(",
"con... | Calculate the smoothing parameter value.
The following example is explained in some detail in module
|smoothtools|:
>>> from hydpy.models.dam import *
>>> parameterstep()
>>> highestremotedischarge(1.0)
>>> highestremotetolerance(0.0)
>>> derived.highestremotesm... | [
"Calculate",
"the",
"smoothing",
"parameter",
"value",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_derived.py#L246-L303 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | run_subprocess | def run_subprocess(command: str, verbose: bool = True, blocking: bool = True) \
-> Optional[subprocess.Popen]:
"""Execute the given command in a new process.
Only when both `verbose` and `blocking` are |True|, |run_subprocess|
prints all responses to the current value of |sys.stdout|:
>>> from... | python | def run_subprocess(command: str, verbose: bool = True, blocking: bool = True) \
-> Optional[subprocess.Popen]:
"""Execute the given command in a new process.
Only when both `verbose` and `blocking` are |True|, |run_subprocess|
prints all responses to the current value of |sys.stdout|:
>>> from... | [
"def",
"run_subprocess",
"(",
"command",
":",
"str",
",",
"verbose",
":",
"bool",
"=",
"True",
",",
"blocking",
":",
"bool",
"=",
"True",
")",
"->",
"Optional",
"[",
"subprocess",
".",
"Popen",
"]",
":",
"if",
"blocking",
":",
"result1",
"=",
"subproce... | Execute the given command in a new process.
Only when both `verbose` and `blocking` are |True|, |run_subprocess|
prints all responses to the current value of |sys.stdout|:
>>> from hydpy import run_subprocess
>>> import platform
>>> esc = '' if 'windows' in platform.platform().lower() else '\\\\'
... | [
"Execute",
"the",
"given",
"command",
"in",
"a",
"new",
"process",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L21-L70 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | exec_commands | def exec_commands(commands: str, **parameters: Any) -> None:
"""Execute the given Python commands.
Function |exec_commands| is thought for testing purposes only (see
the main documentation on module |hyd|). Seperate individual commands
by semicolons and replaced whitespaces with underscores:
>>> ... | python | def exec_commands(commands: str, **parameters: Any) -> None:
"""Execute the given Python commands.
Function |exec_commands| is thought for testing purposes only (see
the main documentation on module |hyd|). Seperate individual commands
by semicolons and replaced whitespaces with underscores:
>>> ... | [
"def",
"exec_commands",
"(",
"commands",
":",
"str",
",",
"*",
"*",
"parameters",
":",
"Any",
")",
"->",
"None",
":",
"cmdlist",
"=",
"commands",
".",
"split",
"(",
"';'",
")",
"print",
"(",
"f'Start to execute the commands {cmdlist} for testing purposes.'",
")"... | Execute the given Python commands.
Function |exec_commands| is thought for testing purposes only (see
the main documentation on module |hyd|). Seperate individual commands
by semicolons and replaced whitespaces with underscores:
>>> from hydpy.exe.commandtools import exec_commands
>>> import sys
... | [
"Execute",
"the",
"given",
"Python",
"commands",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L73-L108 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | prepare_logfile | def prepare_logfile(filename: str) -> str:
"""Prepare an empty log file eventually and return its absolute path.
When passing the "filename" `stdout`, |prepare_logfile| does not
prepare any file and just returns `stdout`:
>>> from hydpy.exe.commandtools import prepare_logfile
>>> prepare_logfile('... | python | def prepare_logfile(filename: str) -> str:
"""Prepare an empty log file eventually and return its absolute path.
When passing the "filename" `stdout`, |prepare_logfile| does not
prepare any file and just returns `stdout`:
>>> from hydpy.exe.commandtools import prepare_logfile
>>> prepare_logfile('... | [
"def",
"prepare_logfile",
"(",
"filename",
":",
"str",
")",
"->",
"str",
":",
"if",
"filename",
"==",
"'stdout'",
":",
"return",
"filename",
"if",
"filename",
"==",
"'default'",
":",
"filename",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"."... | Prepare an empty log file eventually and return its absolute path.
When passing the "filename" `stdout`, |prepare_logfile| does not
prepare any file and just returns `stdout`:
>>> from hydpy.exe.commandtools import prepare_logfile
>>> prepare_logfile('stdout')
'stdout'
When passing the "filen... | [
"Prepare",
"an",
"empty",
"log",
"file",
"eventually",
"and",
"return",
"its",
"absolute",
"path",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L159-L203 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | execute_scriptfunction | def execute_scriptfunction() -> None:
"""Execute a HydPy script function.
Function |execute_scriptfunction| is indirectly applied and
explained in the documentation on module |hyd|.
"""
try:
args_given = []
kwargs_given = {}
for arg in sys.argv[1:]:
if len(arg) <... | python | def execute_scriptfunction() -> None:
"""Execute a HydPy script function.
Function |execute_scriptfunction| is indirectly applied and
explained in the documentation on module |hyd|.
"""
try:
args_given = []
kwargs_given = {}
for arg in sys.argv[1:]:
if len(arg) <... | [
"def",
"execute_scriptfunction",
"(",
")",
"->",
"None",
":",
"try",
":",
"args_given",
"=",
"[",
"]",
"kwargs_given",
"=",
"{",
"}",
"for",
"arg",
"in",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
":",
"if",
"len",
"(",
"arg",
")",
"<",
"3",
":",
... | Execute a HydPy script function.
Function |execute_scriptfunction| is indirectly applied and
explained in the documentation on module |hyd|. | [
"Execute",
"a",
"HydPy",
"script",
"function",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L223-L284 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | parse_argument | def parse_argument(string: str) -> Union[str, Tuple[str, str]]:
"""Return a single value for a string understood as a positional
argument or a |tuple| containing a keyword and its value for a
string understood as a keyword argument.
|parse_argument| is intended to be used as a helper function for
f... | python | def parse_argument(string: str) -> Union[str, Tuple[str, str]]:
"""Return a single value for a string understood as a positional
argument or a |tuple| containing a keyword and its value for a
string understood as a keyword argument.
|parse_argument| is intended to be used as a helper function for
f... | [
"def",
"parse_argument",
"(",
"string",
":",
"str",
")",
"->",
"Union",
"[",
"str",
",",
"Tuple",
"[",
"str",
",",
"str",
"]",
"]",
":",
"idx_equal",
"=",
"string",
".",
"find",
"(",
"'='",
")",
"if",
"idx_equal",
"==",
"-",
"1",
":",
"return",
"... | Return a single value for a string understood as a positional
argument or a |tuple| containing a keyword and its value for a
string understood as a keyword argument.
|parse_argument| is intended to be used as a helper function for
function |execute_scriptfunction| only. See the following
examples ... | [
"Return",
"a",
"single",
"value",
"for",
"a",
"string",
"understood",
"as",
"a",
"positional",
"argument",
"or",
"a",
"|tuple|",
"containing",
"a",
"keyword",
"and",
"its",
"value",
"for",
"a",
"string",
"understood",
"as",
"a",
"keyword",
"argument",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L346-L378 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | print_textandtime | def print_textandtime(text: str) -> None:
"""Print the given string and the current date and time with high
precision for logging purposes.
>>> from hydpy.exe.commandtools import print_textandtime
>>> from hydpy.core.testtools import mock_datetime_now
>>> from datetime import datetime
>>> with ... | python | def print_textandtime(text: str) -> None:
"""Print the given string and the current date and time with high
precision for logging purposes.
>>> from hydpy.exe.commandtools import print_textandtime
>>> from hydpy.core.testtools import mock_datetime_now
>>> from datetime import datetime
>>> with ... | [
"def",
"print_textandtime",
"(",
"text",
":",
"str",
")",
"->",
"None",
":",
"timestring",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"'%Y-%m-%d %H:%M:%S.%f'",
")",
"print",
"(",
"f'{text} ({timestring}).'",
")"
] | Print the given string and the current date and time with high
precision for logging purposes.
>>> from hydpy.exe.commandtools import print_textandtime
>>> from hydpy.core.testtools import mock_datetime_now
>>> from datetime import datetime
>>> with mock_datetime_now(datetime(2000, 1, 1, 12, 30, 0,... | [
"Print",
"the",
"given",
"string",
"and",
"the",
"current",
"date",
"and",
"time",
"with",
"high",
"precision",
"for",
"logging",
"purposes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L381-L393 | train |
hydpy-dev/hydpy | hydpy/exe/commandtools.py | LogFileInterface.write | def write(self, string: str) -> None:
"""Write the given string as explained in the main documentation
on class |LogFileInterface|."""
self.logfile.write('\n'.join(
f'{self._string}{substring}' if substring else ''
for substring in string.split('\n'))) | python | def write(self, string: str) -> None:
"""Write the given string as explained in the main documentation
on class |LogFileInterface|."""
self.logfile.write('\n'.join(
f'{self._string}{substring}' if substring else ''
for substring in string.split('\n'))) | [
"def",
"write",
"(",
"self",
",",
"string",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"logfile",
".",
"write",
"(",
"'\\n'",
".",
"join",
"(",
"f'{self._string}{substring}'",
"if",
"substring",
"else",
"''",
"for",
"substring",
"in",
"string",
"."... | Write the given string as explained in the main documentation
on class |LogFileInterface|. | [
"Write",
"the",
"given",
"string",
"as",
"explained",
"in",
"the",
"main",
"documentation",
"on",
"class",
"|LogFileInterface|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/commandtools.py#L335-L340 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | solve_dv_dt_v1 | def solve_dv_dt_v1(self):
"""Solve the differential equation of HydPy-L.
At the moment, HydPy-L only implements a simple numerical solution of
its underlying ordinary differential equation. To increase the accuracy
(or sometimes even to prevent instability) of this approximation, one
can set the v... | python | def solve_dv_dt_v1(self):
"""Solve the differential equation of HydPy-L.
At the moment, HydPy-L only implements a simple numerical solution of
its underlying ordinary differential equation. To increase the accuracy
(or sometimes even to prevent instability) of this approximation, one
can set the v... | [
"def",
"solve_dv_dt_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
... | Solve the differential equation of HydPy-L.
At the moment, HydPy-L only implements a simple numerical solution of
its underlying ordinary differential equation. To increase the accuracy
(or sometimes even to prevent instability) of this approximation, one
can set the value of parameter |MaxDT| to a va... | [
"Solve",
"the",
"differential",
"equation",
"of",
"HydPy",
"-",
"L",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L10-L69 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | calc_vq_v1 | def calc_vq_v1(self):
"""Calculate the auxiliary term.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Required aide sequence:
|llake_aides.V|
Calculated aide sequence:
|llake_aides.VQ|
Basic equation:
:math:`VQ = 2 \\cdo... | python | def calc_vq_v1(self):
"""Calculate the auxiliary term.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Required aide sequence:
|llake_aides.V|
Calculated aide sequence:
|llake_aides.VQ|
Basic equation:
:math:`VQ = 2 \\cdo... | [
"def",
"calc_vq_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
".",
"fast... | Calculate the auxiliary term.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Required aide sequence:
|llake_aides.V|
Calculated aide sequence:
|llake_aides.VQ|
Basic equation:
:math:`VQ = 2 \\cdot V + \\frac{Seconds}{NmbSubs... | [
"Calculate",
"the",
"auxiliary",
"term",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L72-L112 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | interp_qa_v1 | def interp_qa_v1(self):
"""Calculate the lake outflow based on linear interpolation.
Required control parameters:
|N|
|llake_control.Q|
Required derived parameters:
|llake_derived.TOY|
|llake_derived.VQ|
Required aide sequence:
|llake_aides.VQ|
Calculated aide seque... | python | def interp_qa_v1(self):
"""Calculate the lake outflow based on linear interpolation.
Required control parameters:
|N|
|llake_control.Q|
Required derived parameters:
|llake_derived.TOY|
|llake_derived.VQ|
Required aide sequence:
|llake_aides.VQ|
Calculated aide seque... | [
"def",
"interp_qa_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
".",
"... | Calculate the lake outflow based on linear interpolation.
Required control parameters:
|N|
|llake_control.Q|
Required derived parameters:
|llake_derived.TOY|
|llake_derived.VQ|
Required aide sequence:
|llake_aides.VQ|
Calculated aide sequence:
|llake_aides.QA|
... | [
"Calculate",
"the",
"lake",
"outflow",
"based",
"on",
"linear",
"interpolation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L115-L222 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | calc_v_qa_v1 | def calc_v_qa_v1(self):
"""Update the stored water volume based on the equation of continuity.
Note that for too high outflow values, which would result in overdraining
the lake, the outflow is trimmed.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
... | python | def calc_v_qa_v1(self):
"""Update the stored water volume based on the equation of continuity.
Note that for too high outflow values, which would result in overdraining
the lake, the outflow is trimmed.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
... | [
"def",
"calc_v_qa_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
".",
"fa... | Update the stored water volume based on the equation of continuity.
Note that for too high outflow values, which would result in overdraining
the lake, the outflow is trimmed.
Required derived parameters:
|Seconds|
|NmbSubsteps|
Required flux sequence:
|QZ|
Updated aide sequenc... | [
"Update",
"the",
"stored",
"water",
"volume",
"based",
"on",
"the",
"equation",
"of",
"continuity",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L225-L290 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | interp_w_v1 | def interp_w_v1(self):
"""Calculate the actual water stage based on linear interpolation.
Required control parameters:
|N|
|llake_control.V|
|llake_control.W|
Required state sequence:
|llake_states.V|
Calculated state sequence:
|llake_states.W|
Examples:
Pr... | python | def interp_w_v1(self):
"""Calculate the actual water stage based on linear interpolation.
Required control parameters:
|N|
|llake_control.V|
|llake_control.W|
Required state sequence:
|llake_states.V|
Calculated state sequence:
|llake_states.W|
Examples:
Pr... | [
"def",
"interp_w_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"for",
"jdx",
"in",
"range",
"(",
"1",
",",
"con",
".",
... | Calculate the actual water stage based on linear interpolation.
Required control parameters:
|N|
|llake_control.V|
|llake_control.W|
Required state sequence:
|llake_states.V|
Calculated state sequence:
|llake_states.W|
Examples:
Prepare a model object:
... | [
"Calculate",
"the",
"actual",
"water",
"stage",
"based",
"on",
"linear",
"interpolation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L293-L354 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | corr_dw_v1 | def corr_dw_v1(self):
"""Adjust the water stage drop to the highest value allowed and correct
the associated fluxes.
Note that method |corr_dw_v1| calls the method `interp_v` of the
respective application model. Hence the requirements of the actual
`interp_v` need to be considered additionally.
... | python | def corr_dw_v1(self):
"""Adjust the water stage drop to the highest value allowed and correct
the associated fluxes.
Note that method |corr_dw_v1| calls the method `interp_v` of the
respective application model. Hence the requirements of the actual
`interp_v` need to be considered additionally.
... | [
"def",
"corr_dw_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"f... | Adjust the water stage drop to the highest value allowed and correct
the associated fluxes.
Note that method |corr_dw_v1| calls the method `interp_v` of the
respective application model. Hence the requirements of the actual
`interp_v` need to be considered additionally.
Required control parameter... | [
"Adjust",
"the",
"water",
"stage",
"drop",
"to",
"the",
"highest",
"value",
"allowed",
"and",
"correct",
"the",
"associated",
"fluxes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L420-L561 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | modify_qa_v1 | def modify_qa_v1(self):
"""Add water to or remove water from the calculated lake outflow.
Required control parameter:
|Verzw|
Required derived parameter:
|llake_derived.TOY|
Updated flux sequence:
|llake_fluxes.QA|
Basic Equation:
:math:`QA = QA* - Verzw`
Examples:
... | python | def modify_qa_v1(self):
"""Add water to or remove water from the calculated lake outflow.
Required control parameter:
|Verzw|
Required derived parameter:
|llake_derived.TOY|
Updated flux sequence:
|llake_fluxes.QA|
Basic Equation:
:math:`QA = QA* - Verzw`
Examples:
... | [
"def",
"modify_qa_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Add water to or remove water from the calculated lake outflow.
Required control parameter:
|Verzw|
Required derived parameter:
|llake_derived.TOY|
Updated flux sequence:
|llake_fluxes.QA|
Basic Equation:
:math:`QA = QA* - Verzw`
Examples:
In preparation for the f... | [
"Add",
"water",
"to",
"or",
"remove",
"water",
"from",
"the",
"calculated",
"lake",
"outflow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L564-L637 | train |
hydpy-dev/hydpy | hydpy/models/llake/llake_model.py | pass_q_v1 | def pass_q_v1(self):
"""Update the outlet link sequence."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.qa | python | def pass_q_v1(self):
"""Update the outlet link sequence."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.qa | [
"def",
"pass_q_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"q",
"[",
"0",
"]",
"+=",
"flu",
".",
"qa"
] | Update the outlet link sequence. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L649-L653 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_control.py | Responses.thresholds | def thresholds(self):
"""Threshold values of the response functions."""
return numpy.array(
sorted(self._key2float(key) for key in self._coefs), dtype=float) | python | def thresholds(self):
"""Threshold values of the response functions."""
return numpy.array(
sorted(self._key2float(key) for key in self._coefs), dtype=float) | [
"def",
"thresholds",
"(",
"self",
")",
":",
"return",
"numpy",
".",
"array",
"(",
"sorted",
"(",
"self",
".",
"_key2float",
"(",
"key",
")",
"for",
"key",
"in",
"self",
".",
"_coefs",
")",
",",
"dtype",
"=",
"float",
")"
] | Threshold values of the response functions. | [
"Threshold",
"values",
"of",
"the",
"response",
"functions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_control.py#L308-L311 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | prepare_arrays | def prepare_arrays(sim=None, obs=None, node=None, skip_nan=False):
"""Prepare and return two |numpy| arrays based on the given arguments.
Note that many functions provided by module |statstools| apply function
|prepare_arrays| internally (e.g. |nse|). But you can also apply it
manually, as shown in th... | python | def prepare_arrays(sim=None, obs=None, node=None, skip_nan=False):
"""Prepare and return two |numpy| arrays based on the given arguments.
Note that many functions provided by module |statstools| apply function
|prepare_arrays| internally (e.g. |nse|). But you can also apply it
manually, as shown in th... | [
"def",
"prepare_arrays",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"if",
"node",
":",
"if",
"sim",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Values are passed to b... | Prepare and return two |numpy| arrays based on the given arguments.
Note that many functions provided by module |statstools| apply function
|prepare_arrays| internally (e.g. |nse|). But you can also apply it
manually, as shown in the following examples.
Function |prepare_arrays| can extract time seri... | [
"Prepare",
"and",
"return",
"two",
"|numpy|",
"arrays",
"based",
"on",
"the",
"given",
"arguments",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L18-L135 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | nse | def nse(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the efficiency criteria after Nash & Sutcliffe.
If the simulated values predict the observed values as well
as the average observed value (regarding the the mean square
error), the NSE value is zero:
>>> from hydpy import nse
... | python | def nse(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the efficiency criteria after Nash & Sutcliffe.
If the simulated values predict the observed values as well
as the average observed value (regarding the the mean square
error), the NSE value is zero:
>>> from hydpy import nse
... | [
"def",
"nse",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
",",
"obs",
",",
"node",
",",
"skip_nan",
")",
"return",
"1."... | Calculate the efficiency criteria after Nash & Sutcliffe.
If the simulated values predict the observed values as well
as the average observed value (regarding the the mean square
error), the NSE value is zero:
>>> from hydpy import nse
>>> nse(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])
0.0
... | [
"Calculate",
"the",
"efficiency",
"criteria",
"after",
"Nash",
"&",
"Sutcliffe",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L140-L170 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | bias_abs | def bias_abs(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the absolute difference between the means of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import bias_abs
>>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> ro... | python | def bias_abs(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the absolute difference between the means of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import bias_abs
>>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> ro... | [
"def",
"bias_abs",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
",",
"obs",
",",
"node",
",",
"skip_nan",
")",
"return",
... | Calculate the absolute difference between the means of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import bias_abs
>>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> round_(bias_abs(sim=[5.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]))
1.0
... | [
"Calculate",
"the",
"absolute",
"difference",
"between",
"the",
"means",
"of",
"the",
"simulated",
"and",
"the",
"observed",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L175-L192 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | std_ratio | def std_ratio(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the ratio between the standard deviation of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import std_ratio
>>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> ... | python | def std_ratio(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the ratio between the standard deviation of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import std_ratio
>>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> ... | [
"def",
"std_ratio",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
",",
"obs",
",",
"node",
",",
"skip_nan",
")",
"return",
... | Calculate the ratio between the standard deviation of the simulated
and the observed values.
>>> from hydpy import round_
>>> from hydpy import std_ratio
>>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0]))
0.0
>>> round_(std_ratio(sim=[1.0, 1.0, 1.0], obs=[1.0, 2.0, 3.0]))
-1.0
... | [
"Calculate",
"the",
"ratio",
"between",
"the",
"standard",
"deviation",
"of",
"the",
"simulated",
"and",
"the",
"observed",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L219-L236 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | corr | def corr(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the product-moment correlation coefficient after Pearson.
>>> from hydpy import round_
>>> from hydpy import corr
>>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0]))
1.0
>>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2... | python | def corr(sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the product-moment correlation coefficient after Pearson.
>>> from hydpy import round_
>>> from hydpy import corr
>>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0]))
1.0
>>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2... | [
"def",
"corr",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
",",
"obs",
",",
"node",
",",
"skip_nan",
")",
"return",
"nu... | Calculate the product-moment correlation coefficient after Pearson.
>>> from hydpy import round_
>>> from hydpy import corr
>>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0]))
1.0
>>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2.0, 3.0]))
-1.0
>>> round_(corr(sim=[1.0, 2.0, 1.0], obs... | [
"Calculate",
"the",
"product",
"-",
"moment",
"correlation",
"coefficient",
"after",
"Pearson",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L241-L257 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | hsepd_pdf | def hsepd_pdf(sigma1, sigma2, xi, beta,
sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the probability densities based on the
heteroskedastic skewed exponential power distribution.
For convenience, the required parameters of the probability density
function as well as the si... | python | def hsepd_pdf(sigma1, sigma2, xi, beta,
sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the probability densities based on the
heteroskedastic skewed exponential power distribution.
For convenience, the required parameters of the probability density
function as well as the si... | [
"def",
"hsepd_pdf",
"(",
"sigma1",
",",
"sigma2",
",",
"xi",
",",
"beta",
",",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
"... | Calculate the probability densities based on the
heteroskedastic skewed exponential power distribution.
For convenience, the required parameters of the probability density
function as well as the simulated and observed values are stored
in a dictonary:
>>> import numpy
>>> from hydpy import ro... | [
"Calculate",
"the",
"probability",
"densities",
"based",
"on",
"the",
"heteroskedastic",
"skewed",
"exponential",
"power",
"distribution",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L279-L388 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | hsepd_manual | def hsepd_manual(sigma1, sigma2, xi, beta,
sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
The following examples are taken from the documentation of function
... | python | def hsepd_manual(sigma1, sigma2, xi, beta,
sim=None, obs=None, node=None, skip_nan=False):
"""Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
The following examples are taken from the documentation of function
... | [
"def",
"hsepd_manual",
"(",
"sigma1",
",",
"sigma2",
",",
"xi",
",",
"beta",
",",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"sim",
",",
"obs",
"=",
"prepare_arrays",
"(",
"sim",
... | Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
The following examples are taken from the documentation of function
|hsepd_pdf|, which is used by function |hsepd_manual|. The first
one deals with a heteroscedastic normal dist... | [
"Calculate",
"the",
"mean",
"of",
"the",
"logarithmised",
"probability",
"densities",
"of",
"the",
"heteroskedastic",
"skewed",
"exponential",
"power",
"distribution",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L399-L428 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | hsepd | def hsepd(sim=None, obs=None, node=None, skip_nan=False,
inits=None, return_pars=False, silent=True):
"""Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
Function |hsepd| serves the same purpose as function |hsepd_manual|... | python | def hsepd(sim=None, obs=None, node=None, skip_nan=False,
inits=None, return_pars=False, silent=True):
"""Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
Function |hsepd| serves the same purpose as function |hsepd_manual|... | [
"def",
"hsepd",
"(",
"sim",
"=",
"None",
",",
"obs",
"=",
"None",
",",
"node",
"=",
"None",
",",
"skip_nan",
"=",
"False",
",",
"inits",
"=",
"None",
",",
"return_pars",
"=",
"False",
",",
"silent",
"=",
"True",
")",
":",
"def",
"transform",
"(",
... | Calculate the mean of the logarithmised probability densities of the
'heteroskedastic skewed exponential power distribution.
Function |hsepd| serves the same purpose as function |hsepd_manual|,
but tries to estimate the parameters of the heteroscedastic skewed
exponential distribution via an optimizati... | [
"Calculate",
"the",
"mean",
"of",
"the",
"logarithmised",
"probability",
"densities",
"of",
"the",
"heteroskedastic",
"skewed",
"exponential",
"power",
"distribution",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L433-L523 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | calc_mean_time | def calc_mean_time(timepoints, weights):
"""Return the weighted mean of the given timepoints.
With equal given weights, the result is simply the mean of the given
time points:
>>> from hydpy import calc_mean_time
>>> calc_mean_time(timepoints=[3., 7.],
... weights=[2., 2.])
... | python | def calc_mean_time(timepoints, weights):
"""Return the weighted mean of the given timepoints.
With equal given weights, the result is simply the mean of the given
time points:
>>> from hydpy import calc_mean_time
>>> calc_mean_time(timepoints=[3., 7.],
... weights=[2., 2.])
... | [
"def",
"calc_mean_time",
"(",
"timepoints",
",",
"weights",
")",
":",
"timepoints",
"=",
"numpy",
".",
"array",
"(",
"timepoints",
")",
"weights",
"=",
"numpy",
".",
"array",
"(",
"weights",
")",
"validtools",
".",
"test_equal_shape",
"(",
"timepoints",
"=",... | Return the weighted mean of the given timepoints.
With equal given weights, the result is simply the mean of the given
time points:
>>> from hydpy import calc_mean_time
>>> calc_mean_time(timepoints=[3., 7.],
... weights=[2., 2.])
5.0
With different weights, the resulting m... | [
"Return",
"the",
"weighted",
"mean",
"of",
"the",
"given",
"timepoints",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L528-L566 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | calc_mean_time_deviation | def calc_mean_time_deviation(timepoints, weights, mean_time=None):
"""Return the weighted deviation of the given timepoints from their mean
time.
With equal given weights, the is simply the standard deviation of the
given time points:
>>> from hydpy import calc_mean_time_deviation
>>> calc_mea... | python | def calc_mean_time_deviation(timepoints, weights, mean_time=None):
"""Return the weighted deviation of the given timepoints from their mean
time.
With equal given weights, the is simply the standard deviation of the
given time points:
>>> from hydpy import calc_mean_time_deviation
>>> calc_mea... | [
"def",
"calc_mean_time_deviation",
"(",
"timepoints",
",",
"weights",
",",
"mean_time",
"=",
"None",
")",
":",
"timepoints",
"=",
"numpy",
".",
"array",
"(",
"timepoints",
")",
"weights",
"=",
"numpy",
".",
"array",
"(",
"weights",
")",
"validtools",
".",
... | Return the weighted deviation of the given timepoints from their mean
time.
With equal given weights, the is simply the standard deviation of the
given time points:
>>> from hydpy import calc_mean_time_deviation
>>> calc_mean_time_deviation(timepoints=[3., 7.],
... wei... | [
"Return",
"the",
"weighted",
"deviation",
"of",
"the",
"given",
"timepoints",
"from",
"their",
"mean",
"time",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L571-L618 | train |
hydpy-dev/hydpy | hydpy/auxs/statstools.py | evaluationtable | def evaluationtable(nodes, criteria, nodenames=None,
critnames=None, skip_nan=False):
"""Return a table containing the results of the given evaluation
criteria for the given |Node| objects.
First, we define two nodes with different simulation and observation
data (see function |prep... | python | def evaluationtable(nodes, criteria, nodenames=None,
critnames=None, skip_nan=False):
"""Return a table containing the results of the given evaluation
criteria for the given |Node| objects.
First, we define two nodes with different simulation and observation
data (see function |prep... | [
"def",
"evaluationtable",
"(",
"nodes",
",",
"criteria",
",",
"nodenames",
"=",
"None",
",",
"critnames",
"=",
"None",
",",
"skip_nan",
"=",
"False",
")",
":",
"if",
"nodenames",
":",
"if",
"len",
"(",
"nodes",
")",
"!=",
"len",
"(",
"nodenames",
")",
... | Return a table containing the results of the given evaluation
criteria for the given |Node| objects.
First, we define two nodes with different simulation and observation
data (see function |prepare_arrays| for some explanations):
>>> from hydpy import pub, Node, nan
>>> pub.timegrids = '01.01.2000... | [
"Return",
"a",
"table",
"containing",
"the",
"results",
"of",
"the",
"given",
"evaluation",
"criteria",
"for",
"the",
"given",
"|Node|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L623-L708 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.set_primary_parameters | def set_primary_parameters(self, **kwargs):
"""Set all primary parameters at once."""
given = sorted(kwargs.keys())
required = sorted(self._PRIMARY_PARAMETERS)
if given == required:
for (key, value) in kwargs.items():
setattr(self, key, value)
else:
... | python | def set_primary_parameters(self, **kwargs):
"""Set all primary parameters at once."""
given = sorted(kwargs.keys())
required = sorted(self._PRIMARY_PARAMETERS)
if given == required:
for (key, value) in kwargs.items():
setattr(self, key, value)
else:
... | [
"def",
"set_primary_parameters",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"given",
"=",
"sorted",
"(",
"kwargs",
".",
"keys",
"(",
")",
")",
"required",
"=",
"sorted",
"(",
"self",
".",
"_PRIMARY_PARAMETERS",
")",
"if",
"given",
"==",
"required",
... | Set all primary parameters at once. | [
"Set",
"all",
"primary",
"parameters",
"at",
"once",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L148-L164 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.primary_parameters_complete | def primary_parameters_complete(self):
"""True/False flag that indicates wheter the values of all primary
parameters are defined or not."""
for primpar in self._PRIMARY_PARAMETERS.values():
if primpar.__get__(self) is None:
return False
return True | python | def primary_parameters_complete(self):
"""True/False flag that indicates wheter the values of all primary
parameters are defined or not."""
for primpar in self._PRIMARY_PARAMETERS.values():
if primpar.__get__(self) is None:
return False
return True | [
"def",
"primary_parameters_complete",
"(",
"self",
")",
":",
"for",
"primpar",
"in",
"self",
".",
"_PRIMARY_PARAMETERS",
".",
"values",
"(",
")",
":",
"if",
"primpar",
".",
"__get__",
"(",
"self",
")",
"is",
"None",
":",
"return",
"False",
"return",
"True"... | True/False flag that indicates wheter the values of all primary
parameters are defined or not. | [
"True",
"/",
"False",
"flag",
"that",
"indicates",
"wheter",
"the",
"values",
"of",
"all",
"primary",
"parameters",
"are",
"defined",
"or",
"not",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L167-L173 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.