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/models/lland/lland_model.py | pass_q_v1 | def pass_q_v1(self):
"""Update the outlet link sequence.
Required derived parameter:
|QFactor|
Required flux sequences:
|lland_fluxes.Q|
Calculated flux sequence:
|lland_outlets.Q|
Basic equation:
:math:`Q_{outlets} = QFactor \\cdot Q_{fluxes}`
"""
der = self.par... | python | def pass_q_v1(self):
"""Update the outlet link sequence.
Required derived parameter:
|QFactor|
Required flux sequences:
|lland_fluxes.Q|
Calculated flux sequence:
|lland_outlets.Q|
Basic equation:
:math:`Q_{outlets} = QFactor \\cdot Q_{fluxes}`
"""
der = self.par... | [
"def",
"pass_q_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fas... | Update the outlet link sequence.
Required derived parameter:
|QFactor|
Required flux sequences:
|lland_fluxes.Q|
Calculated flux sequence:
|lland_outlets.Q|
Basic equation:
:math:`Q_{outlets} = QFactor \\cdot Q_{fluxes}` | [
"Update",
"the",
"outlet",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L2005-L2023 | train |
hydpy-dev/hydpy | hydpy/models/hbranch/hbranch_model.py | calc_outputs_v1 | def calc_outputs_v1(self):
"""Performs the actual interpolation or extrapolation.
Required control parameters:
|XPoints|
|YPoints|
Required derived parameter:
|NmbPoints|
|NmbBranches|
Required flux sequence:
|Input|
Calculated flux sequence:
|Outputs|
Ex... | python | def calc_outputs_v1(self):
"""Performs the actual interpolation or extrapolation.
Required control parameters:
|XPoints|
|YPoints|
Required derived parameter:
|NmbPoints|
|NmbBranches|
Required flux sequence:
|Input|
Calculated flux sequence:
|Outputs|
Ex... | [
"def",
"calc_outputs_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",... | Performs the actual interpolation or extrapolation.
Required control parameters:
|XPoints|
|YPoints|
Required derived parameter:
|NmbPoints|
|NmbBranches|
Required flux sequence:
|Input|
Calculated flux sequence:
|Outputs|
Examples:
As a simple examp... | [
"Performs",
"the",
"actual",
"interpolation",
"or",
"extrapolation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hbranch/hbranch_model.py#L11-L94 | train |
hydpy-dev/hydpy | hydpy/models/hbranch/hbranch_model.py | pick_input_v1 | def pick_input_v1(self):
"""Updates |Input| based on |Total|."""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.input = 0.
for idx in range(inl.len_total):
flu.input += inl.total[idx][0] | python | def pick_input_v1(self):
"""Updates |Input| based on |Total|."""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.input = 0.
for idx in range(inl.len_total):
flu.input += inl.total[idx][0] | [
"def",
"pick_input_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"input",
"=",
"0.",
"for",
"idx",
"in",
"range",
... | Updates |Input| based on |Total|. | [
"Updates",
"|Input|",
"based",
"on",
"|Total|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hbranch/hbranch_model.py#L97-L103 | train |
hydpy-dev/hydpy | hydpy/models/hbranch/hbranch_model.py | pass_outputs_v1 | def pass_outputs_v1(self):
"""Updates |Branched| based on |Outputs|."""
der = self.parameters.derived.fastaccess
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
for bdx in range(der.nmbbranches):
out.branched[bdx][0] += flu.outputs[bdx] | python | def pass_outputs_v1(self):
"""Updates |Branched| based on |Outputs|."""
der = self.parameters.derived.fastaccess
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
for bdx in range(der.nmbbranches):
out.branched[bdx][0] += flu.outputs[bdx] | [
"def",
"pass_outputs_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
... | Updates |Branched| based on |Outputs|. | [
"Updates",
"|Branched|",
"based",
"on",
"|Outputs|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hbranch/hbranch_model.py#L106-L112 | train |
hydpy-dev/hydpy | hydpy/models/hbranch/hbranch_model.py | Model.connect | def connect(self):
"""Connect the |LinkSequence| instances handled by the actual model
to the |NodeSequence| instances handled by one inlet node and
multiple oulet nodes.
The HydPy-H-Branch model passes multiple output values to different
outlet nodes. This requires additional ... | python | def connect(self):
"""Connect the |LinkSequence| instances handled by the actual model
to the |NodeSequence| instances handled by one inlet node and
multiple oulet nodes.
The HydPy-H-Branch model passes multiple output values to different
outlet nodes. This requires additional ... | [
"def",
"connect",
"(",
"self",
")",
":",
"nodes",
"=",
"self",
".",
"element",
".",
"inlets",
"total",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"total",
"if",
"total",
".",
"shape",
"!=",
"(",
"len",
"(",
"nodes",
")",
",",
")",
":",
"t... | Connect the |LinkSequence| instances handled by the actual model
to the |NodeSequence| instances handled by one inlet node and
multiple oulet nodes.
The HydPy-H-Branch model passes multiple output values to different
outlet nodes. This requires additional information regarding the
... | [
"Connect",
"the",
"|LinkSequence|",
"instances",
"handled",
"by",
"the",
"actual",
"model",
"to",
"the",
"|NodeSequence|",
"instances",
"handled",
"by",
"one",
"inlet",
"node",
"and",
"multiple",
"oulet",
"nodes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hbranch/hbranch_model.py#L125-L193 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_derived.py | Nmb.update | def update(self):
"""Determine the number of response functions.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.nmb.update()
>>> derived.nmb
nmb(2)
Note that updating p... | python | def update(self):
"""Determine the number of response functions.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.nmb.update()
>>> derived.nmb
nmb(2)
Note that updating p... | [
"def",
"update",
"(",
"self",
")",
":",
"pars",
"=",
"self",
".",
"subpars",
".",
"pars",
"responses",
"=",
"pars",
".",
"control",
".",
"responses",
"fluxes",
"=",
"pars",
".",
"model",
".",
"sequences",
".",
"fluxes",
"self",
"(",
"len",
"(",
"resp... | Determine the number of response functions.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.nmb.update()
>>> derived.nmb
nmb(2)
Note that updating parameter `nmb` sets the shape... | [
"Determine",
"the",
"number",
"of",
"response",
"functions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_derived.py#L16-L45 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_derived.py | AR_Order.update | def update(self):
"""Determine the total number of AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_order.update()
>>> derived.ar_order
ar_order(2, 1)
... | python | def update(self):
"""Determine the total number of AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_order.update()
>>> derived.ar_order
ar_order(2, 1)
... | [
"def",
"update",
"(",
"self",
")",
":",
"responses",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"responses",
"self",
".",
"shape",
"=",
"len",
"(",
"responses",
")",
"self",
"(",
"responses",
".",
"ar_orders",
")"
] | Determine the total number of AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_order.update()
>>> derived.ar_order
ar_order(2, 1) | [
"Determine",
"the",
"total",
"number",
"of",
"AR",
"coefficients",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_derived.py#L94-L106 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_derived.py | AR_Coefs.update | def update(self):
"""Determine all AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_coefs.update()
>>> derived.ar_coefs
ar_coefs([[1.0, 2.0],
... | python | def update(self):
"""Determine all AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_coefs.update()
>>> derived.ar_coefs
ar_coefs([[1.0, 2.0],
... | [
"def",
"update",
"(",
"self",
")",
":",
"pars",
"=",
"self",
".",
"subpars",
".",
"pars",
"coefs",
"=",
"pars",
".",
"control",
".",
"responses",
".",
"ar_coefs",
"self",
".",
"shape",
"=",
"coefs",
".",
"shape",
"self",
"(",
"coefs",
")",
"pars",
... | Determine all AR coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ar_coefs.update()
>>> derived.ar_coefs
ar_coefs([[1.0, 2.0],
[1.0, nan]])
Note t... | [
"Determine",
"all",
"AR",
"coefficients",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_derived.py#L132-L154 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_derived.py | MA_Coefs.update | def update(self):
"""Determine all MA coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ma_coefs.update()
>>> derived.ma_coefs
ma_coefs([[1.0, nan, nan],
... | python | def update(self):
"""Determine all MA coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ma_coefs.update()
>>> derived.ma_coefs
ma_coefs([[1.0, nan, nan],
... | [
"def",
"update",
"(",
"self",
")",
":",
"pars",
"=",
"self",
".",
"subpars",
".",
"pars",
"coefs",
"=",
"pars",
".",
"control",
".",
"responses",
".",
"ma_coefs",
"self",
".",
"shape",
"=",
"coefs",
".",
"shape",
"self",
"(",
"coefs",
")",
"pars",
... | Determine all MA coefficients.
>>> from hydpy.models.arma import *
>>> parameterstep('1d')
>>> responses(((1., 2.), (1.,)), th_3=((1.,), (1., 2., 3.)))
>>> derived.ma_coefs.update()
>>> derived.ma_coefs
ma_coefs([[1.0, nan, nan],
[1.0, 2.0, 3.0]])
... | [
"Determine",
"all",
"MA",
"coefficients",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_derived.py#L161-L183 | train |
hydpy-dev/hydpy | hydpy/core/optiontools.py | _prepare_docstrings | def _prepare_docstrings():
"""Assign docstrings to the corresponding attributes of class `Options`
to make them available in the interactive mode of Python."""
if config.USEAUTODOC:
source = inspect.getsource(Options)
docstrings = source.split('"""')[3::2]
attributes = [line.strip()... | python | def _prepare_docstrings():
"""Assign docstrings to the corresponding attributes of class `Options`
to make them available in the interactive mode of Python."""
if config.USEAUTODOC:
source = inspect.getsource(Options)
docstrings = source.split('"""')[3::2]
attributes = [line.strip()... | [
"def",
"_prepare_docstrings",
"(",
")",
":",
"if",
"config",
".",
"USEAUTODOC",
":",
"source",
"=",
"inspect",
".",
"getsource",
"(",
"Options",
")",
"docstrings",
"=",
"source",
".",
"split",
"(",
"'\"\"\"'",
")",
"[",
"3",
":",
":",
"2",
"]",
"attrib... | Assign docstrings to the corresponding attributes of class `Options`
to make them available in the interactive mode of Python. | [
"Assign",
"docstrings",
"to",
"the",
"corresponding",
"attributes",
"of",
"class",
"Options",
"to",
"make",
"them",
"available",
"in",
"the",
"interactive",
"mode",
"of",
"Python",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/optiontools.py#L211-L220 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selections.nodes | def nodes(self) -> devicetools.Nodes:
"""A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1', 'node2'], ['element1']),
... Selection('sel... | python | def nodes(self) -> devicetools.Nodes:
"""A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1', 'node2'], ['element1']),
... Selection('sel... | [
"def",
"nodes",
"(",
"self",
")",
"->",
"devicetools",
".",
"Nodes",
":",
"nodes",
"=",
"devicetools",
".",
"Nodes",
"(",
")",
"for",
"selection",
"in",
"self",
":",
"nodes",
"+=",
"selection",
".",
"nodes",
"return",
"nodes"
] | A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1', 'node2'], ['element1']),
... Selection('sel2', ['node1', 'node3'], ['element2']))
>>... | [
"A",
"|set|",
"containing",
"the",
"|Node|",
"objects",
"of",
"all",
"handled",
"|Selection|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L160-L174 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selections.elements | def elements(self) -> devicetools.Elements:
"""A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1'], ['element1']),
... Selection('sel2',... | python | def elements(self) -> devicetools.Elements:
"""A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1'], ['element1']),
... Selection('sel2',... | [
"def",
"elements",
"(",
"self",
")",
"->",
"devicetools",
".",
"Elements",
":",
"elements",
"=",
"devicetools",
".",
"Elements",
"(",
")",
"for",
"selection",
"in",
"self",
":",
"elements",
"+=",
"selection",
".",
"elements",
"return",
"elements"
] | A |set| containing the |Node| objects of all handled
|Selection| objects.
>>> from hydpy import Selection, Selections
>>> selections = Selections(
... Selection('sel1', ['node1'], ['element1']),
... Selection('sel2', ['node1'], ['element2', 'element3']))
>>> sele... | [
"A",
"|set|",
"containing",
"the",
"|Node|",
"objects",
"of",
"all",
"handled",
"|Selection|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L177-L191 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selections.__getiterable | def __getiterable(value): # ToDo: refactor
"""Try to convert the given argument to a |list| of |Selection|
objects and return it.
"""
if isinstance(value, Selection):
return [value]
try:
for selection in value:
if not isinstance(selectio... | python | def __getiterable(value): # ToDo: refactor
"""Try to convert the given argument to a |list| of |Selection|
objects and return it.
"""
if isinstance(value, Selection):
return [value]
try:
for selection in value:
if not isinstance(selectio... | [
"def",
"__getiterable",
"(",
"value",
")",
":",
"# ToDo: refactor",
"if",
"isinstance",
"(",
"value",
",",
"Selection",
")",
":",
"return",
"[",
"value",
"]",
"try",
":",
"for",
"selection",
"in",
"value",
":",
"if",
"not",
"isinstance",
"(",
"selection",
... | Try to convert the given argument to a |list| of |Selection|
objects and return it. | [
"Try",
"to",
"convert",
"the",
"given",
"argument",
"to",
"a",
"|list|",
"of",
"|Selection|",
"objects",
"and",
"return",
"it",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L237-L253 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selections.assignrepr | def assignrepr(self, prefix='') -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with hydpy.pub.options.ellipsis(2, optional=True):
prefix += '%s(' % objecttools.classname(self)
repr_ = objecttools... | python | def assignrepr(self, prefix='') -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with hydpy.pub.options.ellipsis(2, optional=True):
prefix += '%s(' % objecttools.classname(self)
repr_ = objecttools... | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
"=",
"''",
")",
"->",
"str",
":",
"with",
"objecttools",
".",
"repr_",
".",
"preserve_strings",
"(",
"True",
")",
":",
"with",
"hydpy",
".",
"pub",
".",
"options",
".",
"ellipsis",
"(",
"2",
",",
"opti... | Return a |repr| string with a prefixed assignment. | [
"Return",
"a",
"|repr|",
"string",
"with",
"a",
"prefixed",
"assignment",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L303-L310 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.search_upstream | def search_upstream(self, device: devicetools.Device,
name: str = 'upstream') -> 'Selection':
"""Return the network upstream of the given starting point, including
the starting point itself.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, ... | python | def search_upstream(self, device: devicetools.Device,
name: str = 'upstream') -> 'Selection':
"""Return the network upstream of the given starting point, including
the starting point itself.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, ... | [
"def",
"search_upstream",
"(",
"self",
",",
"device",
":",
"devicetools",
".",
"Device",
",",
"name",
":",
"str",
"=",
"'upstream'",
")",
"->",
"'Selection'",
":",
"try",
":",
"selection",
"=",
"Selection",
"(",
"name",
")",
"if",
"isinstance",
"(",
"dev... | Return the network upstream of the given starting point, including
the starting point itself.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, _ = prepare_full_example_2()
You can pass both |Node| and |Element| objects and, optionally,
the name of the new... | [
"Return",
"the",
"network",
"upstream",
"of",
"the",
"given",
"starting",
"point",
"including",
"the",
"starting",
"point",
"itself",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L434-L517 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.select_upstream | def select_upstream(self, device: devicetools.Device) -> 'Selection':
"""Restrict the current selection to the network upstream of the given
starting point, including the starting point itself.
See the documentation on method |Selection.search_upstream| for
additional information.
... | python | def select_upstream(self, device: devicetools.Device) -> 'Selection':
"""Restrict the current selection to the network upstream of the given
starting point, including the starting point itself.
See the documentation on method |Selection.search_upstream| for
additional information.
... | [
"def",
"select_upstream",
"(",
"self",
",",
"device",
":",
"devicetools",
".",
"Device",
")",
"->",
"'Selection'",
":",
"upstream",
"=",
"self",
".",
"search_upstream",
"(",
"device",
")",
"self",
".",
"nodes",
"=",
"upstream",
".",
"nodes",
"self",
".",
... | Restrict the current selection to the network upstream of the given
starting point, including the starting point itself.
See the documentation on method |Selection.search_upstream| for
additional information. | [
"Restrict",
"the",
"current",
"selection",
"to",
"the",
"network",
"upstream",
"of",
"the",
"given",
"starting",
"point",
"including",
"the",
"starting",
"point",
"itself",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L533-L543 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.search_modeltypes | def search_modeltypes(self, *models: ModelTypesArg,
name: str = 'modeltypes') -> 'Selection':
"""Return a |Selection| object containing only the elements
currently handling models of the given types.
>>> from hydpy.core.examples import prepare_full_example_2
>>... | python | def search_modeltypes(self, *models: ModelTypesArg,
name: str = 'modeltypes') -> 'Selection':
"""Return a |Selection| object containing only the elements
currently handling models of the given types.
>>> from hydpy.core.examples import prepare_full_example_2
>>... | [
"def",
"search_modeltypes",
"(",
"self",
",",
"*",
"models",
":",
"ModelTypesArg",
",",
"name",
":",
"str",
"=",
"'modeltypes'",
")",
"->",
"'Selection'",
":",
"try",
":",
"typelist",
"=",
"[",
"]",
"for",
"model",
"in",
"models",
":",
"if",
"not",
"is... | Return a |Selection| object containing only the elements
currently handling models of the given types.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, _ = prepare_full_example_2()
You can pass both |Model| objects and names and, as a keyword
argument, th... | [
"Return",
"a",
"|Selection|",
"object",
"containing",
"only",
"the",
"elements",
"currently",
"handling",
"models",
"of",
"the",
"given",
"types",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L559-L635 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.select_modeltypes | def select_modeltypes(self, *models: ModelTypesArg) -> 'Selection':
"""Restrict the current |Selection| object to all elements
containing the given model types (removes all nodes).
See the documentation on method |Selection.search_modeltypes| for
additional information.
"""
... | python | def select_modeltypes(self, *models: ModelTypesArg) -> 'Selection':
"""Restrict the current |Selection| object to all elements
containing the given model types (removes all nodes).
See the documentation on method |Selection.search_modeltypes| for
additional information.
"""
... | [
"def",
"select_modeltypes",
"(",
"self",
",",
"*",
"models",
":",
"ModelTypesArg",
")",
"->",
"'Selection'",
":",
"self",
".",
"nodes",
"=",
"devicetools",
".",
"Nodes",
"(",
")",
"self",
".",
"elements",
"=",
"self",
".",
"search_modeltypes",
"(",
"*",
... | Restrict the current |Selection| object to all elements
containing the given model types (removes all nodes).
See the documentation on method |Selection.search_modeltypes| for
additional information. | [
"Restrict",
"the",
"current",
"|Selection|",
"object",
"to",
"all",
"elements",
"containing",
"the",
"given",
"model",
"types",
"(",
"removes",
"all",
"nodes",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L637-L646 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.search_nodenames | def search_nodenames(self, *substrings: str, name: str = 'nodenames') -> \
'Selection':
"""Return a new selection containing all nodes of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import prepare_full_example_2
... | python | def search_nodenames(self, *substrings: str, name: str = 'nodenames') -> \
'Selection':
"""Return a new selection containing all nodes of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import prepare_full_example_2
... | [
"def",
"search_nodenames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
",",
"name",
":",
"str",
"=",
"'nodenames'",
")",
"->",
"'Selection'",
":",
"try",
":",
"selection",
"=",
"Selection",
"(",
"name",
")",
"for",
"node",
"in",
"self",
".",
"node... | Return a new selection containing all nodes of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, _ = prepare_full_example_2()
Pass the (sub)strings as positional arguments and, opti... | [
"Return",
"a",
"new",
"selection",
"containing",
"all",
"nodes",
"of",
"the",
"current",
"selection",
"with",
"a",
"name",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L659-L721 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.select_nodenames | def select_nodenames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all nodes with a name
containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
additional in... | python | def select_nodenames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all nodes with a name
containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
additional in... | [
"def",
"select_nodenames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
")",
"->",
"'Selection'",
":",
"self",
".",
"nodes",
"=",
"self",
".",
"search_nodenames",
"(",
"*",
"substrings",
")",
".",
"nodes",
"return",
"self"
] | Restrict the current selection to all nodes with a name
containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
additional information. | [
"Restrict",
"the",
"current",
"selection",
"to",
"all",
"nodes",
"with",
"a",
"name",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
"(",
"does",
"not",
"affect",
"any",
"elements",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L723-L732 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.deselect_nodenames | def deselect_nodenames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all nodes with a name
not containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
addition... | python | def deselect_nodenames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all nodes with a name
not containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
addition... | [
"def",
"deselect_nodenames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
")",
"->",
"'Selection'",
":",
"self",
".",
"nodes",
"-=",
"self",
".",
"search_nodenames",
"(",
"*",
"substrings",
")",
".",
"nodes",
"return",
"self"
] | Restrict the current selection to all nodes with a name
not containing at least one of the given substrings (does not
affect any elements).
See the documentation on method |Selection.search_nodenames| for
additional information. | [
"Restrict",
"the",
"current",
"selection",
"to",
"all",
"nodes",
"with",
"a",
"name",
"not",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
"(",
"does",
"not",
"affect",
"any",
"elements",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L734-L743 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.search_elementnames | def search_elementnames(self, *substrings: str,
name: str = 'elementnames') -> 'Selection':
"""Return a new selection containing all elements of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import pre... | python | def search_elementnames(self, *substrings: str,
name: str = 'elementnames') -> 'Selection':
"""Return a new selection containing all elements of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import pre... | [
"def",
"search_elementnames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
",",
"name",
":",
"str",
"=",
"'elementnames'",
")",
"->",
"'Selection'",
":",
"try",
":",
"selection",
"=",
"Selection",
"(",
"name",
")",
"for",
"element",
"in",
"self",
"."... | Return a new selection containing all elements of the current
selection with a name containing at least one of the given substrings.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, _ = prepare_full_example_2()
Pass the (sub)strings as positional arguments and, o... | [
"Return",
"a",
"new",
"selection",
"containing",
"all",
"elements",
"of",
"the",
"current",
"selection",
"with",
"a",
"name",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L745-L806 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.select_elementnames | def select_elementnames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all elements with a name
containing at least one of the given substrings (does not
affect any nodes).
See the documentation on method |Selection.search_elementnames| for
addition... | python | def select_elementnames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all elements with a name
containing at least one of the given substrings (does not
affect any nodes).
See the documentation on method |Selection.search_elementnames| for
addition... | [
"def",
"select_elementnames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
")",
"->",
"'Selection'",
":",
"self",
".",
"elements",
"=",
"self",
".",
"search_elementnames",
"(",
"*",
"substrings",
")",
".",
"elements",
"return",
"self"
] | Restrict the current selection to all elements with a name
containing at least one of the given substrings (does not
affect any nodes).
See the documentation on method |Selection.search_elementnames| for
additional information. | [
"Restrict",
"the",
"current",
"selection",
"to",
"all",
"elements",
"with",
"a",
"name",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
"(",
"does",
"not",
"affect",
"any",
"nodes",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L808-L817 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.deselect_elementnames | def deselect_elementnames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all elements with a name
not containing at least one of the given substrings. (does
not affect any nodes).
See the documentation on method |Selection.search_elementnames| for
... | python | def deselect_elementnames(self, *substrings: str) -> 'Selection':
"""Restrict the current selection to all elements with a name
not containing at least one of the given substrings. (does
not affect any nodes).
See the documentation on method |Selection.search_elementnames| for
... | [
"def",
"deselect_elementnames",
"(",
"self",
",",
"*",
"substrings",
":",
"str",
")",
"->",
"'Selection'",
":",
"self",
".",
"elements",
"-=",
"self",
".",
"search_elementnames",
"(",
"*",
"substrings",
")",
".",
"elements",
"return",
"self"
] | Restrict the current selection to all elements with a name
not containing at least one of the given substrings. (does
not affect any nodes).
See the documentation on method |Selection.search_elementnames| for
additional information. | [
"Restrict",
"the",
"current",
"selection",
"to",
"all",
"elements",
"with",
"a",
"name",
"not",
"containing",
"at",
"least",
"one",
"of",
"the",
"given",
"substrings",
".",
"(",
"does",
"not",
"affect",
"any",
"nodes",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L819-L828 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.copy | def copy(self, name: str) -> 'Selection':
"""Return a new |Selection| object with the given name and copies
of the handles |Nodes| and |Elements| objects based on method
|Devices.copy|."""
return type(self)(name, copy.copy(self.nodes), copy.copy(self.elements)) | python | def copy(self, name: str) -> 'Selection':
"""Return a new |Selection| object with the given name and copies
of the handles |Nodes| and |Elements| objects based on method
|Devices.copy|."""
return type(self)(name, copy.copy(self.nodes), copy.copy(self.elements)) | [
"def",
"copy",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"'Selection'",
":",
"return",
"type",
"(",
"self",
")",
"(",
"name",
",",
"copy",
".",
"copy",
"(",
"self",
".",
"nodes",
")",
",",
"copy",
".",
"copy",
"(",
"self",
".",
"elements",... | Return a new |Selection| object with the given name and copies
of the handles |Nodes| and |Elements| objects based on method
|Devices.copy|. | [
"Return",
"a",
"new",
"|Selection|",
"object",
"with",
"the",
"given",
"name",
"and",
"copies",
"of",
"the",
"handles",
"|Nodes|",
"and",
"|Elements|",
"objects",
"based",
"on",
"method",
"|Devices",
".",
"copy|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L830-L834 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.save_networkfile | def save_networkfile(self, filepath: Union[str, None] = None,
write_nodes: bool = True) -> None:
"""Save the selection as a network file.
>>> from hydpy.core.examples import prepare_full_example_2
>>> _, pub, TestIO = prepare_full_example_2()
In most cases, one... | python | def save_networkfile(self, filepath: Union[str, None] = None,
write_nodes: bool = True) -> None:
"""Save the selection as a network file.
>>> from hydpy.core.examples import prepare_full_example_2
>>> _, pub, TestIO = prepare_full_example_2()
In most cases, one... | [
"def",
"save_networkfile",
"(",
"self",
",",
"filepath",
":",
"Union",
"[",
"str",
",",
"None",
"]",
"=",
"None",
",",
"write_nodes",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"if",
"filepath",
"is",
"None",
":",
"filepath",
"=",
"self",
".",... | Save the selection as a network file.
>>> from hydpy.core.examples import prepare_full_example_2
>>> _, pub, TestIO = prepare_full_example_2()
In most cases, one should conveniently write network files via method
|NetworkManager.save_files| of class |NetworkManager|. However,
... | [
"Save",
"the",
"selection",
"as",
"a",
"network",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L836-L901 | train |
hydpy-dev/hydpy | hydpy/core/selectiontools.py | Selection.assignrepr | def assignrepr(self, prefix: str) -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with hydpy.pub.options.ellipsis(2, optional=True):
with objecttools.assignrepr_tuple.always_bracketed(False):
... | python | def assignrepr(self, prefix: str) -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with hydpy.pub.options.ellipsis(2, optional=True):
with objecttools.assignrepr_tuple.always_bracketed(False):
... | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
":",
"str",
")",
"->",
"str",
":",
"with",
"objecttools",
".",
"repr_",
".",
"preserve_strings",
"(",
"True",
")",
":",
"with",
"hydpy",
".",
"pub",
".",
"options",
".",
"ellipsis",
"(",
"2",
",",
"opt... | Return a |repr| string with a prefixed assignment. | [
"Return",
"a",
"|repr|",
"string",
"with",
"a",
"prefixed",
"assignment",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/selectiontools.py#L957-L970 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_qpin_v1 | def calc_qpin_v1(self):
"""Calculate the input discharge portions of the different response
functions.
Required derived parameters:
|Nmb|
|MaxQ|
|DiffQ|
Required flux sequence:
|QIn|
Calculated flux sequences:
|QPIn|
Examples:
Initialize an arma model w... | python | def calc_qpin_v1(self):
"""Calculate the input discharge portions of the different response
functions.
Required derived parameters:
|Nmb|
|MaxQ|
|DiffQ|
Required flux sequence:
|QIn|
Calculated flux sequences:
|QPIn|
Examples:
Initialize an arma model w... | [
"def",
"calc_qpin_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"idx",
"in",
"range",
"(",
"der",
".",
"nmb",
"-",
... | Calculate the input discharge portions of the different response
functions.
Required derived parameters:
|Nmb|
|MaxQ|
|DiffQ|
Required flux sequence:
|QIn|
Calculated flux sequences:
|QPIn|
Examples:
Initialize an arma model with three different response fu... | [
"Calculate",
"the",
"input",
"discharge",
"portions",
"of",
"the",
"different",
"response",
"functions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L10-L95 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_login_v1 | def calc_login_v1(self):
"""Refresh the input log sequence for the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
Required flux sequence:
|QPIn|
Updated log sequence:
|LogIn|
Example:
Assume there are three response functions, involving one... | python | def calc_login_v1(self):
"""Refresh the input log sequence for the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
Required flux sequence:
|QPIn|
Updated log sequence:
|LogIn|
Example:
Assume there are three response functions, involving one... | [
"def",
"calc_login_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fa... | Refresh the input log sequence for the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
Required flux sequence:
|QPIn|
Updated log sequence:
|LogIn|
Example:
Assume there are three response functions, involving one, two and
three MA coeff... | [
"Refresh",
"the",
"input",
"log",
"sequence",
"for",
"the",
"different",
"MA",
"processes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L98-L155 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_qma_v1 | def calc_qma_v1(self):
"""Calculate the discharge responses of the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
|MA_Coefs|
Required log sequence:
|LogIn|
Calculated flux sequence:
|QMA|
Examples:
Assume there are three response func... | python | def calc_qma_v1(self):
"""Calculate the discharge responses of the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
|MA_Coefs|
Required log sequence:
|LogIn|
Calculated flux sequence:
|QMA|
Examples:
Assume there are three response func... | [
"def",
"calc_qma_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fast... | Calculate the discharge responses of the different MA processes.
Required derived parameters:
|Nmb|
|MA_Order|
|MA_Coefs|
Required log sequence:
|LogIn|
Calculated flux sequence:
|QMA|
Examples:
Assume there are three response functions, involving one, two and
... | [
"Calculate",
"the",
"discharge",
"responses",
"of",
"the",
"different",
"MA",
"processes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L158-L216 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_qar_v1 | def calc_qar_v1(self):
"""Calculate the discharge responses of the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
|AR_Coefs|
Required log sequence:
|LogOut|
Calculated flux sequence:
|QAR|
Examples:
Assume there are four response func... | python | def calc_qar_v1(self):
"""Calculate the discharge responses of the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
|AR_Coefs|
Required log sequence:
|LogOut|
Calculated flux sequence:
|QAR|
Examples:
Assume there are four response func... | [
"def",
"calc_qar_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fast... | Calculate the discharge responses of the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
|AR_Coefs|
Required log sequence:
|LogOut|
Calculated flux sequence:
|QAR|
Examples:
Assume there are four response functions, involving zero, one, tw... | [
"Calculate",
"the",
"discharge",
"responses",
"of",
"the",
"different",
"AR",
"processes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L219-L281 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_qpout_v1 | def calc_qpout_v1(self):
"""Calculate the ARMA results for the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QMA|
|QAR|
Calculated flux sequence:
|QPOut|
Examples:
Initialize an arma model with three different response ... | python | def calc_qpout_v1(self):
"""Calculate the ARMA results for the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QMA|
|QAR|
Calculated flux sequence:
|QPOut|
Examples:
Initialize an arma model with three different response ... | [
"def",
"calc_qpout_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"idx",
"in",
"range",
"(",
"der",
".",
"nmb",
")",
... | Calculate the ARMA results for the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QMA|
|QAR|
Calculated flux sequence:
|QPOut|
Examples:
Initialize an arma model with three different response functions:
>>> from hyd... | [
"Calculate",
"the",
"ARMA",
"results",
"for",
"the",
"different",
"response",
"functions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L284-L321 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_logout_v1 | def calc_logout_v1(self):
"""Refresh the log sequence for the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
Required flux sequence:
|QPOut|
Updated log sequence:
|LogOut|
Example:
Assume there are four response functions, involving zero, o... | python | def calc_logout_v1(self):
"""Refresh the log sequence for the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
Required flux sequence:
|QPOut|
Updated log sequence:
|LogOut|
Example:
Assume there are four response functions, involving zero, o... | [
"def",
"calc_logout_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"f... | Refresh the log sequence for the different AR processes.
Required derived parameters:
|Nmb|
|AR_Order|
Required flux sequence:
|QPOut|
Updated log sequence:
|LogOut|
Example:
Assume there are four response functions, involving zero, one, two
and three AR coef... | [
"Refresh",
"the",
"log",
"sequence",
"for",
"the",
"different",
"AR",
"processes",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L324-L387 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | calc_qout_v1 | def calc_qout_v1(self):
"""Sum up the results of the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QPOut|
Calculated flux sequence:
|QOut|
Examples:
Initialize an arma model with three different response functions:
>... | python | def calc_qout_v1(self):
"""Sum up the results of the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QPOut|
Calculated flux sequence:
|QOut|
Examples:
Initialize an arma model with three different response functions:
>... | [
"def",
"calc_qout_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"qout",
"=",
"0.",
"for",
"idx",
"in",
"range",
... | Sum up the results of the different response functions.
Required derived parameter:
|Nmb|
Required flux sequences:
|QPOut|
Calculated flux sequence:
|QOut|
Examples:
Initialize an arma model with three different response functions:
>>> from hydpy.models.arma impor... | [
"Sum",
"up",
"the",
"results",
"of",
"the",
"different",
"response",
"functions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L390-L423 | train |
hydpy-dev/hydpy | hydpy/models/arma/arma_model.py | pick_q_v1 | def pick_q_v1(self):
"""Update inflow."""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.qin = 0.
for idx in range(inl.len_q):
flu.qin += inl.q[idx][0] | python | def pick_q_v1(self):
"""Update inflow."""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.qin = 0.
for idx in range(inl.len_q):
flu.qin += inl.q[idx][0] | [
"def",
"pick_q_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"qin",
"=",
"0.",
"for",
"idx",
"in",
"range",
"(",... | Update inflow. | [
"Update",
"inflow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_model.py#L426-L432 | train |
hydpy-dev/hydpy | hydpy/models/hbranch/hbranch_derived.py | NmbBranches.update | def update(self):
"""Determine the number of branches"""
con = self.subpars.pars.control
self(con.ypoints.shape[0]) | python | def update(self):
"""Determine the number of branches"""
con = self.subpars.pars.control
self(con.ypoints.shape[0]) | [
"def",
"update",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
"self",
"(",
"con",
".",
"ypoints",
".",
"shape",
"[",
"0",
"]",
")"
] | Determine the number of branches | [
"Determine",
"the",
"number",
"of",
"branches"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hbranch/hbranch_derived.py#L14-L17 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_derived.py | HV.update | def update(self):
"""Update value based on :math:`HV=BBV/BNV`.
Required Parameters:
|BBV|
|BNV|
Examples:
>>> from hydpy.models.lstream import *
>>> parameterstep('1d')
>>> bbv(left=10., right=40.)
>>> bnv(left=10., right=... | python | def update(self):
"""Update value based on :math:`HV=BBV/BNV`.
Required Parameters:
|BBV|
|BNV|
Examples:
>>> from hydpy.models.lstream import *
>>> parameterstep('1d')
>>> bbv(left=10., right=40.)
>>> bnv(left=10., right=... | [
"def",
"update",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
"self",
"(",
"0.",
")",
"for",
"idx",
"in",
"range",
"(",
"2",
")",
":",
"if",
"(",
"con",
".",
"bbv",
"[",
"idx",
"]",
">",
"0.",
")",
... | Update value based on :math:`HV=BBV/BNV`.
Required Parameters:
|BBV|
|BNV|
Examples:
>>> from hydpy.models.lstream import *
>>> parameterstep('1d')
>>> bbv(left=10., right=40.)
>>> bnv(left=10., right=20.)
>>> derived.... | [
"Update",
"value",
"based",
"on",
":",
"math",
":",
"HV",
"=",
"BBV",
"/",
"BNV",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_derived.py#L14-L39 | train |
hydpy-dev/hydpy | hydpy/models/lstream/lstream_derived.py | QM.update | def update(self):
"""Update value based on the actual |calc_qg_v1| method.
Required derived parameter:
|H|
Note that the value of parameter |lstream_derived.QM| is directly
related to the value of parameter |HM| and indirectly related to
all parameters values releva... | python | def update(self):
"""Update value based on the actual |calc_qg_v1| method.
Required derived parameter:
|H|
Note that the value of parameter |lstream_derived.QM| is directly
related to the value of parameter |HM| and indirectly related to
all parameters values releva... | [
"def",
"update",
"(",
"self",
")",
":",
"mod",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"model",
"con",
"=",
"mod",
".",
"parameters",
".",
"control",
"flu",
"=",
"mod",
".",
"sequences",
".",
"fluxes",
"flu",
".",
"h",
"=",
"con",
".",
"hm... | Update value based on the actual |calc_qg_v1| method.
Required derived parameter:
|H|
Note that the value of parameter |lstream_derived.QM| is directly
related to the value of parameter |HM| and indirectly related to
all parameters values relevant for method |calc_qg_v1|. H... | [
"Update",
"value",
"based",
"on",
"the",
"actual",
"|calc_qg_v1|",
"method",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lstream/lstream_derived.py#L47-L66 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_derived.py | NmbSegments.update | def update(self):
"""Determines in how many segments the whole reach needs to be
divided to approximate the desired lag time via integer rounding.
Adjusts the shape of sequence |QJoints| additionally.
Required control parameters:
|Lag|
Calculated derived parameters:
... | python | def update(self):
"""Determines in how many segments the whole reach needs to be
divided to approximate the desired lag time via integer rounding.
Adjusts the shape of sequence |QJoints| additionally.
Required control parameters:
|Lag|
Calculated derived parameters:
... | [
"def",
"update",
"(",
"self",
")",
":",
"pars",
"=",
"self",
".",
"subpars",
".",
"pars",
"self",
"(",
"int",
"(",
"round",
"(",
"pars",
".",
"control",
".",
"lag",
")",
")",
")",
"pars",
".",
"model",
".",
"sequences",
".",
"states",
".",
"qjoin... | Determines in how many segments the whole reach needs to be
divided to approximate the desired lag time via integer rounding.
Adjusts the shape of sequence |QJoints| additionally.
Required control parameters:
|Lag|
Calculated derived parameters:
|NmbSegments|
... | [
"Determines",
"in",
"how",
"many",
"segments",
"the",
"whole",
"reach",
"needs",
"to",
"be",
"divided",
"to",
"approximate",
"the",
"desired",
"lag",
"time",
"via",
"integer",
"rounding",
".",
"Adjusts",
"the",
"shape",
"of",
"sequence",
"|QJoints|",
"addition... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_derived.py#L16-L60 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_derived.py | C1.update | def update(self):
"""Update |C1| based on :math:`c_1 = \\frac{Damp}{1+Damp}`.
Examples:
The first examples show the calculated value of |C1| for
the lowest possible value of |Lag|, the lowest possible value,
and an intermediate value:
>>> from hydpy.mod... | python | def update(self):
"""Update |C1| based on :math:`c_1 = \\frac{Damp}{1+Damp}`.
Examples:
The first examples show the calculated value of |C1| for
the lowest possible value of |Lag|, the lowest possible value,
and an intermediate value:
>>> from hydpy.mod... | [
"def",
"update",
"(",
"self",
")",
":",
"damp",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"damp",
"self",
"(",
"numpy",
".",
"clip",
"(",
"damp",
"/",
"(",
"1.",
"+",
"damp",
")",
",",
"0.",
",",
".5",
")",
")"
] | Update |C1| based on :math:`c_1 = \\frac{Damp}{1+Damp}`.
Examples:
The first examples show the calculated value of |C1| for
the lowest possible value of |Lag|, the lowest possible value,
and an intermediate value:
>>> from hydpy.models.hstream import *
... | [
"Update",
"|C1|",
"based",
"on",
":",
"math",
":",
"c_1",
"=",
"\\\\",
"frac",
"{",
"Damp",
"}",
"{",
"1",
"+",
"Damp",
"}",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_derived.py#L67-L102 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_derived.py | C2.update | def update(self):
"""Update |C2| based on :math:`c_2 = 1.-c_1-c_3`.
Examples:
The following examples show the calculated value of |C2| are
clipped when to low or to high:
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> der... | python | def update(self):
"""Update |C2| based on :math:`c_2 = 1.-c_1-c_3`.
Examples:
The following examples show the calculated value of |C2| are
clipped when to low or to high:
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> der... | [
"def",
"update",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"subpars",
"self",
"(",
"numpy",
".",
"clip",
"(",
"1.",
"-",
"der",
".",
"c1",
"-",
"der",
".",
"c3",
",",
"0.",
",",
"1.",
")",
")"
] | Update |C2| based on :math:`c_2 = 1.-c_1-c_3`.
Examples:
The following examples show the calculated value of |C2| are
clipped when to low or to high:
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> derived.c1 = 0.6
>>>... | [
"Update",
"|C2|",
"based",
"on",
":",
"math",
":",
"c_2",
"=",
"1",
".",
"-",
"c_1",
"-",
"c_3",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_derived.py#L109-L134 | train |
TabViewer/gtabview | gtabview/__init__.py | view | def view(data, enc=None, start_pos=None, delimiter=None, hdr_rows=None,
idx_cols=None, sheet_index=0, transpose=False, wait=None,
recycle=None, detach=None, metavar=None, title=None):
"""View the supplied data in an interactive, graphical table widget.
data: When a valid path or IO object, re... | python | def view(data, enc=None, start_pos=None, delimiter=None, hdr_rows=None,
idx_cols=None, sheet_index=0, transpose=False, wait=None,
recycle=None, detach=None, metavar=None, title=None):
"""View the supplied data in an interactive, graphical table widget.
data: When a valid path or IO object, re... | [
"def",
"view",
"(",
"data",
",",
"enc",
"=",
"None",
",",
"start_pos",
"=",
"None",
",",
"delimiter",
"=",
"None",
",",
"hdr_rows",
"=",
"None",
",",
"idx_cols",
"=",
"None",
",",
"sheet_index",
"=",
"0",
",",
"transpose",
"=",
"False",
",",
"wait",
... | View the supplied data in an interactive, graphical table widget.
data: When a valid path or IO object, read it as a tabular text file. When
a valid URI, a Blaze object is constructed and visualized. Any other
supported datatype is visualized directly and incrementally *without
copyin... | [
"View",
"the",
"supplied",
"data",
"in",
"an",
"interactive",
"graphical",
"table",
"widget",
"."
] | 14ba391f0b225a1bf32d52b640a47b580f8b1b28 | https://github.com/TabViewer/gtabview/blob/14ba391f0b225a1bf32d52b640a47b580f8b1b28/gtabview/__init__.py#L120-L211 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | gather_registries | def gather_registries() -> Tuple[Dict, Mapping, Mapping]:
"""Get and clear the current |Node| and |Element| registries.
Function |gather_registries| is thought to be used by class |Tester| only.
"""
id2devices = copy.copy(_id2devices)
registry = copy.copy(_registry)
selection = copy.copy(_selec... | python | def gather_registries() -> Tuple[Dict, Mapping, Mapping]:
"""Get and clear the current |Node| and |Element| registries.
Function |gather_registries| is thought to be used by class |Tester| only.
"""
id2devices = copy.copy(_id2devices)
registry = copy.copy(_registry)
selection = copy.copy(_selec... | [
"def",
"gather_registries",
"(",
")",
"->",
"Tuple",
"[",
"Dict",
",",
"Mapping",
",",
"Mapping",
"]",
":",
"id2devices",
"=",
"copy",
".",
"copy",
"(",
"_id2devices",
")",
"registry",
"=",
"copy",
".",
"copy",
"(",
"_registry",
")",
"selection",
"=",
... | Get and clear the current |Node| and |Element| registries.
Function |gather_registries| is thought to be used by class |Tester| only. | [
"Get",
"and",
"clear",
"the",
"current",
"|Node|",
"and",
"|Element|",
"registries",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2287-L2299 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | reset_registries | def reset_registries(dicts: Tuple[Dict, Mapping, Mapping]):
"""Reset the current |Node| and |Element| registries.
Function |reset_registries| is thought to be used by class |Tester| only.
"""
dict_ = globals()
dict_['_id2devices'] = dicts[0]
dict_['_registry'] = dicts[1]
dict_['_selection']... | python | def reset_registries(dicts: Tuple[Dict, Mapping, Mapping]):
"""Reset the current |Node| and |Element| registries.
Function |reset_registries| is thought to be used by class |Tester| only.
"""
dict_ = globals()
dict_['_id2devices'] = dicts[0]
dict_['_registry'] = dicts[1]
dict_['_selection']... | [
"def",
"reset_registries",
"(",
"dicts",
":",
"Tuple",
"[",
"Dict",
",",
"Mapping",
",",
"Mapping",
"]",
")",
":",
"dict_",
"=",
"globals",
"(",
")",
"dict_",
"[",
"'_id2devices'",
"]",
"=",
"dicts",
"[",
"0",
"]",
"dict_",
"[",
"'_registry'",
"]",
"... | Reset the current |Node| and |Element| registries.
Function |reset_registries| is thought to be used by class |Tester| only. | [
"Reset",
"the",
"current",
"|Node|",
"and",
"|Element|",
"registries",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2302-L2310 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | _get_pandasindex | def _get_pandasindex():
"""
>>> from hydpy import pub
>>> pub.timegrids = '2004.01.01', '2005.01.01', '1d'
>>> from hydpy.core.devicetools import _get_pandasindex
>>> _get_pandasindex() # doctest: +ELLIPSIS
DatetimeIndex(['2004-01-01 12:00:00', '2004-01-02 12:00:00',
...
... | python | def _get_pandasindex():
"""
>>> from hydpy import pub
>>> pub.timegrids = '2004.01.01', '2005.01.01', '1d'
>>> from hydpy.core.devicetools import _get_pandasindex
>>> _get_pandasindex() # doctest: +ELLIPSIS
DatetimeIndex(['2004-01-01 12:00:00', '2004-01-02 12:00:00',
...
... | [
"def",
"_get_pandasindex",
"(",
")",
":",
"tg",
"=",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"shift",
"=",
"tg",
".",
"stepsize",
"/",
"2",
"index",
"=",
"pandas",
".",
"date_range",
"(",
"(",
"tg",
".",
"firstdate",
"+",
"shift",
")",
... | >>> from hydpy import pub
>>> pub.timegrids = '2004.01.01', '2005.01.01', '1d'
>>> from hydpy.core.devicetools import _get_pandasindex
>>> _get_pandasindex() # doctest: +ELLIPSIS
DatetimeIndex(['2004-01-01 12:00:00', '2004-01-02 12:00:00',
...
'2004-12-30 12:00:00', '2004-12-31 ... | [
">>>",
"from",
"hydpy",
"import",
"pub",
">>>",
"pub",
".",
"timegrids",
"=",
"2004",
".",
"01",
".",
"01",
"2005",
".",
"01",
".",
"01",
"1d",
">>>",
"from",
"hydpy",
".",
"core",
".",
"devicetools",
"import",
"_get_pandasindex",
">>>",
"_get_pandasinde... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2313-L2330 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Keywords.startswith | def startswith(self, name: str) -> List[str]:
"""Return a list of all keywords starting with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | python | def startswith(self, name: str) -> List[str]:
"""Return a list of all keywords starting with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | [
"def",
"startswith",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"sorted",
"(",
"keyword",
"for",
"keyword",
"in",
"self",
"if",
"keyword",
".",
"startswith",
"(",
"name",
")",
")"
] | Return a list of all keywords starting with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... 'keyboard')
>>> keywords.startswith(... | [
"Return",
"a",
"list",
"of",
"all",
"keywords",
"starting",
"with",
"the",
"given",
"string",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L122-L132 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Keywords.endswith | def endswith(self, name: str) -> List[str]:
"""Return a list of all keywords ending with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | python | def endswith(self, name: str) -> List[str]:
"""Return a list of all keywords ending with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | [
"def",
"endswith",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"sorted",
"(",
"keyword",
"for",
"keyword",
"in",
"self",
"if",
"keyword",
".",
"endswith",
"(",
"name",
")",
")"
] | Return a list of all keywords ending with the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... 'keyboard')
>>> keywords.endswith('key... | [
"Return",
"a",
"list",
"of",
"all",
"keywords",
"ending",
"with",
"the",
"given",
"string",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L134-L144 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Keywords.contains | def contains(self, name: str) -> List[str]:
"""Return a list of all keywords containing the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | python | def contains(self, name: str) -> List[str]:
"""Return a list of all keywords containing the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... ... | [
"def",
"contains",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"sorted",
"(",
"keyword",
"for",
"keyword",
"in",
"self",
"if",
"name",
"in",
"keyword",
")"
] | Return a list of all keywords containing the given string.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... 'keyboard')
>>> keywords.contains('keyw... | [
"Return",
"a",
"list",
"of",
"all",
"keywords",
"containing",
"the",
"given",
"string",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L146-L156 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Keywords.update | def update(self, *names: Any) -> None:
"""Before updating, the given names are checked to be valid
variable identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... | python | def update(self, *names: Any) -> None:
"""Before updating, the given names are checked to be valid
variable identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... | [
"def",
"update",
"(",
"self",
",",
"*",
"names",
":",
"Any",
")",
"->",
"None",
":",
"_names",
"=",
"[",
"str",
"(",
"name",
")",
"for",
"name",
"in",
"names",
"]",
"self",
".",
"_check_keywords",
"(",
"_names",
")",
"super",
"(",
")",
".",
"upda... | Before updating, the given names are checked to be valid
variable identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... 'keyboard')
... | [
"Before",
"updating",
"the",
"given",
"names",
"are",
"checked",
"to",
"be",
"valid",
"variable",
"identifiers",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L167-L198 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Keywords.add | def add(self, name: Any) -> None:
"""Before adding a new name, it is checked to be valid variable
identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
...... | python | def add(self, name: Any) -> None:
"""Before adding a new name, it is checked to be valid variable
identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
...... | [
"def",
"add",
"(",
"self",
",",
"name",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"_check_keywords",
"(",
"[",
"str",
"(",
"name",
")",
"]",
")",
"super",
"(",
")",
".",
"add",
"(",
"str",
"(",
"name",
")",
")"
] | Before adding a new name, it is checked to be valid variable
identifiers.
>>> from hydpy.core.devicetools import Keywords
>>> keywords = Keywords('first_keyword', 'second_keyword',
... 'keyword_3', 'keyword_4',
... 'keyboard')
>>> ... | [
"Before",
"adding",
"a",
"new",
"name",
"it",
"is",
"checked",
"to",
"be",
"valid",
"variable",
"identifiers",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L200-L227 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Devices.add_device | def add_device(self, device: Union[DeviceType, str]) -> None:
"""Add the given |Node| or |Element| object to the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Nodes
>>> nodes = Nodes()
>>> nodes.add_device('old_node... | python | def add_device(self, device: Union[DeviceType, str]) -> None:
"""Add the given |Node| or |Element| object to the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Nodes
>>> nodes = Nodes()
>>> nodes.add_device('old_node... | [
"def",
"add_device",
"(",
"self",
",",
"device",
":",
"Union",
"[",
"DeviceType",
",",
"str",
"]",
")",
"->",
"None",
":",
"try",
":",
"if",
"self",
".",
"mutable",
":",
"_device",
"=",
"self",
".",
"get_contentclass",
"(",
")",
"(",
"device",
")",
... | Add the given |Node| or |Element| object to the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Nodes
>>> nodes = Nodes()
>>> nodes.add_device('old_node')
>>> nodes
Nodes("old_node")
>>> nodes.add_devi... | [
"Add",
"the",
"given",
"|Node|",
"or",
"|Element|",
"object",
"to",
"the",
"actual",
"|Nodes|",
"or",
"|Elements|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L404-L442 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Devices.remove_device | def remove_device(self, device: Union[DeviceType, str]) -> None:
"""Remove the given |Node| or |Element| object from the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Node, Nodes
>>> nodes = Nodes('node_x', 'node_y')
... | python | def remove_device(self, device: Union[DeviceType, str]) -> None:
"""Remove the given |Node| or |Element| object from the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Node, Nodes
>>> nodes = Nodes('node_x', 'node_y')
... | [
"def",
"remove_device",
"(",
"self",
",",
"device",
":",
"Union",
"[",
"DeviceType",
",",
"str",
"]",
")",
"->",
"None",
":",
"try",
":",
"if",
"self",
".",
"mutable",
":",
"_device",
"=",
"self",
".",
"get_contentclass",
"(",
")",
"(",
"device",
")"... | Remove the given |Node| or |Element| object from the actual
|Nodes| or |Elements| object.
You can pass either a string or a device:
>>> from hydpy import Node, Nodes
>>> nodes = Nodes('node_x', 'node_y')
>>> node_x, node_y = nodes
>>> nodes.remove_device(Node('node_y'))... | [
"Remove",
"the",
"given",
"|Node|",
"or",
"|Element|",
"object",
"from",
"the",
"actual",
"|Nodes|",
"or",
"|Elements|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L444-L494 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Devices.keywords | def keywords(self) -> Set[str]:
"""A set of all keywords of all handled devices.
In addition to attribute access via device names, |Nodes| and
|Elements| objects allow for attribute access via keywords,
allowing for an efficient search of certain groups of devices.
Let us use th... | python | def keywords(self) -> Set[str]:
"""A set of all keywords of all handled devices.
In addition to attribute access via device names, |Nodes| and
|Elements| objects allow for attribute access via keywords,
allowing for an efficient search of certain groups of devices.
Let us use th... | [
"def",
"keywords",
"(",
"self",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"return",
"set",
"(",
"keyword",
"for",
"device",
"in",
"self",
"for",
"keyword",
"in",
"device",
".",
"keywords",
"if",
"keyword",
"not",
"in",
"self",
".",
"_shadowed_keywords",
... | A set of all keywords of all handled devices.
In addition to attribute access via device names, |Nodes| and
|Elements| objects allow for attribute access via keywords,
allowing for an efficient search of certain groups of devices.
Let us use the example from above, where the nodes `na` ... | [
"A",
"set",
"of",
"all",
"keywords",
"of",
"all",
"handled",
"devices",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L520-L575 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Devices.copy | def copy(self: DevicesTypeBound) -> DevicesTypeBound:
"""Return a shallow copy of the actual |Nodes| or |Elements| object.
Method |Devices.copy| returns a semi-flat copy of |Nodes| or
|Elements| objects, due to their devices being not copyable:
>>> from hydpy import Nodes
>>> o... | python | def copy(self: DevicesTypeBound) -> DevicesTypeBound:
"""Return a shallow copy of the actual |Nodes| or |Elements| object.
Method |Devices.copy| returns a semi-flat copy of |Nodes| or
|Elements| objects, due to their devices being not copyable:
>>> from hydpy import Nodes
>>> o... | [
"def",
"copy",
"(",
"self",
":",
"DevicesTypeBound",
")",
"->",
"DevicesTypeBound",
":",
"new",
"=",
"type",
"(",
"self",
")",
"(",
")",
"vars",
"(",
"new",
")",
".",
"update",
"(",
"vars",
"(",
"self",
")",
")",
"vars",
"(",
"new",
")",
"[",
"'_... | Return a shallow copy of the actual |Nodes| or |Elements| object.
Method |Devices.copy| returns a semi-flat copy of |Nodes| or
|Elements| objects, due to their devices being not copyable:
>>> from hydpy import Nodes
>>> old = Nodes('x', 'y')
>>> import copy
>>> new = co... | [
"Return",
"a",
"shallow",
"copy",
"of",
"the",
"actual",
"|Nodes|",
"or",
"|Elements|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L589-L632 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Nodes.prepare_allseries | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Call methods |Node.prepare_simseries| and
|Node.prepare_obsseries|."""
self.prepare_simseries(ramflag)
self.prepare_obsseries(ramflag) | python | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Call methods |Node.prepare_simseries| and
|Node.prepare_obsseries|."""
self.prepare_simseries(ramflag)
self.prepare_obsseries(ramflag) | [
"def",
"prepare_allseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"prepare_simseries",
"(",
"ramflag",
")",
"self",
".",
"prepare_obsseries",
"(",
"ramflag",
")"
] | Call methods |Node.prepare_simseries| and
|Node.prepare_obsseries|. | [
"Call",
"methods",
"|Node",
".",
"prepare_simseries|",
"and",
"|Node",
".",
"prepare_obsseries|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L814-L818 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Nodes.prepare_simseries | def prepare_simseries(self, ramflag: bool = True) -> None:
"""Call method |Node.prepare_simseries| of all handled
|Node| objects."""
for node in printtools.progressbar(self):
node.prepare_simseries(ramflag) | python | def prepare_simseries(self, ramflag: bool = True) -> None:
"""Call method |Node.prepare_simseries| of all handled
|Node| objects."""
for node in printtools.progressbar(self):
node.prepare_simseries(ramflag) | [
"def",
"prepare_simseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"node",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"node",
".",
"prepare_simseries",
"(",
"ramflag",
")"
] | Call method |Node.prepare_simseries| of all handled
|Node| objects. | [
"Call",
"method",
"|Node",
".",
"prepare_simseries|",
"of",
"all",
"handled",
"|Node|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L821-L825 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Nodes.prepare_obsseries | def prepare_obsseries(self, ramflag: bool = True) -> None:
"""Call method |Node.prepare_obsseries| of all handled
|Node| objects."""
for node in printtools.progressbar(self):
node.prepare_obsseries(ramflag) | python | def prepare_obsseries(self, ramflag: bool = True) -> None:
"""Call method |Node.prepare_obsseries| of all handled
|Node| objects."""
for node in printtools.progressbar(self):
node.prepare_obsseries(ramflag) | [
"def",
"prepare_obsseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"node",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"node",
".",
"prepare_obsseries",
"(",
"ramflag",
")"
] | Call method |Node.prepare_obsseries| of all handled
|Node| objects. | [
"Call",
"method",
"|Node",
".",
"prepare_obsseries|",
"of",
"all",
"handled",
"|Node|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L828-L832 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.init_models | def init_models(self) -> None:
"""Call method |Element.init_model| of all handle |Element| objects.
We show, based the `LahnH` example project, that method
|Element.init_model| prepares the |Model| objects of all elements,
including building the required connections and updating the
... | python | def init_models(self) -> None:
"""Call method |Element.init_model| of all handle |Element| objects.
We show, based the `LahnH` example project, that method
|Element.init_model| prepares the |Model| objects of all elements,
including building the required connections and updating the
... | [
"def",
"init_models",
"(",
"self",
")",
"->",
"None",
":",
"try",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"init_model",
"(",
"clear_registry",
"=",
"False",
")",
"finally",
":",
"hydpy",
".",
... | Call method |Element.init_model| of all handle |Element| objects.
We show, based the `LahnH` example project, that method
|Element.init_model| prepares the |Model| objects of all elements,
including building the required connections and updating the
derived parameters:
>>> from... | [
"Call",
"method",
"|Element",
".",
"init_model|",
"of",
"all",
"handle",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L907-L973 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.save_controls | def save_controls(self, parameterstep: 'timetools.PeriodConstrArg' = None,
simulationstep: 'timetools.PeriodConstrArg' = None,
auxfiler: 'Optional[auxfiletools.Auxfiler]' = None):
"""Save the control parameters of the |Model| object handled by
each |Element| o... | python | def save_controls(self, parameterstep: 'timetools.PeriodConstrArg' = None,
simulationstep: 'timetools.PeriodConstrArg' = None,
auxfiler: 'Optional[auxfiletools.Auxfiler]' = None):
"""Save the control parameters of the |Model| object handled by
each |Element| o... | [
"def",
"save_controls",
"(",
"self",
",",
"parameterstep",
":",
"'timetools.PeriodConstrArg'",
"=",
"None",
",",
"simulationstep",
":",
"'timetools.PeriodConstrArg'",
"=",
"None",
",",
"auxfiler",
":",
"'Optional[auxfiletools.Auxfiler]'",
"=",
"None",
")",
":",
"if",
... | Save the control parameters of the |Model| object handled by
each |Element| object and eventually the ones handled by the
given |Auxfiler| object. | [
"Save",
"the",
"control",
"parameters",
"of",
"the",
"|Model|",
"object",
"handled",
"by",
"each",
"|Element|",
"object",
"and",
"eventually",
"the",
"ones",
"handled",
"by",
"the",
"given",
"|Auxfiler|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L976-L988 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.load_conditions | def load_conditions(self) -> None:
"""Save the initial conditions of the |Model| object handled by
each |Element| object."""
for element in printtools.progressbar(self):
element.model.sequences.load_conditions() | python | def load_conditions(self) -> None:
"""Save the initial conditions of the |Model| object handled by
each |Element| object."""
for element in printtools.progressbar(self):
element.model.sequences.load_conditions() | [
"def",
"load_conditions",
"(",
"self",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"model",
".",
"sequences",
".",
"load_conditions",
"(",
")"
] | Save the initial conditions of the |Model| object handled by
each |Element| object. | [
"Save",
"the",
"initial",
"conditions",
"of",
"the",
"|Model|",
"object",
"handled",
"by",
"each",
"|Element|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L991-L995 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.save_conditions | def save_conditions(self) -> None:
"""Save the calculated conditions of the |Model| object handled by
each |Element| object."""
for element in printtools.progressbar(self):
element.model.sequences.save_conditions() | python | def save_conditions(self) -> None:
"""Save the calculated conditions of the |Model| object handled by
each |Element| object."""
for element in printtools.progressbar(self):
element.model.sequences.save_conditions() | [
"def",
"save_conditions",
"(",
"self",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"model",
".",
"sequences",
".",
"save_conditions",
"(",
")"
] | Save the calculated conditions of the |Model| object handled by
each |Element| object. | [
"Save",
"the",
"calculated",
"conditions",
"of",
"the",
"|Model|",
"object",
"handled",
"by",
"each",
"|Element|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L998-L1002 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.conditions | def conditions(self) -> \
Dict[str, Dict[str, Dict[str, Union[float, numpy.ndarray]]]]:
"""A nested dictionary containing the values of all
|ConditionSequence| objects of all currently handled models.
See the documentation on property |HydPy.conditions| for further
informati... | python | def conditions(self) -> \
Dict[str, Dict[str, Dict[str, Union[float, numpy.ndarray]]]]:
"""A nested dictionary containing the values of all
|ConditionSequence| objects of all currently handled models.
See the documentation on property |HydPy.conditions| for further
informati... | [
"def",
"conditions",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"Union",
"[",
"float",
",",
"numpy",
".",
"ndarray",
"]",
"]",
"]",
"]",
":",
"return",
"{",
"element",
".",
"name",
":",
"e... | A nested dictionary containing the values of all
|ConditionSequence| objects of all currently handled models.
See the documentation on property |HydPy.conditions| for further
information. | [
"A",
"nested",
"dictionary",
"containing",
"the",
"values",
"of",
"all",
"|ConditionSequence|",
"objects",
"of",
"all",
"currently",
"handled",
"models",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1017-L1026 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.prepare_allseries | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_allseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_allseries(ramflag) | python | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_allseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_allseries(ramflag) | [
"def",
"prepare_allseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"prepare_allseries",
"(",
"ramflag",
")"
] | Call method |Element.prepare_allseries| of all handled
|Element| objects. | [
"Call",
"method",
"|Element",
".",
"prepare_allseries|",
"of",
"all",
"handled",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1039-L1043 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.prepare_inputseries | def prepare_inputseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_inputseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_inputseries(ramflag) | python | def prepare_inputseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_inputseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_inputseries(ramflag) | [
"def",
"prepare_inputseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"prepare_inputseries",
"(",
"ramflag",
")"
] | Call method |Element.prepare_inputseries| of all handled
|Element| objects. | [
"Call",
"method",
"|Element",
".",
"prepare_inputseries|",
"of",
"all",
"handled",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1046-L1050 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.prepare_fluxseries | def prepare_fluxseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_fluxseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_fluxseries(ramflag) | python | def prepare_fluxseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_fluxseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_fluxseries(ramflag) | [
"def",
"prepare_fluxseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"prepare_fluxseries",
"(",
"ramflag",
")"
] | Call method |Element.prepare_fluxseries| of all handled
|Element| objects. | [
"Call",
"method",
"|Element",
".",
"prepare_fluxseries|",
"of",
"all",
"handled",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1053-L1057 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Elements.prepare_stateseries | def prepare_stateseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_stateseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_stateseries(ramflag) | python | def prepare_stateseries(self, ramflag: bool = True) -> None:
"""Call method |Element.prepare_stateseries| of all handled
|Element| objects."""
for element in printtools.progressbar(self):
element.prepare_stateseries(ramflag) | [
"def",
"prepare_stateseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"for",
"element",
"in",
"printtools",
".",
"progressbar",
"(",
"self",
")",
":",
"element",
".",
"prepare_stateseries",
"(",
"ramflag",
")"
] | Call method |Element.prepare_stateseries| of all handled
|Element| objects. | [
"Call",
"method",
"|Element",
".",
"prepare_stateseries|",
"of",
"all",
"handled",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1060-L1064 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Device.extract_new | def extract_new(cls) -> DevicesTypeUnbound:
"""Gather all "new" |Node| or |Element| objects.
See the main documentation on module |devicetools| for further
information.
"""
devices = cls.get_handlerclass()(*_selection[cls])
_selection[cls].clear()
return devices | python | def extract_new(cls) -> DevicesTypeUnbound:
"""Gather all "new" |Node| or |Element| objects.
See the main documentation on module |devicetools| for further
information.
"""
devices = cls.get_handlerclass()(*_selection[cls])
_selection[cls].clear()
return devices | [
"def",
"extract_new",
"(",
"cls",
")",
"->",
"DevicesTypeUnbound",
":",
"devices",
"=",
"cls",
".",
"get_handlerclass",
"(",
")",
"(",
"*",
"_selection",
"[",
"cls",
"]",
")",
"_selection",
"[",
"cls",
"]",
".",
"clear",
"(",
")",
"return",
"devices"
] | Gather all "new" |Node| or |Element| objects.
See the main documentation on module |devicetools| for further
information. | [
"Gather",
"all",
"new",
"|Node|",
"or",
"|Element|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1172-L1180 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Node.get_double | def get_double(self, group: str) -> pointerutils.Double:
"""Return the |Double| object appropriate for the given |Element|
input or output group and the actual |Node.deploymode|.
Method |Node.get_double| should be of interest for framework
developers only (and eventually for model devel... | python | def get_double(self, group: str) -> pointerutils.Double:
"""Return the |Double| object appropriate for the given |Element|
input or output group and the actual |Node.deploymode|.
Method |Node.get_double| should be of interest for framework
developers only (and eventually for model devel... | [
"def",
"get_double",
"(",
"self",
",",
"group",
":",
"str",
")",
"->",
"pointerutils",
".",
"Double",
":",
"if",
"group",
"in",
"(",
"'inlets'",
",",
"'receivers'",
")",
":",
"if",
"self",
".",
"deploymode",
"!=",
"'obs'",
":",
"return",
"self",
".",
... | Return the |Double| object appropriate for the given |Element|
input or output group and the actual |Node.deploymode|.
Method |Node.get_double| should be of interest for framework
developers only (and eventually for model developers).
Let |Node| object `node1` handle different simulati... | [
"Return",
"the",
"|Double|",
"object",
"appropriate",
"for",
"the",
"given",
"|Element|",
"input",
"or",
"output",
"group",
"and",
"the",
"actual",
"|Node",
".",
"deploymode|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1483-L1558 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Node.plot_simseries | def plot_simseries(self, **kwargs: Any) -> None:
"""Plot the |IOSequence.series| of the |Sim| sequence object.
See method |Node.plot_allseries| for further information.
"""
self.__plot_series([self.sequences.sim], kwargs) | python | def plot_simseries(self, **kwargs: Any) -> None:
"""Plot the |IOSequence.series| of the |Sim| sequence object.
See method |Node.plot_allseries| for further information.
"""
self.__plot_series([self.sequences.sim], kwargs) | [
"def",
"plot_simseries",
"(",
"self",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"__plot_series",
"(",
"[",
"self",
".",
"sequences",
".",
"sim",
"]",
",",
"kwargs",
")"
] | Plot the |IOSequence.series| of the |Sim| sequence object.
See method |Node.plot_allseries| for further information. | [
"Plot",
"the",
"|IOSequence",
".",
"series|",
"of",
"the",
"|Sim|",
"sequence",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1668-L1673 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Node.plot_obsseries | def plot_obsseries(self, **kwargs: Any) -> None:
"""Plot the |IOSequence.series| of the |Obs| sequence object.
See method |Node.plot_allseries| for further information.
"""
self.__plot_series([self.sequences.obs], kwargs) | python | def plot_obsseries(self, **kwargs: Any) -> None:
"""Plot the |IOSequence.series| of the |Obs| sequence object.
See method |Node.plot_allseries| for further information.
"""
self.__plot_series([self.sequences.obs], kwargs) | [
"def",
"plot_obsseries",
"(",
"self",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"__plot_series",
"(",
"[",
"self",
".",
"sequences",
".",
"obs",
"]",
",",
"kwargs",
")"
] | Plot the |IOSequence.series| of the |Obs| sequence object.
See method |Node.plot_allseries| for further information. | [
"Plot",
"the",
"|IOSequence",
".",
"series|",
"of",
"the",
"|Obs|",
"sequence",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1675-L1680 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Node.assignrepr | def assignrepr(self, prefix: str = '') -> str:
"""Return a |repr| string with a prefixed assignment."""
lines = ['%sNode("%s", variable="%s",'
% (prefix, self.name, self.variable)]
if self.keywords:
subprefix = '%skeywords=' % (' '*(len(prefix)+5))
with o... | python | def assignrepr(self, prefix: str = '') -> str:
"""Return a |repr| string with a prefixed assignment."""
lines = ['%sNode("%s", variable="%s",'
% (prefix, self.name, self.variable)]
if self.keywords:
subprefix = '%skeywords=' % (' '*(len(prefix)+5))
with o... | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
":",
"str",
"=",
"''",
")",
"->",
"str",
":",
"lines",
"=",
"[",
"'%sNode(\"%s\", variable=\"%s\",'",
"%",
"(",
"prefix",
",",
"self",
".",
"name",
",",
"self",
".",
"variable",
")",
"]",
"if",
"self",
... | Return a |repr| string with a prefixed assignment. | [
"Return",
"a",
"|repr|",
"string",
"with",
"a",
"prefixed",
"assignment",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1703-L1715 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.model | def model(self) -> 'modeltools.Model':
"""The |Model| object handled by the actual |Element| object.
Directly after their initialisation, elements do not know
which model they require:
>>> from hydpy import Element
>>> hland = Element('hland', outlets='outlet')
>>> hlan... | python | def model(self) -> 'modeltools.Model':
"""The |Model| object handled by the actual |Element| object.
Directly after their initialisation, elements do not know
which model they require:
>>> from hydpy import Element
>>> hland = Element('hland', outlets='outlet')
>>> hlan... | [
"def",
"model",
"(",
"self",
")",
"->",
"'modeltools.Model'",
":",
"model",
"=",
"vars",
"(",
"self",
")",
".",
"get",
"(",
"'model'",
")",
"if",
"model",
":",
"return",
"model",
"raise",
"AttributeError",
"(",
"f'The model object of element `{self.name}` has '"... | The |Model| object handled by the actual |Element| object.
Directly after their initialisation, elements do not know
which model they require:
>>> from hydpy import Element
>>> hland = Element('hland', outlets='outlet')
>>> hland.model
Traceback (most recent call last):... | [
"The",
"|Model|",
"object",
"handled",
"by",
"the",
"actual",
"|Element|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L1921-L1992 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.init_model | def init_model(self, clear_registry: bool = True) -> None:
"""Load the control file of the actual |Element| object, initialise
its |Model| object, build the required connections via (an eventually
overridden version of) method |Model.connect| of class |Model|, and
update its derived par... | python | def init_model(self, clear_registry: bool = True) -> None:
"""Load the control file of the actual |Element| object, initialise
its |Model| object, build the required connections via (an eventually
overridden version of) method |Model.connect| of class |Model|, and
update its derived par... | [
"def",
"init_model",
"(",
"self",
",",
"clear_registry",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"try",
":",
"with",
"hydpy",
".",
"pub",
".",
"options",
".",
"warnsimulationstep",
"(",
"False",
")",
":",
"info",
"=",
"hydpy",
".",
"pub",
"... | Load the control file of the actual |Element| object, initialise
its |Model| object, build the required connections via (an eventually
overridden version of) method |Model.connect| of class |Model|, and
update its derived parameter values via calling (an eventually
overridden version) o... | [
"Load",
"the",
"control",
"file",
"of",
"the",
"actual",
"|Element|",
"object",
"initialise",
"its",
"|Model|",
"object",
"build",
"the",
"required",
"connections",
"via",
"(",
"an",
"eventually",
"overridden",
"version",
"of",
")",
"method",
"|Model",
".",
"c... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2004-L2033 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.variables | def variables(self) -> Set[str]:
"""A set of all different |Node.variable| values of the |Node|
objects directly connected to the actual |Element| object.
Suppose there is an element connected to five nodes, which (partly)
represent different variables:
>>> from hydpy import El... | python | def variables(self) -> Set[str]:
"""A set of all different |Node.variable| values of the |Node|
objects directly connected to the actual |Element| object.
Suppose there is an element connected to five nodes, which (partly)
represent different variables:
>>> from hydpy import El... | [
"def",
"variables",
"(",
"self",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"variables",
":",
"Set",
"[",
"str",
"]",
"=",
"set",
"(",
")",
"for",
"connection",
"in",
"self",
".",
"__connections",
":",
"variables",
".",
"update",
"(",
"connection",
".",... | A set of all different |Node.variable| values of the |Node|
objects directly connected to the actual |Element| object.
Suppose there is an element connected to five nodes, which (partly)
represent different variables:
>>> from hydpy import Element, Node
>>> element = Element('T... | [
"A",
"set",
"of",
"all",
"different",
"|Node",
".",
"variable|",
"values",
"of",
"the",
"|Node|",
"objects",
"directly",
"connected",
"to",
"the",
"actual",
"|Element|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2036-L2059 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.prepare_allseries | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Prepare the |IOSequence.series| objects of all `input`, `flux` and
`state` sequences of the model handled by this element.
Call this method before a simulation run, if you need access to
(nearly) all simulated series of the h... | python | def prepare_allseries(self, ramflag: bool = True) -> None:
"""Prepare the |IOSequence.series| objects of all `input`, `flux` and
`state` sequences of the model handled by this element.
Call this method before a simulation run, if you need access to
(nearly) all simulated series of the h... | [
"def",
"prepare_allseries",
"(",
"self",
",",
"ramflag",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"prepare_inputseries",
"(",
"ramflag",
")",
"self",
".",
"prepare_fluxseries",
"(",
"ramflag",
")",
"self",
".",
"prepare_stateseries",
"(... | Prepare the |IOSequence.series| objects of all `input`, `flux` and
`state` sequences of the model handled by this element.
Call this method before a simulation run, if you need access to
(nearly) all simulated series of the handled model after the
simulation run is finished.
By... | [
"Prepare",
"the",
"|IOSequence",
".",
"series|",
"objects",
"of",
"all",
"input",
"flux",
"and",
"state",
"sequences",
"of",
"the",
"model",
"handled",
"by",
"this",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2071-L2085 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.plot_inputseries | def plot_inputseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot (the selected) |InputSequence| |IOSequence.series| values.
We demonstrate the functionalities of method |Element.plot_inputseries|
base... | python | def plot_inputseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot (the selected) |InputSequence| |IOSequence.series| values.
We demonstrate the functionalities of method |Element.plot_inputseries|
base... | [
"def",
"plot_inputseries",
"(",
"self",
",",
"names",
":",
"Optional",
"[",
"Iterable",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"average",
":",
"bool",
"=",
"False",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"__plot"... | Plot (the selected) |InputSequence| |IOSequence.series| values.
We demonstrate the functionalities of method |Element.plot_inputseries|
based on the `Lahn` example project:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, _, _ = prepare_full_example_2(lastdate='1997-0... | [
"Plot",
"(",
"the",
"selected",
")",
"|InputSequence|",
"|IOSequence",
".",
"series|",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2154-L2229 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.plot_fluxseries | def plot_fluxseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot the `flux` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information.
"... | python | def plot_fluxseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot the `flux` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information.
"... | [
"def",
"plot_fluxseries",
"(",
"self",
",",
"names",
":",
"Optional",
"[",
"Iterable",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"average",
":",
"bool",
"=",
"False",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"__plot",... | Plot the `flux` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information. | [
"Plot",
"the",
"flux",
"series",
"of",
"the",
"handled",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2231-L2240 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.plot_stateseries | def plot_stateseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot the `state` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information.
... | python | def plot_stateseries(
self, names: Optional[Iterable[str]] = None,
average: bool = False, **kwargs: Any) \
-> None:
"""Plot the `state` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information.
... | [
"def",
"plot_stateseries",
"(",
"self",
",",
"names",
":",
"Optional",
"[",
"Iterable",
"[",
"str",
"]",
"]",
"=",
"None",
",",
"average",
":",
"bool",
"=",
"False",
",",
"*",
"*",
"kwargs",
":",
"Any",
")",
"->",
"None",
":",
"self",
".",
"__plot"... | Plot the `state` series of the handled model.
See the documentation on method |Element.plot_inputseries| for
additional information. | [
"Plot",
"the",
"state",
"series",
"of",
"the",
"handled",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2242-L2251 | train |
hydpy-dev/hydpy | hydpy/core/devicetools.py | Element.assignrepr | def assignrepr(self, prefix: str) -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with objecttools.assignrepr_tuple.always_bracketed(False):
blanks = ' ' * (len(prefix) + 8)
lines = ['%sElement("%... | python | def assignrepr(self, prefix: str) -> str:
"""Return a |repr| string with a prefixed assignment."""
with objecttools.repr_.preserve_strings(True):
with objecttools.assignrepr_tuple.always_bracketed(False):
blanks = ' ' * (len(prefix) + 8)
lines = ['%sElement("%... | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
":",
"str",
")",
"->",
"str",
":",
"with",
"objecttools",
".",
"repr_",
".",
"preserve_strings",
"(",
"True",
")",
":",
"with",
"objecttools",
".",
"assignrepr_tuple",
".",
"always_bracketed",
"(",
"False",
... | Return a |repr| string with a prefixed assignment. | [
"Return",
"a",
"|repr|",
"string",
"with",
"a",
"prefixed",
"assignment",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/devicetools.py#L2253-L2276 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | Model._init_methods | def _init_methods(self):
"""Convert all pure Python calculation functions of the model class to
methods and assign them to the model instance.
"""
for name_group in self._METHOD_GROUPS:
functions = getattr(self, name_group, ())
uniques = {}
for func in... | python | def _init_methods(self):
"""Convert all pure Python calculation functions of the model class to
methods and assign them to the model instance.
"""
for name_group in self._METHOD_GROUPS:
functions = getattr(self, name_group, ())
uniques = {}
for func in... | [
"def",
"_init_methods",
"(",
"self",
")",
":",
"for",
"name_group",
"in",
"self",
".",
"_METHOD_GROUPS",
":",
"functions",
"=",
"getattr",
"(",
"self",
",",
"name_group",
",",
"(",
")",
")",
"uniques",
"=",
"{",
"}",
"for",
"func",
"in",
"functions",
"... | Convert all pure Python calculation functions of the model class to
methods and assign them to the model instance. | [
"Convert",
"all",
"pure",
"Python",
"calculation",
"functions",
"of",
"the",
"model",
"class",
"to",
"methods",
"and",
"assign",
"them",
"to",
"the",
"model",
"instance",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L47-L65 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | Model.name | def name(self):
"""Name of the model type.
For base models, |Model.name| corresponds to the package name:
>>> from hydpy import prepare_model
>>> hland = prepare_model('hland')
>>> hland.name
'hland'
For application models, |Model.name| corresponds the module n... | python | def name(self):
"""Name of the model type.
For base models, |Model.name| corresponds to the package name:
>>> from hydpy import prepare_model
>>> hland = prepare_model('hland')
>>> hland.name
'hland'
For application models, |Model.name| corresponds the module n... | [
"def",
"name",
"(",
"self",
")",
":",
"name",
"=",
"self",
".",
"__name",
"if",
"name",
":",
"return",
"name",
"subs",
"=",
"self",
".",
"__module__",
".",
"split",
"(",
"'.'",
")",
"if",
"len",
"(",
"subs",
")",
"==",
"2",
":",
"type",
"(",
"s... | Name of the model type.
For base models, |Model.name| corresponds to the package name:
>>> from hydpy import prepare_model
>>> hland = prepare_model('hland')
>>> hland.name
'hland'
For application models, |Model.name| corresponds the module name:
>>> hland_v1 ... | [
"Name",
"of",
"the",
"model",
"type",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L68-L97 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | Model.connect | def connect(self):
"""Connect the link sequences of the actual model."""
try:
for group in ('inlets', 'receivers', 'outlets', 'senders'):
self._connect_subgroup(group)
except BaseException:
objecttools.augment_excmessage(
'While trying to b... | python | def connect(self):
"""Connect the link sequences of the actual model."""
try:
for group in ('inlets', 'receivers', 'outlets', 'senders'):
self._connect_subgroup(group)
except BaseException:
objecttools.augment_excmessage(
'While trying to b... | [
"def",
"connect",
"(",
"self",
")",
":",
"try",
":",
"for",
"group",
"in",
"(",
"'inlets'",
",",
"'receivers'",
",",
"'outlets'",
",",
"'senders'",
")",
":",
"self",
".",
"_connect_subgroup",
"(",
"group",
")",
"except",
"BaseException",
":",
"objecttools"... | Connect the link sequences of the actual model. | [
"Connect",
"the",
"link",
"sequences",
"of",
"the",
"actual",
"model",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L99-L108 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.calculate_single_terms | def calculate_single_terms(self):
"""Apply all methods stored in the hidden attribute
`PART_ODE_METHODS`.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> k(0.25)
>>> states.s = 1.0
>>> model.calculate_single_terms()
>>> fluxes.q
q(0... | python | def calculate_single_terms(self):
"""Apply all methods stored in the hidden attribute
`PART_ODE_METHODS`.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> k(0.25)
>>> states.s = 1.0
>>> model.calculate_single_terms()
>>> fluxes.q
q(0... | [
"def",
"calculate_single_terms",
"(",
"self",
")",
":",
"self",
".",
"numvars",
".",
"nmb_calls",
"=",
"self",
".",
"numvars",
".",
"nmb_calls",
"+",
"1",
"for",
"method",
"in",
"self",
".",
"PART_ODE_METHODS",
":",
"method",
"(",
"self",
")"
] | Apply all methods stored in the hidden attribute
`PART_ODE_METHODS`.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> k(0.25)
>>> states.s = 1.0
>>> model.calculate_single_terms()
>>> fluxes.q
q(0.25) | [
"Apply",
"all",
"methods",
"stored",
"in",
"the",
"hidden",
"attribute",
"PART_ODE_METHODS",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L515-L529 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.get_sum_fluxes | def get_sum_fluxes(self):
"""Get the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.q = 0.0
>>> fluxes.fastaccess._q_sum = 1.0
>>> model.get_sum_fluxes()
>>> fluxes.q
q(1.0)
"""
f... | python | def get_sum_fluxes(self):
"""Get the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.q = 0.0
>>> fluxes.fastaccess._q_sum = 1.0
>>> model.get_sum_fluxes()
>>> fluxes.q
q(1.0)
"""
f... | [
"def",
"get_sum_fluxes",
"(",
"self",
")",
":",
"fluxes",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"for",
"flux",
"in",
"fluxes",
".",
"numerics",
":",
"flux",
"(",
"getattr",
"(",
"fluxes",
".",
"fastaccess",
",",
"'_%s_sum'",
"%",
"flux",
".",
"... | Get the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.q = 0.0
>>> fluxes.fastaccess._q_sum = 1.0
>>> model.get_sum_fluxes()
>>> fluxes.q
q(1.0) | [
"Get",
"the",
"sum",
"of",
"the",
"fluxes",
"calculated",
"so",
"far",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L611-L624 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.integrate_fluxes | def integrate_fluxes(self):
"""Perform a dot multiplication between the fluxes and the
A coefficients associated with the different stages of the
actual method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> model.... | python | def integrate_fluxes(self):
"""Perform a dot multiplication between the fluxes and the
A coefficients associated with the different stages of the
actual method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> model.... | [
"def",
"integrate_fluxes",
"(",
"self",
")",
":",
"fluxes",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"for",
"flux",
"in",
"fluxes",
".",
"numerics",
":",
"points",
"=",
"getattr",
"(",
"fluxes",
".",
"fastaccess",
",",
"'_%s_points'",
"%",
"flux",
"... | Perform a dot multiplication between the fluxes and the
A coefficients associated with the different stages of the
actual method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> model.numvars.idx_stage = 1
>>> model... | [
"Perform",
"a",
"dot",
"multiplication",
"between",
"the",
"fluxes",
"and",
"the",
"A",
"coefficients",
"associated",
"with",
"the",
"different",
"stages",
"of",
"the",
"actual",
"method",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L664-L691 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.reset_sum_fluxes | def reset_sum_fluxes(self):
"""Set the sum of the fluxes calculated so far to zero.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 5.
>>> model.reset_sum_fluxes()
>>> fluxes.fastaccess._q_sum
0.0
"""
flux... | python | def reset_sum_fluxes(self):
"""Set the sum of the fluxes calculated so far to zero.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 5.
>>> model.reset_sum_fluxes()
>>> fluxes.fastaccess._q_sum
0.0
"""
flux... | [
"def",
"reset_sum_fluxes",
"(",
"self",
")",
":",
"fluxes",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"for",
"flux",
"in",
"fluxes",
".",
"numerics",
":",
"if",
"flux",
".",
"NDIM",
"==",
"0",
":",
"setattr",
"(",
"fluxes",
".",
"fastaccess",
",",
... | Set the sum of the fluxes calculated so far to zero.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 5.
>>> model.reset_sum_fluxes()
>>> fluxes.fastaccess._q_sum
0.0 | [
"Set",
"the",
"sum",
"of",
"the",
"fluxes",
"calculated",
"so",
"far",
"to",
"zero",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L693-L708 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.addup_fluxes | def addup_fluxes(self):
"""Add up the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 1.0
>>> fluxes.q(2.0)
>>> model.addup_fluxes()
>>> fluxes.fastaccess._q_sum
3.0
""... | python | def addup_fluxes(self):
"""Add up the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 1.0
>>> fluxes.q(2.0)
>>> model.addup_fluxes()
>>> fluxes.fastaccess._q_sum
3.0
""... | [
"def",
"addup_fluxes",
"(",
"self",
")",
":",
"fluxes",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"for",
"flux",
"in",
"fluxes",
".",
"numerics",
":",
"sum_",
"=",
"getattr",
"(",
"fluxes",
".",
"fastaccess",
",",
"'_%s_sum'",
"%",
"flux",
".",
"na... | Add up the sum of the fluxes calculated so far.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> fluxes.fastaccess._q_sum = 1.0
>>> fluxes.q(2.0)
>>> model.addup_fluxes()
>>> fluxes.fastaccess._q_sum
3.0 | [
"Add",
"up",
"the",
"sum",
"of",
"the",
"fluxes",
"calculated",
"so",
"far",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L710-L726 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.calculate_error | def calculate_error(self):
"""Estimate the numerical error based on the fluxes calculated
by the current and the last method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> results = numpy.asarray(fluxes.fastaccess._q_resu... | python | def calculate_error(self):
"""Estimate the numerical error based on the fluxes calculated
by the current and the last method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> results = numpy.asarray(fluxes.fastaccess._q_resu... | [
"def",
"calculate_error",
"(",
"self",
")",
":",
"self",
".",
"numvars",
".",
"error",
"=",
"0.",
"fluxes",
"=",
"self",
".",
"sequences",
".",
"fluxes",
"for",
"flux",
"in",
"fluxes",
".",
"numerics",
":",
"results",
"=",
"getattr",
"(",
"fluxes",
"."... | Estimate the numerical error based on the fluxes calculated
by the current and the last method.
>>> from hydpy.models.test_v1 import *
>>> parameterstep()
>>> model.numvars.idx_method = 2
>>> results = numpy.asarray(fluxes.fastaccess._q_results)
>>> results[:4] = 0., 3.,... | [
"Estimate",
"the",
"numerical",
"error",
"based",
"on",
"the",
"fluxes",
"calculated",
"by",
"the",
"current",
"and",
"the",
"last",
"method",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L728-L749 | train |
hydpy-dev/hydpy | hydpy/core/modeltools.py | ModelELS.extrapolate_error | def extrapolate_error(self):
"""Estimate the numerical error to be expected when applying all
methods available based on the results of the current and the
last method.
Note that this expolation strategy cannot be applied on the first
method. If the current method is the first ... | python | def extrapolate_error(self):
"""Estimate the numerical error to be expected when applying all
methods available based on the results of the current and the
last method.
Note that this expolation strategy cannot be applied on the first
method. If the current method is the first ... | [
"def",
"extrapolate_error",
"(",
"self",
")",
":",
"if",
"self",
".",
"numvars",
".",
"idx_method",
">",
"2",
":",
"self",
".",
"numvars",
".",
"extrapolated_error",
"=",
"modelutils",
".",
"exp",
"(",
"modelutils",
".",
"log",
"(",
"self",
".",
"numvars... | Estimate the numerical error to be expected when applying all
methods available based on the results of the current and the
last method.
Note that this expolation strategy cannot be applied on the first
method. If the current method is the first one, `-999.9` is returned.
>>> ... | [
"Estimate",
"the",
"numerical",
"error",
"to",
"be",
"expected",
"when",
"applying",
"all",
"methods",
"available",
"based",
"on",
"the",
"results",
"of",
"the",
"current",
"and",
"the",
"last",
"method",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/modeltools.py#L751-L780 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | run_simulation | def run_simulation(projectname: str, xmlfile: str):
"""Perform a HydPy workflow in agreement with the given XML configuration
file available in the directory of the given project. ToDo
Function |run_simulation| is a "script function" and is normally used as
explained in the main documentation on module... | python | def run_simulation(projectname: str, xmlfile: str):
"""Perform a HydPy workflow in agreement with the given XML configuration
file available in the directory of the given project. ToDo
Function |run_simulation| is a "script function" and is normally used as
explained in the main documentation on module... | [
"def",
"run_simulation",
"(",
"projectname",
":",
"str",
",",
"xmlfile",
":",
"str",
")",
":",
"write",
"=",
"commandtools",
".",
"print_textandtime",
"hydpy",
".",
"pub",
".",
"options",
".",
"printprogress",
"=",
"False",
"write",
"(",
"f'Start HydPy project... | Perform a HydPy workflow in agreement with the given XML configuration
file available in the directory of the given project. ToDo
Function |run_simulation| is a "script function" and is normally used as
explained in the main documentation on module |xmltools|. | [
"Perform",
"a",
"HydPy",
"workflow",
"in",
"agreement",
"with",
"the",
"given",
"XML",
"configuration",
"file",
"available",
"in",
"the",
"directory",
"of",
"the",
"given",
"project",
".",
"ToDo"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L188-L222 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLInterface.validate_xml | def validate_xml(self) -> None:
"""Raise an error if the actual XML does not agree with one of the
available schema files.
# ToDo: should it be accompanied by a script function?
The first example relies on a distorted version of the configuration
file `single_run.xml`:
... | python | def validate_xml(self) -> None:
"""Raise an error if the actual XML does not agree with one of the
available schema files.
# ToDo: should it be accompanied by a script function?
The first example relies on a distorted version of the configuration
file `single_run.xml`:
... | [
"def",
"validate_xml",
"(",
"self",
")",
"->",
"None",
":",
"try",
":",
"filenames",
"=",
"(",
"'HydPyConfigSingleRun.xsd'",
",",
"'HydPyConfigMultipleRuns.xsd'",
")",
"for",
"name",
"in",
"filenames",
":",
"if",
"name",
"in",
"self",
".",
"root",
".",
"tag"... | Raise an error if the actual XML does not agree with one of the
available schema files.
# ToDo: should it be accompanied by a script function?
The first example relies on a distorted version of the configuration
file `single_run.xml`:
>>> from hydpy.core.examples import prepar... | [
"Raise",
"an",
"error",
"if",
"the",
"actual",
"XML",
"does",
"not",
"agree",
"with",
"one",
"of",
"the",
"available",
"schema",
"files",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L315-L427 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLInterface.update_options | def update_options(self) -> None:
"""Update the |Options| object available in module |pub| with the
values defined in the `options` XML element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data, pub
>>> interface = XMLInterface('single_run.xml', data.g... | python | def update_options(self) -> None:
"""Update the |Options| object available in module |pub| with the
values defined in the `options` XML element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data, pub
>>> interface = XMLInterface('single_run.xml', data.g... | [
"def",
"update_options",
"(",
"self",
")",
"->",
"None",
":",
"options",
"=",
"hydpy",
".",
"pub",
".",
"options",
"for",
"option",
"in",
"self",
".",
"find",
"(",
"'options'",
")",
":",
"value",
"=",
"option",
".",
"text",
"if",
"value",
"in",
"(",
... | Update the |Options| object available in module |pub| with the
values defined in the `options` XML element.
>>> from hydpy.auxs.xmltools import XMLInterface
>>> from hydpy import data, pub
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> pub.options.pri... | [
"Update",
"the",
"|Options|",
"object",
"available",
"in",
"module",
"|pub|",
"with",
"the",
"values",
"defined",
"in",
"the",
"options",
"XML",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L429-L478 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLInterface.update_timegrids | def update_timegrids(self) -> None:
"""Update the |Timegrids| object available in module |pub| with the
values defined in the `timegrid` XML element.
Usually, one would prefer to define `firstdate`, `lastdate`, and
`stepsize` elements as in the XML configuration file of the
`Lah... | python | def update_timegrids(self) -> None:
"""Update the |Timegrids| object available in module |pub| with the
values defined in the `timegrid` XML element.
Usually, one would prefer to define `firstdate`, `lastdate`, and
`stepsize` elements as in the XML configuration file of the
`Lah... | [
"def",
"update_timegrids",
"(",
"self",
")",
"->",
"None",
":",
"timegrid_xml",
"=",
"self",
".",
"find",
"(",
"'timegrid'",
")",
"try",
":",
"timegrid",
"=",
"timetools",
".",
"Timegrid",
"(",
"*",
"(",
"timegrid_xml",
"[",
"idx",
"]",
".",
"text",
"f... | Update the |Timegrids| object available in module |pub| with the
values defined in the `timegrid` XML element.
Usually, one would prefer to define `firstdate`, `lastdate`, and
`stepsize` elements as in the XML configuration file of the
`LahnH` example project:
>>> from hydpy.co... | [
"Update",
"the",
"|Timegrids|",
"object",
"available",
"in",
"module",
"|pub|",
"with",
"the",
"values",
"defined",
"in",
"the",
"timegrid",
"XML",
"element",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L480-L533 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLInterface.elements | def elements(self) -> Iterator[devicetools.Element]:
"""Yield all |Element| objects returned by |XMLInterface.selections|
and |XMLInterface.devices| without duplicates.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import... | python | def elements(self) -> Iterator[devicetools.Element]:
"""Yield all |Element| objects returned by |XMLInterface.selections|
and |XMLInterface.devices| without duplicates.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import... | [
"def",
"elements",
"(",
"self",
")",
"->",
"Iterator",
"[",
"devicetools",
".",
"Element",
"]",
":",
"selections",
"=",
"copy",
".",
"copy",
"(",
"self",
".",
"selections",
")",
"selections",
"+=",
"self",
".",
"devices",
"elements",
"=",
"set",
"(",
"... | Yield all |Element| objects returned by |XMLInterface.selections|
and |XMLInterface.devices| without duplicates.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | [
"Yield",
"all",
"|Element|",
"objects",
"returned",
"by",
"|XMLInterface",
".",
"selections|",
"and",
"|XMLInterface",
".",
"devices|",
"without",
"duplicates",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L598-L626 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLInterface.fullselection | def fullselection(self) -> selectiontools.Selection:
"""A |Selection| object containing all |Element| and |Node| objects
defined by |XMLInterface.selections| and |XMLInterface.devices|.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> ... | python | def fullselection(self) -> selectiontools.Selection:
"""A |Selection| object containing all |Element| and |Node| objects
defined by |XMLInterface.selections| and |XMLInterface.devices|.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> ... | [
"def",
"fullselection",
"(",
"self",
")",
"->",
"selectiontools",
".",
"Selection",
":",
"fullselection",
"=",
"selectiontools",
".",
"Selection",
"(",
"'fullselection'",
")",
"for",
"selection",
"in",
"self",
".",
"selections",
":",
"fullselection",
"+=",
"sele... | A |Selection| object containing all |Element| and |Node| objects
defined by |XMLInterface.selections| and |XMLInterface.devices|.
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = H... | [
"A",
"|Selection|",
"object",
"containing",
"all",
"|Element|",
"and",
"|Node|",
"objects",
"defined",
"by",
"|XMLInterface",
".",
"selections|",
"and",
"|XMLInterface",
".",
"devices|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L629-L652 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLConditions.load_conditions | def load_conditions(self) -> None:
"""Load the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLIn... | python | def load_conditions(self) -> None:
"""Load the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLIn... | [
"def",
"load_conditions",
"(",
"self",
")",
"->",
"None",
":",
"hydpy",
".",
"pub",
".",
"conditionmanager",
".",
"currentdir",
"=",
"strip",
"(",
"self",
".",
"find",
"(",
"'inputdir'",
")",
".",
"text",
")",
"for",
"element",
"in",
"self",
".",
"mast... | Load the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> from hydpy import HydPy, TestIO, XMLInterface
>>> hp = HydPy('LahnH')
... | [
"Load",
"the",
"condition",
"files",
"of",
"the",
"|Model|",
"objects",
"of",
"all",
"|Element|",
"objects",
"returned",
"by",
"|XMLInterface",
".",
"elements|",
":"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L700-L724 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLConditions.save_conditions | def save_conditions(self) -> None:
"""Save the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> import os
>>> from hydpy impor... | python | def save_conditions(self) -> None:
"""Save the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> import os
>>> from hydpy impor... | [
"def",
"save_conditions",
"(",
"self",
")",
"->",
"None",
":",
"hydpy",
".",
"pub",
".",
"conditionmanager",
".",
"currentdir",
"=",
"strip",
"(",
"self",
".",
"find",
"(",
"'outputdir'",
")",
".",
"text",
")",
"for",
"element",
"in",
"self",
".",
"mas... | Save the condition files of the |Model| objects of all |Element|
objects returned by |XMLInterface.elements|:
>>> from hydpy.core.examples import prepare_full_example_1
>>> prepare_full_example_1()
>>> import os
>>> from hydpy import HydPy, TestIO, XMLInterface, pub
>>>... | [
"Save",
"the",
"condition",
"files",
"of",
"the",
"|Model|",
"objects",
"of",
"all",
"|Element|",
"objects",
"returned",
"by",
"|XMLInterface",
".",
"elements|",
":"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L726-L756 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSeries.prepare_series | def prepare_series(self) -> None:
# noinspection PyUnresolvedReferences
"""Call |XMLSubseries.prepare_series| of all |XMLSubseries|
objects with the same memory |set| object.
>>> from hydpy.auxs.xmltools import XMLInterface, XMLSubseries
>>> from hydpy import data
>>> in... | python | def prepare_series(self) -> None:
# noinspection PyUnresolvedReferences
"""Call |XMLSubseries.prepare_series| of all |XMLSubseries|
objects with the same memory |set| object.
>>> from hydpy.auxs.xmltools import XMLInterface, XMLSubseries
>>> from hydpy import data
>>> in... | [
"def",
"prepare_series",
"(",
"self",
")",
"->",
"None",
":",
"# noinspection PyUnresolvedReferences",
"memory",
"=",
"set",
"(",
")",
"for",
"output",
"in",
"itertools",
".",
"chain",
"(",
"self",
".",
"readers",
",",
"self",
".",
"writers",
")",
":",
"ou... | Call |XMLSubseries.prepare_series| of all |XMLSubseries|
objects with the same memory |set| object.
>>> from hydpy.auxs.xmltools import XMLInterface, XMLSubseries
>>> from hydpy import data
>>> interface = XMLInterface('single_run.xml', data.get_path('LahnH'))
>>> series_io = in... | [
"Call",
"|XMLSubseries",
".",
"prepare_series|",
"of",
"all",
"|XMLSubseries|",
"objects",
"with",
"the",
"same",
"memory",
"|set|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L796-L820 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSelector.selections | def selections(self) -> selectiontools.Selections:
"""The |Selections| object defined for the respective `reader`
or `writer` element of the actual XML file. ToDo
If the `reader` or `writer` element does not define a special
selections element, the general |XMLInterface.selections| elem... | python | def selections(self) -> selectiontools.Selections:
"""The |Selections| object defined for the respective `reader`
or `writer` element of the actual XML file. ToDo
If the `reader` or `writer` element does not define a special
selections element, the general |XMLInterface.selections| elem... | [
"def",
"selections",
"(",
"self",
")",
"->",
"selectiontools",
".",
"Selections",
":",
"selections",
"=",
"self",
".",
"find",
"(",
"'selections'",
")",
"master",
"=",
"self",
"while",
"selections",
"is",
"None",
":",
"master",
"=",
"master",
".",
"master"... | The |Selections| object defined for the respective `reader`
or `writer` element of the actual XML file. ToDo
If the `reader` or `writer` element does not define a special
selections element, the general |XMLInterface.selections| element
of |XMLInterface| is used.
>>> from hydpy... | [
"The",
"|Selections|",
"object",
"defined",
"for",
"the",
"respective",
"reader",
"or",
"writer",
"element",
"of",
"the",
"actual",
"XML",
"file",
".",
"ToDo"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L842-L872 | train |
hydpy-dev/hydpy | hydpy/auxs/xmltools.py | XMLSelector.devices | def devices(self) -> selectiontools.Selection:
"""The additional devices defined for the respective `reader`
or `writer` element contained within a |Selection| object. ToDo
If the `reader` or `writer` element does not define its own additional
devices, |XMLInterface.devices| of |XMLInte... | python | def devices(self) -> selectiontools.Selection:
"""The additional devices defined for the respective `reader`
or `writer` element contained within a |Selection| object. ToDo
If the `reader` or `writer` element does not define its own additional
devices, |XMLInterface.devices| of |XMLInte... | [
"def",
"devices",
"(",
"self",
")",
"->",
"selectiontools",
".",
"Selection",
":",
"devices",
"=",
"self",
".",
"find",
"(",
"'devices'",
")",
"master",
"=",
"self",
"while",
"devices",
"is",
"None",
":",
"master",
"=",
"master",
".",
"master",
"devices"... | The additional devices defined for the respective `reader`
or `writer` element contained within a |Selection| object. ToDo
If the `reader` or `writer` element does not define its own additional
devices, |XMLInterface.devices| of |XMLInterface| is used.
>>> from hydpy.core.examples impo... | [
"The",
"additional",
"devices",
"defined",
"for",
"the",
"respective",
"reader",
"or",
"writer",
"element",
"contained",
"within",
"a",
"|Selection|",
"object",
".",
"ToDo"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/xmltools.py#L875-L904 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.