partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | QFactor.update | Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfactor(1.157407) | hydpy/models/hland/hland_derived.py | def update(self):
"""Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfac... | def update(self):
"""Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfac... | [
"Update",
"|QFactor|",
"based",
"on",
"|Area|",
"and",
"the",
"current",
"simulation",
"step",
"size",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L284-L297 | [
"def",
"update",
"(",
"self",
")",
":",
"self",
"(",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"area",
"*",
"1000.",
"/",
"self",
".",
"subpars",
".",
"qfactor",
".",
"simulationstep",
".",
"seconds",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.nmb_neurons | Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_neurons
(3,)
>>> del ann.nmb_neurons
... | hydpy/auxs/anntools.py | def nmb_neurons(self) -> Tuple[int, ...]:
"""Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_n... | def nmb_neurons(self) -> Tuple[int, ...]:
"""Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_n... | [
"Number",
"of",
"neurons",
"of",
"the",
"hidden",
"layers",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L366-L384 | [
"def",
"nmb_neurons",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"numpy",
".",
"asarray",
"(",
"self",
".",
"_cann",
".",
"nmb_neurons",
")",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.shape_weights_hidden | Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feeding information into another
hidden layer (all except the las... | hydpy/auxs/anntools.py | def shape_weights_hidden(self) -> Tuple[int, int, int]:
"""Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feedin... | def shape_weights_hidden(self) -> Tuple[int, int, int]:
"""Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feedin... | [
"Shape",
"of",
"the",
"array",
"containing",
"the",
"activation",
"of",
"the",
"hidden",
"neurons",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L537-L562 | [
"def",
"shape_weights_hidden",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
",",
"int",
"]",
":",
"if",
"self",
".",
"nmb_layers",
">",
"1",
":",
"nmb_neurons",
"=",
"self",
".",
"nmb_neurons",
"return",
"(",
"self",
".",
"nmb_layers",
"-",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.nmb_weights_hidden | Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18 | hydpy/auxs/anntools.py | def nmb_weights_hidden(self) -> int:
"""Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18
"""
nmb = 0
for idx_layer in range(self.nmb_l... | def nmb_weights_hidden(self) -> int:
"""Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18
"""
nmb = 0
for idx_layer in range(self.nmb_l... | [
"Number",
"of",
"hidden",
"weights",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L565-L577 | [
"def",
"nmb_weights_hidden",
"(",
"self",
")",
"->",
"int",
":",
"nmb",
"=",
"0",
"for",
"idx_layer",
"in",
"range",
"(",
"self",
".",
"nmb_layers",
"-",
"1",
")",
":",
"nmb",
"+=",
"self",
".",
"nmb_neurons",
"[",
"idx_layer",
"]",
"*",
"self",
".",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.verify | Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter `ann` of element `?` has not been def... | hydpy/auxs/anntools.py | def verify(self) -> None:
"""Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter ... | def verify(self) -> None:
"""Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter ... | [
"Raise",
"a",
"|RuntimeError|",
"if",
"the",
"network",
"s",
"shape",
"is",
"not",
"defined",
"completely",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L788-L803 | [
"def",
"verify",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"__protectedproperties",
".",
"allready",
"(",
"self",
")",
":",
"raise",
"RuntimeError",
"(",
"'The shape of the the artificial neural network '",
"'parameter %s has not been defined so far... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.assignrepr | Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string. | hydpy/auxs/anntools.py | def assignrepr(self, prefix) -> str:
"""Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string."""
prefix = '%s%s(' % (prefix, self.name)
blanks = len(prefix)*' '
lines = [
objecttools.assignrepr_value(
... | def assignrepr(self, prefix) -> str:
"""Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string."""
prefix = '%s%s(' % (prefix, self.name)
blanks = len(prefix)*' '
lines = [
objecttools.assignrepr_value(
... | [
"Return",
"a",
"string",
"representation",
"of",
"the",
"actual",
"|anntools",
".",
"ANN|",
"object",
"that",
"is",
"prefixed",
"with",
"the",
"given",
"string",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L805-L828 | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
")",
"->",
"str",
":",
"prefix",
"=",
"'%s%s('",
"%",
"(",
"prefix",
",",
"self",
".",
"name",
")",
"blanks",
"=",
"len",
"(",
"prefix",
")",
"*",
"' '",
"lines",
"=",
"[",
"objecttools",
".",
"assig... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ANN.plot | Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bound of the x axis via arguments
`xmin` and `xmax`. The number of plotting points can be modified
... | hydpy/auxs/anntools.py | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bou... | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bou... | [
"Plot",
"the",
"relationship",
"between",
"a",
"certain",
"input",
"(",
"idx_input",
")",
"and",
"a",
"certain",
"output",
"(",
"idx_output",
")",
"variable",
"described",
"by",
"the",
"actual",
"|anntools",
".",
"ANN|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L833-L850 | [
"def",
"plot",
"(",
"self",
",",
"xmin",
",",
"xmax",
",",
"idx_input",
"=",
"0",
",",
"idx_output",
"=",
"0",
",",
"points",
"=",
"100",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"xs_",
"=",
"numpy",
".",
"linspace",
"(",
"xmin",
",",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN.refresh | Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| instance,
as it stores its |annt... | hydpy/auxs/anntools.py | def refresh(self) -> None:
"""Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| in... | def refresh(self) -> None:
"""Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| in... | [
"Prepare",
"the",
"actual",
"|anntools",
".",
"SeasonalANN|",
"object",
"for",
"calculations",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1323-L1370 | [
"def",
"refresh",
"(",
"self",
")",
"->",
"None",
":",
"# pylint: disable=unsupported-assignment-operation",
"if",
"self",
".",
"_do_refresh",
":",
"if",
"self",
".",
"anns",
":",
"self",
".",
"__sann",
"=",
"annutils",
".",
"SeasonalANN",
"(",
"self",
".",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN.verify | Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.Season... | hydpy/auxs/anntools.py | def verify(self) -> None:
"""Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the in... | def verify(self) -> None:
"""Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the in... | [
"Raise",
"a",
"|RuntimeError|",
"and",
"removes",
"all",
"handled",
"neural",
"networks",
"if",
"the",
"they",
"are",
"defined",
"inconsistently",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1372-L1448 | [
"def",
"verify",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"anns",
":",
"self",
".",
"_toy2ann",
".",
"clear",
"(",
")",
"raise",
"RuntimeError",
"(",
"'Seasonal artificial neural network collections need '",
"'to handle at least one \"normal\" ... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN.shape | The shape of array |anntools.SeasonalANN.ratios|. | hydpy/auxs/anntools.py | def shape(self) -> Tuple[int, ...]:
"""The shape of array |anntools.SeasonalANN.ratios|."""
return tuple(int(sub) for sub in self.ratios.shape) | def shape(self) -> Tuple[int, ...]:
"""The shape of array |anntools.SeasonalANN.ratios|."""
return tuple(int(sub) for sub in self.ratios.shape) | [
"The",
"shape",
"of",
"array",
"|anntools",
".",
"SeasonalANN",
".",
"ratios|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1471-L1473 | [
"def",
"shape",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"int",
"(",
"sub",
")",
"for",
"sub",
"in",
"self",
".",
"ratios",
".",
"shape",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN._set_shape | Private on purpose. | hydpy/auxs/anntools.py | def _set_shape(self, shape):
"""Private on purpose."""
try:
shape = (int(shape),)
except TypeError:
pass
shp = list(shape)
shp[0] = timetools.Period('366d')/self.simulationstep
shp[0] = int(numpy.ceil(round(shp[0], 10)))
getattr(self.fastac... | def _set_shape(self, shape):
"""Private on purpose."""
try:
shape = (int(shape),)
except TypeError:
pass
shp = list(shape)
shp[0] = timetools.Period('366d')/self.simulationstep
shp[0] = int(numpy.ceil(round(shp[0], 10)))
getattr(self.fastac... | [
"Private",
"on",
"purpose",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1475-L1485 | [
"def",
"_set_shape",
"(",
"self",
",",
"shape",
")",
":",
"try",
":",
"shape",
"=",
"(",
"int",
"(",
"shape",
")",
",",
")",
"except",
"TypeError",
":",
"pass",
"shp",
"=",
"list",
"(",
"shape",
")",
"shp",
"[",
"0",
"]",
"=",
"timetools",
".",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN.toys | A sorted |tuple| of all contained |TOY| objects. | hydpy/auxs/anntools.py | def toys(self) -> Tuple[timetools.TOY, ...]:
"""A sorted |tuple| of all contained |TOY| objects."""
return tuple(toy for (toy, _) in self) | def toys(self) -> Tuple[timetools.TOY, ...]:
"""A sorted |tuple| of all contained |TOY| objects."""
return tuple(toy for (toy, _) in self) | [
"A",
"sorted",
"|tuple|",
"of",
"all",
"contained",
"|TOY|",
"objects",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1488-L1490 | [
"def",
"toys",
"(",
"self",
")",
"->",
"Tuple",
"[",
"timetools",
".",
"TOY",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"toy",
"for",
"(",
"toy",
",",
"_",
")",
"in",
"self",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SeasonalANN.plot | Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object. | hydpy/auxs/anntools.py | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object.
"""
for toy, ann_ in self:
ann_.plot(xmin, xmax,
... | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object.
"""
for toy, ann_ in self:
ann_.plot(xmin, xmax,
... | [
"Call",
"method",
"|anntools",
".",
"ANN",
".",
"plot|",
"of",
"all",
"|anntools",
".",
"ANN|",
"objects",
"handled",
"by",
"the",
"actual",
"|anntools",
".",
"SeasonalANN|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1539-L1550 | [
"def",
"plot",
"(",
"self",
",",
"xmin",
",",
"xmax",
",",
"idx_input",
"=",
"0",
",",
"idx_output",
"=",
"0",
",",
"points",
"=",
"100",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"for",
"toy",
",",
"ann_",
"in",
"self",
":",
"ann_",
"."... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ExchangeSpecification.specstring | The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>> spec.series = True
>>> ... | hydpy/core/itemtools.py | def specstring(self):
"""The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>... | def specstring(self):
"""The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>... | [
"The",
"string",
"corresponding",
"to",
"the",
"current",
"values",
"of",
"subgroup",
"state",
"and",
"variable",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L60-L81 | [
"def",
"specstring",
"(",
"self",
")",
":",
"if",
"self",
".",
"subgroup",
"is",
"None",
":",
"variable",
"=",
"self",
".",
"variable",
"else",
":",
"variable",
"=",
"f'{self.subgroup}.{self.variable}'",
"if",
"self",
".",
"series",
":",
"variable",
"=",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ExchangeItem.collect_variables | Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
>>> from hydpy.core.examples import prepare_full_exam... | hydpy/core/itemtools.py | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
... | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
... | [
"Apply",
"method",
"|ExchangeItem",
".",
"insert_variables|",
"to",
"collect",
"the",
"relevant",
"target",
"variables",
"handled",
"by",
"the",
"devices",
"of",
"the",
"given",
"|Selections|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L117-L207 | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"self",
".",
"insert_variables",
"(",
"self",
".",
"device2target",
",",
"self",
".",
"targetspecs",
",",
"selections",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ExchangeItem.insert_variables | Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
dictionary. | hydpy/core/itemtools.py | def insert_variables(
self, device2variable, exchangespec, selections) -> None:
"""Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
... | def insert_variables(
self, device2variable, exchangespec, selections) -> None:
"""Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
... | [
"Determine",
"the",
"relevant",
"target",
"or",
"base",
"variables",
"(",
"as",
"defined",
"by",
"the",
"given",
"|ExchangeSpecification|",
"object",
")",
"handled",
"by",
"the",
"given",
"|Selections|",
"object",
"and",
"insert",
"them",
"into",
"the",
"given",... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L209-L222 | [
"def",
"insert_variables",
"(",
"self",
",",
"device2variable",
",",
"exchangespec",
",",
"selections",
")",
"->",
"None",
":",
"if",
"self",
".",
"targetspecs",
".",
"master",
"in",
"(",
"'node'",
",",
"'nodes'",
")",
":",
"for",
"node",
"in",
"selections... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ChangeItem.update_variable | Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>>> item = SetItem... | hydpy/core/itemtools.py | def update_variable(self, variable, value) -> None:
"""Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pu... | def update_variable(self, variable, value) -> None:
"""Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pu... | [
"Assign",
"the",
"given",
"value",
"(",
"s",
")",
"to",
"the",
"given",
"target",
"or",
"base",
"variable",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L329-L353 | [
"def",
"update_variable",
"(",
"self",
",",
"variable",
",",
"value",
")",
"->",
"None",
":",
"try",
":",
"variable",
"(",
"value",
")",
"except",
"BaseException",
":",
"objecttools",
".",
"augment_excmessage",
"(",
"f'When trying to update a target variable of '",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | SetItem.update_variables | Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
In the first example, a 0-dimensional |Se... | hydpy/core/itemtools.py | def update_variables(self) -> None:
"""Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
... | def update_variables(self) -> None:
"""Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
... | [
"Assign",
"the",
"current",
"objects",
"|ChangeItem",
".",
"value|",
"to",
"the",
"values",
"of",
"the",
"target",
"variables",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L369-L434 | [
"def",
"update_variables",
"(",
"self",
")",
"->",
"None",
":",
"value",
"=",
"self",
".",
"value",
"for",
"variable",
"in",
"self",
".",
"device2target",
".",
"values",
"(",
")",
":",
"self",
".",
"update_variable",
"(",
"variable",
",",
"value",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | MathItem.collect_variables | Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selections| object.
>>> from hydpy.core.examples import pr... | hydpy/core/itemtools.py | def collect_variables(self, selections) -> None:
"""Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selecti... | def collect_variables(self, selections) -> None:
"""Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selecti... | [
"Apply",
"method",
"|ChangeItem",
".",
"collect_variables|",
"of",
"the",
"base",
"class",
"|ChangeItem|",
"and",
"also",
"apply",
"method",
"|ExchangeItem",
".",
"insert_variables|",
"of",
"class",
"|ExchangeItem|",
"to",
"collect",
"the",
"relevant",
"base",
"vari... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L478-L504 | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"collect_variables",
"(",
"selections",
")",
"self",
".",
"insert_variables",
"(",
"self",
".",
"device2base",
",",
"self",
".",
"basespecs",
",",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | AddItem.update_variables | Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>>> from hydpy.models.hland_v1 import FIELD
... | hydpy/core/itemtools.py | def update_variables(self) -> None:
"""Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>... | def update_variables(self) -> None:
"""Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>... | [
"Add",
"the",
"general",
"|ChangeItem",
".",
"value|",
"with",
"the",
"|Device|",
"specific",
"base",
"variable",
"and",
"assign",
"the",
"result",
"to",
"the",
"respective",
"target",
"variable",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L516-L560 | [
"def",
"update_variables",
"(",
"self",
")",
"->",
"None",
":",
"value",
"=",
"self",
".",
"value",
"for",
"device",
",",
"target",
"in",
"self",
".",
"device2target",
".",
"items",
"(",
")",
":",
"base",
"=",
"self",
".",
"device2base",
"[",
"device",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | GetItem.collect_variables | Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
variable or its time series is of interest:
>>> from ... | hydpy/core/itemtools.py | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
va... | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
va... | [
"Apply",
"method",
"|ExchangeItem",
".",
"collect_variables|",
"of",
"the",
"base",
"class",
"|ExchangeItem|",
"and",
"determine",
"the",
"ndim",
"attribute",
"of",
"the",
"current",
"|ChangeItem|",
"object",
"afterwards",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L574-L602 | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"collect_variables",
"(",
"selections",
")",
"for",
"device",
"in",
"sorted",
"(",
"self",
".",
"device2target",
".",
"keys",
"(",
")",
",",
"key"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | GetItem.yield_name2value | Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |Variable| object and the target
description:
>>> from hydpy.core.examples import prepare... | hydpy/core/itemtools.py | def yield_name2value(self, idx1=None, idx2=None) \
-> Iterator[Tuple[str, str]]:
"""Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |V... | def yield_name2value(self, idx1=None, idx2=None) \
-> Iterator[Tuple[str, str]]:
"""Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |V... | [
"Sequentially",
"return",
"name",
"-",
"value",
"-",
"pairs",
"describing",
"the",
"current",
"state",
"of",
"the",
"target",
"variables",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L604-L662 | [
"def",
"yield_name2value",
"(",
"self",
",",
"idx1",
"=",
"None",
",",
"idx2",
"=",
"None",
")",
"->",
"Iterator",
"[",
"Tuple",
"[",
"str",
",",
"str",
"]",
"]",
":",
"for",
"device",
",",
"name",
"in",
"self",
".",
"_device2name",
".",
"items",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | iso_day_to_weekday | Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday. | openinghours/templatetags/openinghours_tags.py | def iso_day_to_weekday(d):
"""
Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday.
"""
if int(d) == utils.get_now().isoweekday():
return _("today")
for w in WEEKDAYS:
if w[0] == int(d):
return w[1] | def iso_day_to_weekday(d):
"""
Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday.
"""
if int(d) == utils.get_now().isoweekday():
return _("today")
for w in WEEKDAYS:
if w[0] == int(d):
return w[1] | [
"Returns",
"the",
"weekday",
"s",
"name",
"given",
"a",
"ISO",
"weekday",
"number",
";",
"today",
"if",
"today",
"is",
"the",
"same",
"weekday",
"."
] | arteria/django-openinghours | python | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L14-L23 | [
"def",
"iso_day_to_weekday",
"(",
"d",
")",
":",
"if",
"int",
"(",
"d",
")",
"==",
"utils",
".",
"get_now",
"(",
")",
".",
"isoweekday",
"(",
")",
":",
"return",
"_",
"(",
"\"today\"",
")",
"for",
"w",
"in",
"WEEKDAYS",
":",
"if",
"w",
"[",
"0",
... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa |
train | is_open | Returns False if the location is closed, or the OpeningHours object
to show the location is currently open. | openinghours/templatetags/openinghours_tags.py | def is_open(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
"""
obj = utils.is_open(location)
if obj is False:
return False
if attr is not None:
return getattr(obj, attr)
return obj | def is_open(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
"""
obj = utils.is_open(location)
if obj is False:
return False
if attr is not None:
return getattr(obj, attr)
return obj | [
"Returns",
"False",
"if",
"the",
"location",
"is",
"closed",
"or",
"the",
"OpeningHours",
"object",
"to",
"show",
"the",
"location",
"is",
"currently",
"open",
"."
] | arteria/django-openinghours | python | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L39-L49 | [
"def",
"is_open",
"(",
"location",
"=",
"None",
",",
"attr",
"=",
"None",
")",
":",
"obj",
"=",
"utils",
".",
"is_open",
"(",
"location",
")",
"if",
"obj",
"is",
"False",
":",
"return",
"False",
"if",
"attr",
"is",
"not",
"None",
":",
"return",
"ge... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa |
train | is_open_now | Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`. | openinghours/templatetags/openinghours_tags.py | def is_open_now(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`.
"""
obj = utils.is_open(location, now=datetime.datetime.now())
... | def is_open_now(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`.
"""
obj = utils.is_open(location, now=datetime.datetime.now())
... | [
"Returns",
"False",
"if",
"the",
"location",
"is",
"closed",
"or",
"the",
"OpeningHours",
"object",
"to",
"show",
"the",
"location",
"is",
"currently",
"open",
".",
"Same",
"as",
"is_open",
"but",
"passes",
"now",
"to",
"utils",
".",
"is_open",
"to",
"bypa... | arteria/django-openinghours | python | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L53-L64 | [
"def",
"is_open_now",
"(",
"location",
"=",
"None",
",",
"attr",
"=",
"None",
")",
":",
"obj",
"=",
"utils",
".",
"is_open",
"(",
"location",
",",
"now",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
")",
"if",
"obj",
"is",
"False",
":",
... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa |
train | opening_hours | Creates a rendered listing of hours. | openinghours/templatetags/openinghours_tags.py | def opening_hours(location=None, concise=False):
"""
Creates a rendered listing of hours.
"""
template_name = 'openinghours/opening_hours_list.html'
days = [] # [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...
# Without `location`, choose the first company.
if location:
... | def opening_hours(location=None, concise=False):
"""
Creates a rendered listing of hours.
"""
template_name = 'openinghours/opening_hours_list.html'
days = [] # [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...
# Without `location`, choose the first company.
if location:
... | [
"Creates",
"a",
"rendered",
"listing",
"of",
"hours",
"."
] | arteria/django-openinghours | python | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L98-L173 | [
"def",
"opening_hours",
"(",
"location",
"=",
"None",
",",
"concise",
"=",
"False",
")",
":",
"template_name",
"=",
"'openinghours/opening_hours_list.html'",
"days",
"=",
"[",
"]",
"# [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...",
"# Without `location`, choos... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa |
train | HydPy.prepare_everything | Convenience method to make the actual |HydPy| instance runable. | hydpy/core/hydpytools.py | def prepare_everything(self):
"""Convenience method to make the actual |HydPy| instance runable."""
self.prepare_network()
self.init_models()
self.load_conditions()
with hydpy.pub.options.warnmissingobsfile(False):
self.prepare_nodeseries()
self.prepare_models... | def prepare_everything(self):
"""Convenience method to make the actual |HydPy| instance runable."""
self.prepare_network()
self.init_models()
self.load_conditions()
with hydpy.pub.options.warnmissingobsfile(False):
self.prepare_nodeseries()
self.prepare_models... | [
"Convenience",
"method",
"to",
"make",
"the",
"actual",
"|HydPy|",
"instance",
"runable",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L70-L78 | [
"def",
"prepare_everything",
"(",
"self",
")",
":",
"self",
".",
"prepare_network",
"(",
")",
"self",
".",
"init_models",
"(",
")",
"self",
".",
"load_conditions",
"(",
")",
"with",
"hydpy",
".",
"pub",
".",
"options",
".",
"warnmissingobsfile",
"(",
"Fals... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.prepare_network | Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object. | hydpy/core/hydpytools.py | def prepare_network(self):
"""Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object."""
hydpy.pub.selections = selectiontools.Selections()
hydpy.pub.selections += hydpy.pub.networkmanager.load_files()
self.update... | def prepare_network(self):
"""Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object."""
hydpy.pub.selections = selectiontools.Selections()
hydpy.pub.selections += hydpy.pub.networkmanager.load_files()
self.update... | [
"Load",
"all",
"network",
"files",
"as",
"|Selections|",
"(",
"stored",
"in",
"module",
"|pub|",
")",
"and",
"assign",
"the",
"complete",
"selection",
"to",
"the",
"|HydPy|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L81-L86 | [
"def",
"prepare_network",
"(",
"self",
")",
":",
"hydpy",
".",
"pub",
".",
"selections",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"hydpy",
".",
"pub",
".",
"selections",
"+=",
"hydpy",
".",
"pub",
".",
"networkmanager",
".",
"load_files",
"(",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.save_controls | Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set parameter control files. For convenience, we let
function |prepare_full_example_2| prepare a fully functi... | hydpy/core/hydpytools.py | def save_controls(self, parameterstep=None, simulationstep=None,
auxfiler=None):
"""Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set ... | def save_controls(self, parameterstep=None, simulationstep=None,
auxfiler=None):
"""Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set ... | [
"Call",
"method",
"|Elements",
".",
"save_controls|",
"of",
"the",
"|Elements|",
"object",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L93-L281 | [
"def",
"save_controls",
"(",
"self",
",",
"parameterstep",
"=",
"None",
",",
"simulationstep",
"=",
"None",
",",
"auxfiler",
"=",
"None",
")",
":",
"self",
".",
"elements",
".",
"save_controls",
"(",
"parameterstep",
"=",
"parameterstep",
",",
"simulationstep"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.networkproperties | Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object. | hydpy/core/hydpytools.py | def networkproperties(self):
"""Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object."""
print('Number of nodes: %d' % len(self.nodes))
print('Number of elements: %d' % len(self.elements))
print('Number of en... | def networkproperties(self):
"""Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object."""
print('Number of nodes: %d' % len(self.nodes))
print('Number of elements: %d' % len(self.elements))
print('Number of en... | [
"Print",
"out",
"some",
"properties",
"of",
"the",
"network",
"defined",
"by",
"the",
"|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L455-L462 | [
"def",
"networkproperties",
"(",
"self",
")",
":",
"print",
"(",
"'Number of nodes: %d'",
"%",
"len",
"(",
"self",
".",
"nodes",
")",
")",
"print",
"(",
"'Number of elements: %d'",
"%",
"len",
"(",
"self",
".",
"elements",
")",
")",
"print",
"(",
"'Number ... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.numberofnetworks | The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object. | hydpy/core/hydpytools.py | def numberofnetworks(self):
"""The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object."""
sels1 = selectiontools.Selections()
sels2 = selectiontools.Selections()
complete = selectiontools.Selection('complete',
... | def numberofnetworks(self):
"""The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object."""
sels1 = selectiontools.Selections()
sels2 = selectiontools.Selections()
complete = selectiontools.Selection('complete',
... | [
"The",
"number",
"of",
"distinct",
"networks",
"defined",
"by",
"the|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L465-L483 | [
"def",
"numberofnetworks",
"(",
"self",
")",
":",
"sels1",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"sels2",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"complete",
"=",
"selectiontools",
".",
"Selection",
"(",
"'complete'",
",",
"self",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.endnodes | |Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network. | hydpy/core/hydpytools.py | def endnodes(self):
"""|Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network."""
endnodes = devicetools.Nodes()
for node in self.nodes:
for element in node.exits:
if ((element in s... | def endnodes(self):
"""|Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network."""
endnodes = devicetools.Nodes()
for node in self.nodes:
for element in node.exits:
if ((element in s... | [
"|Nodes|",
"object",
"containing",
"all",
"|Node|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"which",
"define",
"a",
"downstream",
"end",
"point",
"of",
"a",
"network",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L517-L528 | [
"def",
"endnodes",
"(",
"self",
")",
":",
"endnodes",
"=",
"devicetools",
".",
"Nodes",
"(",
")",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"for",
"element",
"in",
"node",
".",
"exits",
":",
"if",
"(",
"(",
"element",
"in",
"self",
".",
"elem... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.variables | Sorted list of strings summarizing all variables handled by the
|Node| objects | hydpy/core/hydpytools.py | def variables(self):
"""Sorted list of strings summarizing all variables handled by the
|Node| objects"""
variables = set([])
for node in self.nodes:
variables.add(node.variable)
return sorted(variables) | def variables(self):
"""Sorted list of strings summarizing all variables handled by the
|Node| objects"""
variables = set([])
for node in self.nodes:
variables.add(node.variable)
return sorted(variables) | [
"Sorted",
"list",
"of",
"strings",
"summarizing",
"all",
"variables",
"handled",
"by",
"the",
"|Node|",
"objects"
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L531-L537 | [
"def",
"variables",
"(",
"self",
")",
":",
"variables",
"=",
"set",
"(",
"[",
"]",
")",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"variables",
".",
"add",
"(",
"node",
".",
"variable",
")",
"return",
"sorted",
"(",
"variables",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.simindices | Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|. | hydpy/core/hydpytools.py | def simindices(self):
"""Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|."""
return (hydpy.pub.timegrids.init[hydpy.pub.timegrids.sim.firstdate],
hydpy.pub.timeg... | def simindices(self):
"""Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|."""
return (hydpy.pub.timegrids.init[hydpy.pub.timegrids.sim.firstdate],
hydpy.pub.timeg... | [
"Tuple",
"containing",
"the",
"start",
"and",
"end",
"index",
"of",
"the",
"simulation",
"period",
"regarding",
"the",
"initialization",
"period",
"defined",
"by",
"the",
"|Timegrids|",
"object",
"stored",
"in",
"module",
"|pub|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L540-L545 | [
"def",
"simindices",
"(",
"self",
")",
":",
"return",
"(",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"[",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"sim",
".",
"firstdate",
"]",
",",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.open_files | Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object. | hydpy/core/hydpytools.py | def open_files(self, idx=0):
"""Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object."""
self.elements.open_files(idx=idx)
self.nodes.open_files(idx=idx) | def open_files(self, idx=0):
"""Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object."""
self.elements.open_files(idx=idx)
self.nodes.open_files(idx=idx) | [
"Call",
"method",
"|Devices",
".",
"open_files|",
"of",
"the",
"|Nodes|",
"and",
"|Elements|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L547-L551 | [
"def",
"open_files",
"(",
"self",
",",
"idx",
"=",
"0",
")",
":",
"self",
".",
"elements",
".",
"open_files",
"(",
"idx",
"=",
"idx",
")",
"self",
".",
"nodes",
".",
"open_files",
"(",
"idx",
"=",
"idx",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.update_devices | Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be passed. | hydpy/core/hydpytools.py | def update_devices(self, selection=None):
"""Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be... | def update_devices(self, selection=None):
"""Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be... | [
"Determines",
"the",
"order",
"in",
"which",
"the",
"|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"objects",
"need",
"to",
"be",
"processed",
"during",
"a",
"simulation",
"time",
"step",
".",
"Optionally",
"a",
"|Sele... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L559-L567 | [
"def",
"update_devices",
"(",
"self",
",",
"selection",
"=",
"None",
")",
":",
"if",
"selection",
"is",
"not",
"None",
":",
"self",
".",
"nodes",
"=",
"selection",
".",
"nodes",
"self",
".",
"elements",
"=",
"selection",
".",
"elements",
"self",
".",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.methodorder | A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called. | hydpy/core/hydpytools.py | def methodorder(self):
"""A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called."""
funcs = []
for node in self.nodes:
if node.deploymode == 'oldsim':
... | def methodorder(self):
"""A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called."""
funcs = []
for node in self.nodes:
if node.deploymode == 'oldsim':
... | [
"A",
"list",
"containing",
"all",
"methods",
"of",
"all",
"|Node|",
"and",
"|Element|",
"objects",
"that",
"need",
"to",
"be",
"processed",
"during",
"a",
"simulation",
"time",
"step",
"in",
"the",
"order",
"they",
"must",
"be",
"called",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L570-L597 | [
"def",
"methodorder",
"(",
"self",
")",
":",
"funcs",
"=",
"[",
"]",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"if",
"node",
".",
"deploymode",
"==",
"'oldsim'",
":",
"funcs",
".",
"append",
"(",
"node",
".",
"sequences",
".",
"fastaccess",
"."... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | HydPy.doit | Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|. | hydpy/core/hydpytools.py | def doit(self):
"""Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|."""
idx_start, idx_end = self.simindices
self.open_files(idx_start)
methodorder = self.methodorder
for idx in printtools.progressbar... | def doit(self):
"""Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|."""
idx_start, idx_end = self.simindices
self.open_files(idx_start)
methodorder = self.methodorder
for idx in printtools.progressbar... | [
"Perform",
"a",
"simulation",
"run",
"over",
"the",
"actual",
"simulation",
"time",
"period",
"defined",
"by",
"the",
"|Timegrids|",
"object",
"stored",
"in",
"module",
"|pub|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L600-L609 | [
"def",
"doit",
"(",
"self",
")",
":",
"idx_start",
",",
"idx_end",
"=",
"self",
".",
"simindices",
"self",
".",
"open_files",
"(",
"idx_start",
")",
"methodorder",
"=",
"self",
".",
"methodorder",
"for",
"idx",
"in",
"printtools",
".",
"progressbar",
"(",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_inflow_v1 | Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q` | hydpy/models/dam/dam_model.py | def pic_inflow_v1(self):
"""Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q`
"""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.inflow = in... | def pic_inflow_v1(self):
"""Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q`
"""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.inflow = in... | [
"Update",
"the",
"inlet",
"link",
"sequence",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L11-L25 | [
"def",
"pic_inflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"inflow",
"=",
"inl",
".",
"q",
"[",
"0",
"]"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_inflow_v2 | Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R` | hydpy/models/dam/dam_model.py | def pic_inflow_v2(self):
"""Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R`
"""
flu = self.sequences.fluxes.fastaccess
inl = ... | def pic_inflow_v2(self):
"""Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R`
"""
flu = self.sequences.fluxes.fastaccess
inl = ... | [
"Update",
"the",
"inlet",
"link",
"sequences",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L28-L44 | [
"def",
"pic_inflow_v2",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"inflow",
"=",
"inl",
".",
"q",
"[",
"0",
"]",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_totalremotedischarge_v1 | Update the receiver link sequence. | hydpy/models/dam/dam_model.py | def pic_totalremotedischarge_v1(self):
"""Update the receiver link sequence."""
flu = self.sequences.fluxes.fastaccess
rec = self.sequences.receivers.fastaccess
flu.totalremotedischarge = rec.q[0] | def pic_totalremotedischarge_v1(self):
"""Update the receiver link sequence."""
flu = self.sequences.fluxes.fastaccess
rec = self.sequences.receivers.fastaccess
flu.totalremotedischarge = rec.q[0] | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L47-L51 | [
"def",
"pic_totalremotedischarge_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"flu",
".",
"totalremotedischarge",
"=",
"rec",
".... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_loggedrequiredremoterelease_v1 | Update the receiver link sequence. | hydpy/models/dam/dam_model.py | def pic_loggedrequiredremoterelease_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.d[0] | def pic_loggedrequiredremoterelease_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.d[0] | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L54-L58 | [
"def",
"pic_loggedrequiredremoterelease_v1",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedrequiredremoterelease",
"[",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_loggedrequiredremoterelease_v2 | Update the receiver link sequence. | hydpy/models/dam/dam_model.py | def pic_loggedrequiredremoterelease_v2(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.s[0] | def pic_loggedrequiredremoterelease_v2(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.s[0] | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L61-L65 | [
"def",
"pic_loggedrequiredremoterelease_v2",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedrequiredremoterelease",
"[",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pic_loggedallowedremoterelieve_v1 | Update the receiver link sequence. | hydpy/models/dam/dam_model.py | def pic_loggedallowedremoterelieve_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedallowedremoterelieve[0] = rec.r[0] | def pic_loggedallowedremoterelieve_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedallowedremoterelieve[0] = rec.r[0] | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L68-L72 | [
"def",
"pic_loggedallowedremoterelieve_v1",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedallowedremoterelieve",
"[",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | update_loggedtotalremotedischarge_v1 | Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
The following example shows that, with each new method... | hydpy/models/dam/dam_model.py | def update_loggedtotalremotedischarge_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
... | def update_loggedtotalremotedischarge_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
... | [
"Log",
"a",
"new",
"entry",
"of",
"discharge",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L75-L118 | [
"def",
"update_loggedtotalremotedischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_waterlevel_v1 | Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
|WaterLevel|
Example:
... | hydpy/models/dam/dam_model.py | def calc_waterlevel_v1(self):
"""Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
... | def calc_waterlevel_v1(self):
"""Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
... | [
"Determine",
"the",
"water",
"level",
"based",
"on",
"an",
"artificial",
"neural",
"network",
"describing",
"the",
"relationship",
"between",
"water",
"level",
"and",
"water",
"stage",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L121-L179 | [
"def",
"calc_waterlevel_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_allowedremoterelieve_v2 | Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Required aide sequence:
|WaterLevel|
Calc... | hydpy/models/dam/dam_model.py | def calc_allowedremoterelieve_v2(self):
"""Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Requi... | def calc_allowedremoterelieve_v2(self):
"""Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Requi... | [
"Calculate",
"the",
"allowed",
"maximum",
"relieve",
"another",
"location",
"is",
"allowed",
"to",
"discharge",
"into",
"the",
"dam",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L182-L293 | [
"def",
"calc_allowedremoterelieve_v2",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fl... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_requiredremotesupply_v1 | Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Required aide sequence:
|WaterLevel|
Cal... | hydpy/models/dam/dam_model.py | def calc_requiredremotesupply_v1(self):
"""Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Requ... | def calc_requiredremotesupply_v1(self):
"""Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Requ... | [
"Calculate",
"the",
"required",
"maximum",
"supply",
"from",
"another",
"location",
"that",
"can",
"be",
"discharged",
"into",
"the",
"dam",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L296-L379 | [
"def",
"calc_requiredremotesupply_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fl... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_naturalremotedischarge_v1 | Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculated flux sequence:
|NaturalRemoteDischarge|
... | hydpy/models/dam/dam_model.py | def calc_naturalremotedischarge_v1(self):
"""Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculate... | def calc_naturalremotedischarge_v1(self):
"""Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculate... | [
"Try",
"to",
"estimate",
"the",
"natural",
"discharge",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"based",
"on",
"the",
"last",
"few",
"simulation",
"steps",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L382-L436 | [
"def",
"calc_naturalremotedischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"lo... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_remotedemand_v1 | Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|RemoteDemand|
Basic equation:
:... | hydpy/models/dam/dam_model.py | def calc_remotedemand_v1(self):
"""Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|Rem... | def calc_remotedemand_v1(self):
"""Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|Rem... | [
"Estimate",
"the",
"discharge",
"demand",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L439-L521 | [
"def",
"calc_remotedemand_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_remotefailure_v1 | Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequence:
|LoggedTotalRemoteDischarge|
... | hydpy/models/dam/dam_model.py | def calc_remotefailure_v1(self):
"""Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequen... | def calc_remotefailure_v1(self):
"""Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequen... | [
"Estimate",
"the",
"shortfall",
"of",
"actual",
"discharge",
"under",
"the",
"required",
"discharge",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L524-L595 | [
"def",
"calc_remotefailure_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_requiredremoterelease_v1 | Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoothPar|
|dam_derived.TOY|
Required flux... | hydpy/models/dam/dam_model.py | def calc_requiredremoterelease_v1(self):
"""Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoot... | def calc_requiredremoterelease_v1(self):
"""Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoot... | [
"Guess",
"the",
"required",
"release",
"necessary",
"to",
"not",
"fall",
"below",
"the",
"threshold",
"value",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"with",
"a",
"certain",
"level",
"of",
"certainty",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L598-L705 | [
"def",
"calc_requiredremoterelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"f... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_requiredremoterelease_v2 | Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`
Example:
>>> from hydpy.models.da... | hydpy/models/dam/dam_model.py | def calc_requiredremoterelease_v2(self):
"""Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`... | def calc_requiredremoterelease_v2(self):
"""Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`... | [
"Get",
"the",
"required",
"remote",
"release",
"of",
"the",
"last",
"simulation",
"step",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L708-L731 | [
"def",
"calc_requiredremoterelease_v2",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"flu",
".",
"requiredremoterelease",
"=",
"log",
".",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_allowedremoterelieve_v1 | Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
Example:
>>> from hydpy.models.dam imp... | hydpy/models/dam/dam_model.py | def calc_allowedremoterelieve_v1(self):
"""Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
... | def calc_allowedremoterelieve_v1(self):
"""Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
... | [
"Get",
"the",
"allowed",
"remote",
"relieve",
"of",
"the",
"last",
"simulation",
"step",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L734-L757 | [
"def",
"calc_allowedremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"flu",
".",
"allowedremoterelieve",
"=",
"log",
".",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_requiredrelease_v1 | Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
Required flux sequence:
|Require... | hydpy/models/dam/dam_model.py | def calc_requiredrelease_v1(self):
"""Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
... | def calc_requiredrelease_v1(self):
"""Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
... | [
"Calculate",
"the",
"total",
"water",
"release",
"(",
"immediately",
"and",
"far",
"downstream",
")",
"required",
"for",
"reducing",
"drought",
"events",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L760-L874 | [
"def",
"calc_requiredrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_requiredrelease_v2 | Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
Basic equation:
:math:`Required... | hydpy/models/dam/dam_model.py | def calc_requiredrelease_v2(self):
"""Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
... | def calc_requiredrelease_v2(self):
"""Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
... | [
"Calculate",
"the",
"water",
"release",
"(",
"immediately",
"downstream",
")",
"required",
"for",
"reducing",
"drought",
"events",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L877-L930 | [
"def",
"calc_requiredrelease_v2",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_possibleremoterelieve_v1 | Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteRelieve|
Required aide sequence:
|WaterLeve... | hydpy/models/dam/dam_model.py | def calc_possibleremoterelieve_v1(self):
"""Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteReliev... | def calc_possibleremoterelieve_v1(self):
"""Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteReliev... | [
"Calculate",
"the",
"highest",
"possible",
"water",
"release",
"that",
"can",
"be",
"routed",
"to",
"a",
"remote",
"location",
"based",
"on",
"an",
"artificial",
"neural",
"network",
"describing",
"the",
"relationship",
"between",
"possible",
"release",
"and",
"... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L933-L999 | [
"def",
"calc_possibleremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aid... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_actualremoterelieve_v1 | Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
Calculated flux sequence:
|ActualRemo... | hydpy/models/dam/dam_model.py | def calc_actualremoterelieve_v1(self):
"""Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
... | def calc_actualremoterelieve_v1(self):
"""Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
... | [
"Calculate",
"the",
"actual",
"amount",
"of",
"water",
"released",
"to",
"a",
"remote",
"location",
"to",
"relieve",
"the",
"dam",
"during",
"high",
"flow",
"conditions",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1002-L1160 | [
"def",
"calc_actualremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"d_smoothpar",
"=",
"con",
".",
"remoterelievetoleran... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_targetedrelease_v1 | Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter |RestrictTargetedRelease|
is set to `T... | hydpy/models/dam/dam_model.py | def calc_targetedrelease_v1(self):
"""Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter ... | def calc_targetedrelease_v1(self):
"""Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter ... | [
"Calculate",
"the",
"targeted",
"water",
"release",
"for",
"reducing",
"drought",
"events",
"taking",
"into",
"account",
"both",
"the",
"required",
"water",
"release",
"and",
"the",
"actual",
"inflow",
"into",
"the",
"dam",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1163-L1475 | [
"def",
"calc_targetedrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_actualrelease_v1 | Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Required flux sequence:
|TargetedRelease|... | hydpy/models/dam/dam_model.py | def calc_actualrelease_v1(self):
"""Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Require... | def calc_actualrelease_v1(self):
"""Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Require... | [
"Calculate",
"the",
"actual",
"water",
"release",
"that",
"can",
"be",
"supplied",
"by",
"the",
"dam",
"considering",
"the",
"targeted",
"release",
"and",
"the",
"given",
"water",
"level",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1478-L1622 | [
"def",
"calc_actualrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_missingremoterelease_v1 | Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:
:math:`MissingRemoteRelease = max(
... | hydpy/models/dam/dam_model.py | def calc_missingremoterelease_v1(self):
"""Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:... | def calc_missingremoterelease_v1(self):
"""Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:... | [
"Calculate",
"the",
"portion",
"of",
"the",
"required",
"remote",
"demand",
"that",
"could",
"not",
"be",
"met",
"by",
"the",
"actual",
"discharge",
"release",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1625-L1656 | [
"def",
"calc_missingremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"missingremoterelease",
"=",
"max",
"(",
"flu",
".",
"requiredremoterelease",
"-",
"flu",
".",
"actualrelease",
",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_actualremoterelease_v1 | Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMinimumRemoteSmoothPar|
Required flux sequenc... | hydpy/models/dam/dam_model.py | def calc_actualremoterelease_v1(self):
"""Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMini... | def calc_actualremoterelease_v1(self):
"""Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMini... | [
"Calculate",
"the",
"actual",
"remote",
"water",
"release",
"that",
"can",
"be",
"supplied",
"by",
"the",
"dam",
"considering",
"the",
"required",
"remote",
"release",
"and",
"the",
"given",
"water",
"level",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1659-L1762 | [
"def",
"calc_actualremoterelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"flu... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | update_actualremoterelieve_v1 | Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - discontinous:
:math:`ActualRemoteRelieve = min(... | hydpy/models/dam/dam_model.py | def update_actualremoterelieve_v1(self):
"""Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - disco... | def update_actualremoterelieve_v1(self):
"""Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - disco... | [
"Constrain",
"the",
"actual",
"relieve",
"discharge",
"to",
"a",
"remote",
"location",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1765-L1869 | [
"def",
"update_actualremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"f... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_flooddischarge_v1 | Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_derived.TOY|
Required aide sequence:
... | hydpy/models/dam/dam_model.py | def calc_flooddischarge_v1(self):
"""Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_deri... | def calc_flooddischarge_v1(self):
"""Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_deri... | [
"Calculate",
"the",
"discharge",
"during",
"and",
"after",
"a",
"flood",
"event",
"based",
"on",
"an",
"|anntools",
".",
"SeasonalANN|",
"describing",
"the",
"relationship",
"(",
"s",
")",
"between",
"discharge",
"and",
"water",
"stage",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1994-L2092 | [
"def",
"calc_flooddischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | calc_outflow_v1 | Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
Calculated flux sequence:
... | hydpy/models/dam/dam_model.py | def calc_outflow_v1(self):
"""Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
... | def calc_outflow_v1(self):
"""Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
... | [
"Calculate",
"the",
"total",
"outflow",
"of",
"the",
"dam",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2095-L2127 | [
"def",
"calc_outflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"outflow",
"=",
"max",
"(",
"flu",
".",
"actualrelease",
"+",
"flu",
".",
"flooddischarge",
",",
"0.",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | update_watervolume_v1 | Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)`
Example:
>>> from hydpy.... | hydpy/models/dam/dam_model.py | def update_watervolume_v1(self):
"""Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)... | def update_watervolume_v1(self):
"""Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)... | [
"Update",
"the",
"actual",
"water",
"volume",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2130-L2163 | [
"def",
"update_watervolume_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_outflow_v1 | Update the outlet link sequence |dam_outlets.Q|. | hydpy/models/dam/dam_model.py | def pass_outflow_v1(self):
"""Update the outlet link sequence |dam_outlets.Q|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.outflow | def pass_outflow_v1(self):
"""Update the outlet link sequence |dam_outlets.Q|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.outflow | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"Q|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2251-L2255 | [
"def",
"pass_outflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"q",
"[",
"0",
"]",
"+=",
"flu",
".",
"outfl... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_actualremoterelease_v1 | Update the outlet link sequence |dam_outlets.S|. | hydpy/models/dam/dam_model.py | def pass_actualremoterelease_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.s[0] += flu.actualremoterelease | def pass_actualremoterelease_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.s[0] += flu.actualremoterelease | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"S|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2258-L2262 | [
"def",
"pass_actualremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"s",
"[",
"0",
"]",
"+=",
"flu",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_actualremoterelieve_v1 | Update the outlet link sequence |dam_outlets.R|. | hydpy/models/dam/dam_model.py | def pass_actualremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.r[0] += flu.actualremoterelieve | def pass_actualremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.r[0] += flu.actualremoterelieve | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"R|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2265-L2269 | [
"def",
"pass_actualremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"r",
"[",
"0",
"]",
"+=",
"flu",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_missingremoterelease_v1 | Update the outlet link sequence |dam_senders.D|. | hydpy/models/dam/dam_model.py | def pass_missingremoterelease_v1(self):
"""Update the outlet link sequence |dam_senders.D|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.d[0] += flu.missingremoterelease | def pass_missingremoterelease_v1(self):
"""Update the outlet link sequence |dam_senders.D|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.d[0] += flu.missingremoterelease | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_senders",
".",
"D|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2272-L2276 | [
"def",
"pass_missingremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"d",
"[",
"0",
"]",
"+=",
"flu",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_allowedremoterelieve_v1 | Update the outlet link sequence |dam_outlets.R|. | hydpy/models/dam/dam_model.py | def pass_allowedremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.r[0] += flu.allowedremoterelieve | def pass_allowedremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.r[0] += flu.allowedremoterelieve | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"R|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2279-L2283 | [
"def",
"pass_allowedremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"r",
"[",
"0",
"]",
"+=",
"flu",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | pass_requiredremotesupply_v1 | Update the outlet link sequence |dam_outlets.S|. | hydpy/models/dam/dam_model.py | def pass_requiredremotesupply_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.s[0] += flu.requiredremotesupply | def pass_requiredremotesupply_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.s[0] += flu.requiredremotesupply | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"S|",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2286-L2290 | [
"def",
"pass_requiredremotesupply_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"s",
"[",
"0",
"]",
"+=",
"flu",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | update_loggedoutflow_v1 | Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with each new method call, the
three m... | hydpy/models/dam/dam_model.py | def update_loggedoutflow_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with... | def update_loggedoutflow_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with... | [
"Log",
"a",
"new",
"entry",
"of",
"discharge",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2293-L2335 | [
"def",
"update_loggedoutflow_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | MA.update_coefs | (Re)calculate the MA coefficients based on the instantaneous
unit hydrograph. | hydpy/auxs/armatools.py | def update_coefs(self):
"""(Re)calculate the MA coefficients based on the instantaneous
unit hydrograph."""
coefs = []
sum_coefs = 0.
moment1 = self.iuh.moment1
for t in itertools.count(0., 1.):
points = (moment1 % 1,) if t <= moment1 <= (t+2.) else ()
... | def update_coefs(self):
"""(Re)calculate the MA coefficients based on the instantaneous
unit hydrograph."""
coefs = []
sum_coefs = 0.
moment1 = self.iuh.moment1
for t in itertools.count(0., 1.):
points = (moment1 % 1,) if t <= moment1 <= (t+2.) else ()
... | [
"(",
"Re",
")",
"calculate",
"the",
"MA",
"coefficients",
"based",
"on",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L201-L233 | [
"def",
"update_coefs",
"(",
"self",
")",
":",
"coefs",
"=",
"[",
"]",
"sum_coefs",
"=",
"0.",
"moment1",
"=",
"self",
".",
"iuh",
".",
"moment1",
"for",
"t",
"in",
"itertools",
".",
"count",
"(",
"0.",
",",
"1.",
")",
":",
"points",
"=",
"(",
"mo... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | MA.turningpoint | Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph. | hydpy/auxs/armatools.py | def turningpoint(self):
"""Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph."""
coefs = self.coefs
old_dc = coefs[1]-coefs[0]
for idx in range(self.order-2):
new_dc = coefs[idx+2]-coefs[idx+1]
... | def turningpoint(self):
"""Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph."""
coefs = self.coefs
old_dc = coefs[1]-coefs[0]
for idx in range(self.order-2):
new_dc = coefs[idx+2]-coefs[idx+1]
... | [
"Turning",
"point",
"(",
"index",
"and",
"value",
"tuple",
")",
"in",
"the",
"recession",
"part",
"of",
"the",
"MA",
"approximation",
"of",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L236-L249 | [
"def",
"turningpoint",
"(",
"self",
")",
":",
"coefs",
"=",
"self",
".",
"coefs",
"old_dc",
"=",
"coefs",
"[",
"1",
"]",
"-",
"coefs",
"[",
"0",
"]",
"for",
"idx",
"in",
"range",
"(",
"self",
".",
"order",
"-",
"2",
")",
":",
"new_dc",
"=",
"co... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | MA.moments | The first two time delay weighted statistical moments of the
MA coefficients. | hydpy/auxs/armatools.py | def moments(self):
"""The first two time delay weighted statistical moments of the
MA coefficients."""
moment1 = statstools.calc_mean_time(self.delays, self.coefs)
moment2 = statstools.calc_mean_time_deviation(
self.delays, self.coefs, moment1)
return numpy.array([mom... | def moments(self):
"""The first two time delay weighted statistical moments of the
MA coefficients."""
moment1 = statstools.calc_mean_time(self.delays, self.coefs)
moment2 = statstools.calc_mean_time_deviation(
self.delays, self.coefs, moment1)
return numpy.array([mom... | [
"The",
"first",
"two",
"time",
"delay",
"weighted",
"statistical",
"moments",
"of",
"the",
"MA",
"coefficients",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L257-L263 | [
"def",
"moments",
"(",
"self",
")",
":",
"moment1",
"=",
"statstools",
".",
"calc_mean_time",
"(",
"self",
".",
"delays",
",",
"self",
".",
"coefs",
")",
"moment2",
"=",
"statstools",
".",
"calc_mean_time_deviation",
"(",
"self",
".",
"delays",
",",
"self"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.effective_max_ar_order | The maximum number of AR coefficients that shall or can be
determined.
It is the minimum of |ARMA.max_ar_order| and the number of
coefficients of the pure |MA| after their turning point. | hydpy/auxs/armatools.py | def effective_max_ar_order(self):
"""The maximum number of AR coefficients that shall or can be
determined.
It is the minimum of |ARMA.max_ar_order| and the number of
coefficients of the pure |MA| after their turning point.
"""
return min(self.max_ar_order, self.ma.order... | def effective_max_ar_order(self):
"""The maximum number of AR coefficients that shall or can be
determined.
It is the minimum of |ARMA.max_ar_order| and the number of
coefficients of the pure |MA| after their turning point.
"""
return min(self.max_ar_order, self.ma.order... | [
"The",
"maximum",
"number",
"of",
"AR",
"coefficients",
"that",
"shall",
"or",
"can",
"be",
"determined",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L548-L555 | [
"def",
"effective_max_ar_order",
"(",
"self",
")",
":",
"return",
"min",
"(",
"self",
".",
"max_ar_order",
",",
"self",
".",
"ma",
".",
"order",
"-",
"self",
".",
"ma",
".",
"turningpoint",
"[",
"0",
"]",
"-",
"1",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.update_ar_coefs | Determine the AR coefficients.
The number of AR coefficients is subsequently increased until the
required precision |ARMA.max_rel_rmse| is reached. Otherwise,
a |RuntimeError| is raised. | hydpy/auxs/armatools.py | def update_ar_coefs(self):
"""Determine the AR coefficients.
The number of AR coefficients is subsequently increased until the
required precision |ARMA.max_rel_rmse| is reached. Otherwise,
a |RuntimeError| is raised.
"""
del self.ar_coefs
for ar_order in range(1... | def update_ar_coefs(self):
"""Determine the AR coefficients.
The number of AR coefficients is subsequently increased until the
required precision |ARMA.max_rel_rmse| is reached. Otherwise,
a |RuntimeError| is raised.
"""
del self.ar_coefs
for ar_order in range(1... | [
"Determine",
"the",
"AR",
"coefficients",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L557-L578 | [
"def",
"update_ar_coefs",
"(",
"self",
")",
":",
"del",
"self",
".",
"ar_coefs",
"for",
"ar_order",
"in",
"range",
"(",
"1",
",",
"self",
".",
"effective_max_ar_order",
"+",
"1",
")",
":",
"self",
".",
"calc_all_ar_coefs",
"(",
"ar_order",
",",
"self",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.dev_moments | Sum of the absolute deviations between the central moments of the
instantaneous unit hydrograph and the ARMA approximation. | hydpy/auxs/armatools.py | def dev_moments(self):
"""Sum of the absolute deviations between the central moments of the
instantaneous unit hydrograph and the ARMA approximation."""
return numpy.sum(numpy.abs(self.moments-self.ma.moments)) | def dev_moments(self):
"""Sum of the absolute deviations between the central moments of the
instantaneous unit hydrograph and the ARMA approximation."""
return numpy.sum(numpy.abs(self.moments-self.ma.moments)) | [
"Sum",
"of",
"the",
"absolute",
"deviations",
"between",
"the",
"central",
"moments",
"of",
"the",
"instantaneous",
"unit",
"hydrograph",
"and",
"the",
"ARMA",
"approximation",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L581-L584 | [
"def",
"dev_moments",
"(",
"self",
")",
":",
"return",
"numpy",
".",
"sum",
"(",
"numpy",
".",
"abs",
"(",
"self",
".",
"moments",
"-",
"self",
".",
"ma",
".",
"moments",
")",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.norm_coefs | Multiply all coefficients by the same factor, so that their sum
becomes one. | hydpy/auxs/armatools.py | def norm_coefs(self):
"""Multiply all coefficients by the same factor, so that their sum
becomes one."""
sum_coefs = self.sum_coefs
self.ar_coefs /= sum_coefs
self.ma_coefs /= sum_coefs | def norm_coefs(self):
"""Multiply all coefficients by the same factor, so that their sum
becomes one."""
sum_coefs = self.sum_coefs
self.ar_coefs /= sum_coefs
self.ma_coefs /= sum_coefs | [
"Multiply",
"all",
"coefficients",
"by",
"the",
"same",
"factor",
"so",
"that",
"their",
"sum",
"becomes",
"one",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L586-L591 | [
"def",
"norm_coefs",
"(",
"self",
")",
":",
"sum_coefs",
"=",
"self",
".",
"sum_coefs",
"self",
".",
"ar_coefs",
"/=",
"sum_coefs",
"self",
".",
"ma_coefs",
"/=",
"sum_coefs"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.sum_coefs | The sum of all AR and MA coefficients | hydpy/auxs/armatools.py | def sum_coefs(self):
"""The sum of all AR and MA coefficients"""
return numpy.sum(self.ar_coefs) + numpy.sum(self.ma_coefs) | def sum_coefs(self):
"""The sum of all AR and MA coefficients"""
return numpy.sum(self.ar_coefs) + numpy.sum(self.ma_coefs) | [
"The",
"sum",
"of",
"all",
"AR",
"and",
"MA",
"coefficients"
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L594-L596 | [
"def",
"sum_coefs",
"(",
"self",
")",
":",
"return",
"numpy",
".",
"sum",
"(",
"self",
".",
"ar_coefs",
")",
"+",
"numpy",
".",
"sum",
"(",
"self",
".",
"ma_coefs",
")"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.calc_all_ar_coefs | Determine the AR coeffcients based on a least squares approach.
The argument `ar_order` defines the number of AR coefficients to be
determined. The argument `ma_order` defines a pure |MA| model.
The least squares approach is applied on all those coefficents of the
pure MA model, which ... | hydpy/auxs/armatools.py | def calc_all_ar_coefs(self, ar_order, ma_model):
"""Determine the AR coeffcients based on a least squares approach.
The argument `ar_order` defines the number of AR coefficients to be
determined. The argument `ma_order` defines a pure |MA| model.
The least squares approach is applied o... | def calc_all_ar_coefs(self, ar_order, ma_model):
"""Determine the AR coeffcients based on a least squares approach.
The argument `ar_order` defines the number of AR coefficients to be
determined. The argument `ma_order` defines a pure |MA| model.
The least squares approach is applied o... | [
"Determine",
"the",
"AR",
"coeffcients",
"based",
"on",
"a",
"least",
"squares",
"approach",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L603-L624 | [
"def",
"calc_all_ar_coefs",
"(",
"self",
",",
"ar_order",
",",
"ma_model",
")",
":",
"turning_idx",
",",
"_",
"=",
"ma_model",
".",
"turningpoint",
"values",
"=",
"ma_model",
".",
"coefs",
"[",
"turning_idx",
":",
"]",
"self",
".",
"ar_coefs",
",",
"residu... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.get_a | Extract the independent variables of the given values and return
them as a matrix with n columns in a form suitable for the least
squares approach applied in method |ARMA.update_ar_coefs|. | hydpy/auxs/armatools.py | def get_a(values, n):
"""Extract the independent variables of the given values and return
them as a matrix with n columns in a form suitable for the least
squares approach applied in method |ARMA.update_ar_coefs|.
"""
m = len(values)-n
a = numpy.empty((m, n), dtype=float)... | def get_a(values, n):
"""Extract the independent variables of the given values and return
them as a matrix with n columns in a form suitable for the least
squares approach applied in method |ARMA.update_ar_coefs|.
"""
m = len(values)-n
a = numpy.empty((m, n), dtype=float)... | [
"Extract",
"the",
"independent",
"variables",
"of",
"the",
"given",
"values",
"and",
"return",
"them",
"as",
"a",
"matrix",
"with",
"n",
"columns",
"in",
"a",
"form",
"suitable",
"for",
"the",
"least",
"squares",
"approach",
"applied",
"in",
"method",
"|ARMA... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L627-L638 | [
"def",
"get_a",
"(",
"values",
",",
"n",
")",
":",
"m",
"=",
"len",
"(",
"values",
")",
"-",
"n",
"a",
"=",
"numpy",
".",
"empty",
"(",
"(",
"m",
",",
"n",
")",
",",
"dtype",
"=",
"float",
")",
"for",
"i",
"in",
"range",
"(",
"m",
")",
":... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.update_ma_coefs | Determine the MA coefficients.
The number of MA coefficients is subsequently increased until the
required precision |ARMA.max_dev_coefs| is reached. Otherwise,
a |RuntimeError| is raised. | hydpy/auxs/armatools.py | def update_ma_coefs(self):
"""Determine the MA coefficients.
The number of MA coefficients is subsequently increased until the
required precision |ARMA.max_dev_coefs| is reached. Otherwise,
a |RuntimeError| is raised.
"""
self.ma_coefs = []
for ma_order in range... | def update_ma_coefs(self):
"""Determine the MA coefficients.
The number of MA coefficients is subsequently increased until the
required precision |ARMA.max_dev_coefs| is reached. Otherwise,
a |RuntimeError| is raised.
"""
self.ma_coefs = []
for ma_order in range... | [
"Determine",
"the",
"MA",
"coefficients",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L648-L674 | [
"def",
"update_ma_coefs",
"(",
"self",
")",
":",
"self",
".",
"ma_coefs",
"=",
"[",
"]",
"for",
"ma_order",
"in",
"range",
"(",
"1",
",",
"self",
".",
"ma",
".",
"order",
"+",
"1",
")",
":",
"self",
".",
"calc_next_ma_coef",
"(",
"ma_order",
",",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.calc_next_ma_coef | Determine the MA coefficients of the ARMA model based on its
predetermined AR coefficients and the MA ordinates of the given
|MA| model.
The MA coefficients are determined one at a time, beginning with the
first one. Each ARMA MA coefficient in set in a manner that allows
for t... | hydpy/auxs/armatools.py | def calc_next_ma_coef(self, ma_order, ma_model):
"""Determine the MA coefficients of the ARMA model based on its
predetermined AR coefficients and the MA ordinates of the given
|MA| model.
The MA coefficients are determined one at a time, beginning with the
first one. Each ARMA... | def calc_next_ma_coef(self, ma_order, ma_model):
"""Determine the MA coefficients of the ARMA model based on its
predetermined AR coefficients and the MA ordinates of the given
|MA| model.
The MA coefficients are determined one at a time, beginning with the
first one. Each ARMA... | [
"Determine",
"the",
"MA",
"coefficients",
"of",
"the",
"ARMA",
"model",
"based",
"on",
"its",
"predetermined",
"AR",
"coefficients",
"and",
"the",
"MA",
"ordinates",
"of",
"the",
"given",
"|MA|",
"model",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L676-L692 | [
"def",
"calc_next_ma_coef",
"(",
"self",
",",
"ma_order",
",",
"ma_model",
")",
":",
"idx",
"=",
"ma_order",
"-",
"1",
"coef",
"=",
"ma_model",
".",
"coefs",
"[",
"idx",
"]",
"for",
"jdx",
",",
"ar_coef",
"in",
"enumerate",
"(",
"self",
".",
"ar_coefs"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.response | Return the response to a standard dt impulse. | hydpy/auxs/armatools.py | def response(self):
"""Return the response to a standard dt impulse."""
values = []
sum_values = 0.
ma_coefs = self.ma_coefs
ar_coefs = self.ar_coefs
ma_order = self.ma_order
for idx in range(len(self.ma.delays)):
value = 0.
if idx < ma_ord... | def response(self):
"""Return the response to a standard dt impulse."""
values = []
sum_values = 0.
ma_coefs = self.ma_coefs
ar_coefs = self.ar_coefs
ma_order = self.ma_order
for idx in range(len(self.ma.delays)):
value = 0.
if idx < ma_ord... | [
"Return",
"the",
"response",
"to",
"a",
"standard",
"dt",
"impulse",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L695-L712 | [
"def",
"response",
"(",
"self",
")",
":",
"values",
"=",
"[",
"]",
"sum_values",
"=",
"0.",
"ma_coefs",
"=",
"self",
".",
"ma_coefs",
"ar_coefs",
"=",
"self",
".",
"ar_coefs",
"ma_order",
"=",
"self",
".",
"ma_order",
"for",
"idx",
"in",
"range",
"(",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.moments | The first two time delay weighted statistical moments of the
ARMA response. | hydpy/auxs/armatools.py | def moments(self):
"""The first two time delay weighted statistical moments of the
ARMA response."""
timepoints = self.ma.delays
response = self.response
moment1 = statstools.calc_mean_time(timepoints, response)
moment2 = statstools.calc_mean_time_deviation(
t... | def moments(self):
"""The first two time delay weighted statistical moments of the
ARMA response."""
timepoints = self.ma.delays
response = self.response
moment1 = statstools.calc_mean_time(timepoints, response)
moment2 = statstools.calc_mean_time_deviation(
t... | [
"The",
"first",
"two",
"time",
"delay",
"weighted",
"statistical",
"moments",
"of",
"the",
"ARMA",
"response",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L715-L723 | [
"def",
"moments",
"(",
"self",
")",
":",
"timepoints",
"=",
"self",
".",
"ma",
".",
"delays",
"response",
"=",
"self",
".",
"response",
"moment1",
"=",
"statstools",
".",
"calc_mean_time",
"(",
"timepoints",
",",
"response",
")",
"moment2",
"=",
"statstool... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | ARMA.plot | Barplot of the ARMA response. | hydpy/auxs/armatools.py | def plot(self, threshold=None, **kwargs):
"""Barplot of the ARMA response."""
try:
# Works under matplotlib 3.
pyplot.bar(x=self.ma.delays+.5, height=self.response,
width=1., fill=False, **kwargs)
except TypeError: # pragma: no cover
#... | def plot(self, threshold=None, **kwargs):
"""Barplot of the ARMA response."""
try:
# Works under matplotlib 3.
pyplot.bar(x=self.ma.delays+.5, height=self.response,
width=1., fill=False, **kwargs)
except TypeError: # pragma: no cover
#... | [
"Barplot",
"of",
"the",
"ARMA",
"response",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L725-L740 | [
"def",
"plot",
"(",
"self",
",",
"threshold",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"# Works under matplotlib 3.",
"pyplot",
".",
"bar",
"(",
"x",
"=",
"self",
".",
"ma",
".",
"delays",
"+",
".5",
",",
"height",
"=",
"self",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | method_header | Returns the Cython method header for methods without arguments except
`self`. | hydpy/cythons/modelutils.py | def method_header(method_name, nogil=False, idx_as_arg=False):
"""Returns the Cython method header for methods without arguments except
`self`."""
if not config.FASTCYTHON:
nogil = False
header = 'cpdef inline void %s(self' % method_name
header += ', int idx)' if idx_as_arg else ')'
head... | def method_header(method_name, nogil=False, idx_as_arg=False):
"""Returns the Cython method header for methods without arguments except
`self`."""
if not config.FASTCYTHON:
nogil = False
header = 'cpdef inline void %s(self' % method_name
header += ', int idx)' if idx_as_arg else ')'
head... | [
"Returns",
"the",
"Cython",
"method",
"header",
"for",
"methods",
"without",
"arguments",
"except",
"self",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L80-L88 | [
"def",
"method_header",
"(",
"method_name",
",",
"nogil",
"=",
"False",
",",
"idx_as_arg",
"=",
"False",
")",
":",
"if",
"not",
"config",
".",
"FASTCYTHON",
":",
"nogil",
"=",
"False",
"header",
"=",
"'cpdef inline void %s(self'",
"%",
"method_name",
"header",... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | decorate_method | The decorated method will return a |Lines| object including
a method header. However, the |Lines| object will be empty if
the respective model does not implement a method with the same
name as the wrapped method. | hydpy/cythons/modelutils.py | def decorate_method(wrapped):
"""The decorated method will return a |Lines| object including
a method header. However, the |Lines| object will be empty if
the respective model does not implement a method with the same
name as the wrapped method.
"""
def wrapper(self):
lines = Lines()
... | def decorate_method(wrapped):
"""The decorated method will return a |Lines| object including
a method header. However, the |Lines| object will be empty if
the respective model does not implement a method with the same
name as the wrapped method.
"""
def wrapper(self):
lines = Lines()
... | [
"The",
"decorated",
"method",
"will",
"return",
"a",
"|Lines|",
"object",
"including",
"a",
"method",
"header",
".",
"However",
"the",
"|Lines|",
"object",
"will",
"be",
"empty",
"if",
"the",
"respective",
"model",
"does",
"not",
"implement",
"a",
"method",
... | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L91-L107 | [
"def",
"decorate_method",
"(",
"wrapped",
")",
":",
"def",
"wrapper",
"(",
"self",
")",
":",
"lines",
"=",
"Lines",
"(",
")",
"if",
"hasattr",
"(",
"self",
".",
"model",
",",
"wrapped",
".",
"__name__",
")",
":",
"print",
"(",
"' . %s'",
"%"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Lines.add | Appends the given text line with prefixed spaces in accordance with
the given number of indentation levels. | hydpy/cythons/modelutils.py | def add(self, indent, line):
"""Appends the given text line with prefixed spaces in accordance with
the given number of indentation levels.
"""
if isinstance(line, str):
list.append(self, indent*4*' ' + line)
else:
for subline in line:
list... | def add(self, indent, line):
"""Appends the given text line with prefixed spaces in accordance with
the given number of indentation levels.
"""
if isinstance(line, str):
list.append(self, indent*4*' ' + line)
else:
for subline in line:
list... | [
"Appends",
"the",
"given",
"text",
"line",
"with",
"prefixed",
"spaces",
"in",
"accordance",
"with",
"the",
"given",
"number",
"of",
"indentation",
"levels",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L66-L74 | [
"def",
"add",
"(",
"self",
",",
"indent",
",",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"str",
")",
":",
"list",
".",
"append",
"(",
"self",
",",
"indent",
"*",
"4",
"*",
"' '",
"+",
"line",
")",
"else",
":",
"for",
"subline",
"i... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.pyname | Name of the compiled module. | hydpy/cythons/modelutils.py | def pyname(self):
"""Name of the compiled module."""
if self.pymodule.endswith('__init__'):
return self.pymodule.split('.')[-2]
else:
return self.pymodule.split('.')[-1] | def pyname(self):
"""Name of the compiled module."""
if self.pymodule.endswith('__init__'):
return self.pymodule.split('.')[-2]
else:
return self.pymodule.split('.')[-1] | [
"Name",
"of",
"the",
"compiled",
"module",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L147-L152 | [
"def",
"pyname",
"(",
"self",
")",
":",
"if",
"self",
".",
"pymodule",
".",
"endswith",
"(",
"'__init__'",
")",
":",
"return",
"self",
".",
"pymodule",
".",
"split",
"(",
"'.'",
")",
"[",
"-",
"2",
"]",
"else",
":",
"return",
"self",
".",
"pymodule... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.pyxwriter | Update the pyx file. | hydpy/cythons/modelutils.py | def pyxwriter(self):
"""Update the pyx file."""
model = self.Model()
if hasattr(self, 'Parameters'):
model.parameters = self.Parameters(vars(self))
else:
model.parameters = parametertools.Parameters(vars(self))
if hasattr(self, 'Sequences'):
mo... | def pyxwriter(self):
"""Update the pyx file."""
model = self.Model()
if hasattr(self, 'Parameters'):
model.parameters = self.Parameters(vars(self))
else:
model.parameters = parametertools.Parameters(vars(self))
if hasattr(self, 'Sequences'):
mo... | [
"Update",
"the",
"pyx",
"file",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L185-L197 | [
"def",
"pyxwriter",
"(",
"self",
")",
":",
"model",
"=",
"self",
".",
"Model",
"(",
")",
"if",
"hasattr",
"(",
"self",
",",
"'Parameters'",
")",
":",
"model",
".",
"parameters",
"=",
"self",
".",
"Parameters",
"(",
"vars",
"(",
"self",
")",
")",
"e... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.pysourcefiles | All source files of the actual models Python classes and their
respective base classes. | hydpy/cythons/modelutils.py | def pysourcefiles(self):
"""All source files of the actual models Python classes and their
respective base classes."""
sourcefiles = set()
for (name, child) in vars(self).items():
try:
parents = inspect.getmro(child)
except AttributeError:
... | def pysourcefiles(self):
"""All source files of the actual models Python classes and their
respective base classes."""
sourcefiles = set()
for (name, child) in vars(self).items():
try:
parents = inspect.getmro(child)
except AttributeError:
... | [
"All",
"source",
"files",
"of",
"the",
"actual",
"models",
"Python",
"classes",
"and",
"their",
"respective",
"base",
"classes",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L200-L215 | [
"def",
"pysourcefiles",
"(",
"self",
")",
":",
"sourcefiles",
"=",
"set",
"(",
")",
"for",
"(",
"name",
",",
"child",
")",
"in",
"vars",
"(",
"self",
")",
".",
"items",
"(",
")",
":",
"try",
":",
"parents",
"=",
"inspect",
".",
"getmro",
"(",
"ch... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.outdated | True if at least one of the |Cythonizer.pysourcefiles| is
newer than the compiled file under |Cythonizer.pyxfilepath|,
otherwise False. | hydpy/cythons/modelutils.py | def outdated(self):
"""True if at least one of the |Cythonizer.pysourcefiles| is
newer than the compiled file under |Cythonizer.pyxfilepath|,
otherwise False.
"""
if hydpy.pub.options.forcecompiling:
return True
if os.path.split(hydpy.__path__[0])[-2].endswith... | def outdated(self):
"""True if at least one of the |Cythonizer.pysourcefiles| is
newer than the compiled file under |Cythonizer.pyxfilepath|,
otherwise False.
"""
if hydpy.pub.options.forcecompiling:
return True
if os.path.split(hydpy.__path__[0])[-2].endswith... | [
"True",
"if",
"at",
"least",
"one",
"of",
"the",
"|Cythonizer",
".",
"pysourcefiles|",
"is",
"newer",
"than",
"the",
"compiled",
"file",
"under",
"|Cythonizer",
".",
"pyxfilepath|",
"otherwise",
"False",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L218-L234 | [
"def",
"outdated",
"(",
"self",
")",
":",
"if",
"hydpy",
".",
"pub",
".",
"options",
".",
"forcecompiling",
":",
"return",
"True",
"if",
"os",
".",
"path",
".",
"split",
"(",
"hydpy",
".",
"__path__",
"[",
"0",
"]",
")",
"[",
"-",
"2",
"]",
".",
... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.compile_ | Translate cython code to C code and compile it. | hydpy/cythons/modelutils.py | def compile_(self):
"""Translate cython code to C code and compile it."""
from Cython import Build
argv = copy.deepcopy(sys.argv)
sys.argv = [sys.argv[0], 'build_ext', '--build-lib='+self.buildpath]
exc_modules = [
distutils.extension.Extension(
... | def compile_(self):
"""Translate cython code to C code and compile it."""
from Cython import Build
argv = copy.deepcopy(sys.argv)
sys.argv = [sys.argv[0], 'build_ext', '--build-lib='+self.buildpath]
exc_modules = [
distutils.extension.Extension(
... | [
"Translate",
"cython",
"code",
"to",
"C",
"code",
"and",
"compile",
"it",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L236-L247 | [
"def",
"compile_",
"(",
"self",
")",
":",
"from",
"Cython",
"import",
"Build",
"argv",
"=",
"copy",
".",
"deepcopy",
"(",
"sys",
".",
"argv",
")",
"sys",
".",
"argv",
"=",
"[",
"sys",
".",
"argv",
"[",
"0",
"]",
",",
"'build_ext'",
",",
"'--build-l... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | Cythonizer.move_dll | Try to find the resulting dll file and to move it into the
`cythons` package.
Things to be aware of:
* The file extension either `pyd` (Window) or `so` (Linux).
* The folder containing the dll file is system dependent, but is
always a subfolder of the `cythons` package.
... | hydpy/cythons/modelutils.py | def move_dll(self):
"""Try to find the resulting dll file and to move it into the
`cythons` package.
Things to be aware of:
* The file extension either `pyd` (Window) or `so` (Linux).
* The folder containing the dll file is system dependent, but is
always a subfo... | def move_dll(self):
"""Try to find the resulting dll file and to move it into the
`cythons` package.
Things to be aware of:
* The file extension either `pyd` (Window) or `so` (Linux).
* The folder containing the dll file is system dependent, but is
always a subfo... | [
"Try",
"to",
"find",
"the",
"resulting",
"dll",
"file",
"and",
"to",
"move",
"it",
"into",
"the",
"cythons",
"package",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L249-L295 | [
"def",
"move_dll",
"(",
"self",
")",
":",
"dirinfos",
"=",
"os",
".",
"walk",
"(",
"self",
".",
"buildpath",
")",
"next",
"(",
"dirinfos",
")",
"system_dependent_filename",
"=",
"None",
"for",
"dirinfo",
"in",
"dirinfos",
":",
"for",
"filename",
"in",
"d... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | PyxWriter.constants | Constants declaration lines. | hydpy/cythons/modelutils.py | def constants(self):
"""Constants declaration lines."""
lines = Lines()
for (name, member) in vars(self.cythonizer).items():
if (name.isupper() and
(not inspect.isclass(member)) and
(type(member) in TYPE2STR)):
ndim = numpy.arra... | def constants(self):
"""Constants declaration lines."""
lines = Lines()
for (name, member) in vars(self.cythonizer).items():
if (name.isupper() and
(not inspect.isclass(member)) and
(type(member) in TYPE2STR)):
ndim = numpy.arra... | [
"Constants",
"declaration",
"lines",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L361-L372 | [
"def",
"constants",
"(",
"self",
")",
":",
"lines",
"=",
"Lines",
"(",
")",
"for",
"(",
"name",
",",
"member",
")",
"in",
"vars",
"(",
"self",
".",
"cythonizer",
")",
".",
"items",
"(",
")",
":",
"if",
"(",
"name",
".",
"isupper",
"(",
")",
"an... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | PyxWriter.parameters | Parameter declaration lines. | hydpy/cythons/modelutils.py | def parameters(self):
"""Parameter declaration lines."""
lines = Lines()
lines.add(0, '@cython.final')
lines.add(0, 'cdef class Parameters(object):')
for subpars in self.model.parameters:
if subpars:
lines.add(1, 'cdef public %s %s'
... | def parameters(self):
"""Parameter declaration lines."""
lines = Lines()
lines.add(0, '@cython.final')
lines.add(0, 'cdef class Parameters(object):')
for subpars in self.model.parameters:
if subpars:
lines.add(1, 'cdef public %s %s'
... | [
"Parameter",
"declaration",
"lines",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L375-L396 | [
"def",
"parameters",
"(",
"self",
")",
":",
"lines",
"=",
"Lines",
"(",
")",
"lines",
".",
"add",
"(",
"0",
",",
"'@cython.final'",
")",
"lines",
".",
"add",
"(",
"0",
",",
"'cdef class Parameters(object):'",
")",
"for",
"subpars",
"in",
"self",
".",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
train | PyxWriter.sequences | Sequence declaration lines. | hydpy/cythons/modelutils.py | def sequences(self):
"""Sequence declaration lines."""
lines = Lines()
lines.add(0, '@cython.final')
lines.add(0, 'cdef class Sequences(object):')
for subseqs in self.model.sequences:
lines.add(1, 'cdef public %s %s'
% (objecttools.classname(s... | def sequences(self):
"""Sequence declaration lines."""
lines = Lines()
lines.add(0, '@cython.final')
lines.add(0, 'cdef class Sequences(object):')
for subseqs in self.model.sequences:
lines.add(1, 'cdef public %s %s'
% (objecttools.classname(s... | [
"Sequence",
"declaration",
"lines",
"."
] | hydpy-dev/hydpy | python | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/cythons/modelutils.py#L399-L452 | [
"def",
"sequences",
"(",
"self",
")",
":",
"lines",
"=",
"Lines",
"(",
")",
"lines",
".",
"add",
"(",
"0",
",",
"'@cython.final'",
")",
"lines",
".",
"add",
"(",
"0",
",",
"'cdef class Sequences(object):'",
")",
"for",
"subseqs",
"in",
"self",
".",
"mo... | 1bc6a82cf30786521d86b36e27900c6717d3348d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.