repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hydpy-dev/hydpy | hydpy/exe/servertools.py | ServerState.initialise | def initialise(self, projectname: str, xmlfile: str) -> None:
"""Initialise a *HydPy* project based on the given XML configuration
file agreeing with `HydPyConfigMultipleRuns.xsd`.
We use the `LahnH` project and its rather complex XML configuration
file `multiple_runs.xml` as an example... | python | def initialise(self, projectname: str, xmlfile: str) -> None:
"""Initialise a *HydPy* project based on the given XML configuration
file agreeing with `HydPyConfigMultipleRuns.xsd`.
We use the `LahnH` project and its rather complex XML configuration
file `multiple_runs.xml` as an example... | [
"def",
"initialise",
"(",
"self",
",",
"projectname",
":",
"str",
",",
"xmlfile",
":",
"str",
")",
"->",
"None",
":",
"write",
"=",
"commandtools",
".",
"print_textandtime",
"write",
"(",
"f'Start HydPy project `{projectname}`'",
")",
"hp",
"=",
"hydpytools",
... | Initialise a *HydPy* project based on the given XML configuration
file agreeing with `HydPyConfigMultipleRuns.xsd`.
We use the `LahnH` project and its rather complex XML configuration
file `multiple_runs.xml` as an example (module |xmltools| provides
information on interpreting this fil... | [
"Initialise",
"a",
"*",
"HydPy",
"*",
"project",
"based",
"on",
"the",
"given",
"XML",
"configuration",
"file",
"agreeing",
"with",
"HydPyConfigMultipleRuns",
".",
"xsd",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L281-L382 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.POST_evaluate | def POST_evaluate(self) -> None:
"""Evaluate any valid Python expression with the *HydPy* server
process and get its result.
Method |HydPyServer.POST_evaluate| serves to test and debug, primarily.
The main documentation on module |servertools| explains its usage.
"""
for... | python | def POST_evaluate(self) -> None:
"""Evaluate any valid Python expression with the *HydPy* server
process and get its result.
Method |HydPyServer.POST_evaluate| serves to test and debug, primarily.
The main documentation on module |servertools| explains its usage.
"""
for... | [
"def",
"POST_evaluate",
"(",
"self",
")",
"->",
"None",
":",
"for",
"name",
",",
"value",
"in",
"self",
".",
"_inputs",
".",
"items",
"(",
")",
":",
"result",
"=",
"eval",
"(",
"value",
")",
"self",
".",
"_outputs",
"[",
"name",
"]",
"=",
"objectto... | Evaluate any valid Python expression with the *HydPy* server
process and get its result.
Method |HydPyServer.POST_evaluate| serves to test and debug, primarily.
The main documentation on module |servertools| explains its usage. | [
"Evaluate",
"any",
"valid",
"Python",
"expression",
"with",
"the",
"*",
"HydPy",
"*",
"server",
"process",
"and",
"get",
"its",
"result",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L918-L927 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_close_server | def GET_close_server(self) -> None:
"""Stop and close the *HydPy* server."""
def _close_server():
self.server.shutdown()
self.server.server_close()
shutter = threading.Thread(target=_close_server)
shutter.deamon = True
shutter.start() | python | def GET_close_server(self) -> None:
"""Stop and close the *HydPy* server."""
def _close_server():
self.server.shutdown()
self.server.server_close()
shutter = threading.Thread(target=_close_server)
shutter.deamon = True
shutter.start() | [
"def",
"GET_close_server",
"(",
"self",
")",
"->",
"None",
":",
"def",
"_close_server",
"(",
")",
":",
"self",
".",
"server",
".",
"shutdown",
"(",
")",
"self",
".",
"server",
".",
"server_close",
"(",
")",
"shutter",
"=",
"threading",
".",
"Thread",
"... | Stop and close the *HydPy* server. | [
"Stop",
"and",
"close",
"the",
"*",
"HydPy",
"*",
"server",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L933-L940 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_parameteritemtypes | def GET_parameteritemtypes(self) -> None:
"""Get the types of all current exchange items supposed to change
the values of |Parameter| objects."""
for item in state.parameteritems:
self._outputs[item.name] = self._get_itemtype(item) | python | def GET_parameteritemtypes(self) -> None:
"""Get the types of all current exchange items supposed to change
the values of |Parameter| objects."""
for item in state.parameteritems:
self._outputs[item.name] = self._get_itemtype(item) | [
"def",
"GET_parameteritemtypes",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"parameteritems",
":",
"self",
".",
"_outputs",
"[",
"item",
".",
"name",
"]",
"=",
"self",
".",
"_get_itemtype",
"(",
"item",
")"
] | Get the types of all current exchange items supposed to change
the values of |Parameter| objects. | [
"Get",
"the",
"types",
"of",
"all",
"current",
"exchange",
"items",
"supposed",
"to",
"change",
"the",
"values",
"of",
"|Parameter|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L953-L957 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_conditionitemtypes | def GET_conditionitemtypes(self) -> None:
"""Get the types of all current exchange items supposed to change
the values of |StateSequence| or |LogSequence| objects."""
for item in state.conditionitems:
self._outputs[item.name] = self._get_itemtype(item) | python | def GET_conditionitemtypes(self) -> None:
"""Get the types of all current exchange items supposed to change
the values of |StateSequence| or |LogSequence| objects."""
for item in state.conditionitems:
self._outputs[item.name] = self._get_itemtype(item) | [
"def",
"GET_conditionitemtypes",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"conditionitems",
":",
"self",
".",
"_outputs",
"[",
"item",
".",
"name",
"]",
"=",
"self",
".",
"_get_itemtype",
"(",
"item",
")"
] | Get the types of all current exchange items supposed to change
the values of |StateSequence| or |LogSequence| objects. | [
"Get",
"the",
"types",
"of",
"all",
"current",
"exchange",
"items",
"supposed",
"to",
"change",
"the",
"values",
"of",
"|StateSequence|",
"or",
"|LogSequence|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L959-L963 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_getitemtypes | def GET_getitemtypes(self) -> None:
"""Get the types of all current exchange items supposed to return
the values of |Parameter| or |Sequence| objects or the time series
of |IOSequence| objects."""
for item in state.getitems:
type_ = self._get_itemtype(item)
for na... | python | def GET_getitemtypes(self) -> None:
"""Get the types of all current exchange items supposed to return
the values of |Parameter| or |Sequence| objects or the time series
of |IOSequence| objects."""
for item in state.getitems:
type_ = self._get_itemtype(item)
for na... | [
"def",
"GET_getitemtypes",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"getitems",
":",
"type_",
"=",
"self",
".",
"_get_itemtype",
"(",
"item",
")",
"for",
"name",
",",
"_",
"in",
"item",
".",
"yield_name2value",
"(",
")",
... | Get the types of all current exchange items supposed to return
the values of |Parameter| or |Sequence| objects or the time series
of |IOSequence| objects. | [
"Get",
"the",
"types",
"of",
"all",
"current",
"exchange",
"items",
"supposed",
"to",
"return",
"the",
"values",
"of",
"|Parameter|",
"or",
"|Sequence|",
"objects",
"or",
"the",
"time",
"series",
"of",
"|IOSequence|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L965-L972 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.POST_timegrid | def POST_timegrid(self) -> None:
"""Change the current simulation |Timegrid|."""
init = hydpy.pub.timegrids.init
sim = hydpy.pub.timegrids.sim
sim.firstdate = self._inputs['firstdate']
sim.lastdate = self._inputs['lastdate']
state.idx1 = init[sim.firstdate]
state.... | python | def POST_timegrid(self) -> None:
"""Change the current simulation |Timegrid|."""
init = hydpy.pub.timegrids.init
sim = hydpy.pub.timegrids.sim
sim.firstdate = self._inputs['firstdate']
sim.lastdate = self._inputs['lastdate']
state.idx1 = init[sim.firstdate]
state.... | [
"def",
"POST_timegrid",
"(",
"self",
")",
"->",
"None",
":",
"init",
"=",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"sim",
"=",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"sim",
"sim",
".",
"firstdate",
"=",
"self",
".",
"_inputs",
"[",
... | Change the current simulation |Timegrid|. | [
"Change",
"the",
"current",
"simulation",
"|Timegrid|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L978-L985 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_parameteritemvalues | def GET_parameteritemvalues(self) -> None:
"""Get the values of all |ChangeItem| objects handling |Parameter|
objects."""
for item in state.parameteritems:
self._outputs[item.name] = item.value | python | def GET_parameteritemvalues(self) -> None:
"""Get the values of all |ChangeItem| objects handling |Parameter|
objects."""
for item in state.parameteritems:
self._outputs[item.name] = item.value | [
"def",
"GET_parameteritemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"parameteritems",
":",
"self",
".",
"_outputs",
"[",
"item",
".",
"name",
"]",
"=",
"item",
".",
"value"
] | Get the values of all |ChangeItem| objects handling |Parameter|
objects. | [
"Get",
"the",
"values",
"of",
"all",
"|ChangeItem|",
"objects",
"handling",
"|Parameter|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1003-L1007 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_conditionitemvalues | def GET_conditionitemvalues(self) -> None:
"""Get the values of all |ChangeItem| objects handling |StateSequence|
or |LogSequence| objects."""
for item in state.conditionitems:
self._outputs[item.name] = item.value | python | def GET_conditionitemvalues(self) -> None:
"""Get the values of all |ChangeItem| objects handling |StateSequence|
or |LogSequence| objects."""
for item in state.conditionitems:
self._outputs[item.name] = item.value | [
"def",
"GET_conditionitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"conditionitems",
":",
"self",
".",
"_outputs",
"[",
"item",
".",
"name",
"]",
"=",
"item",
".",
"value"
] | Get the values of all |ChangeItem| objects handling |StateSequence|
or |LogSequence| objects. | [
"Get",
"the",
"values",
"of",
"all",
"|ChangeItem|",
"objects",
"handling",
"|StateSequence|",
"or",
"|LogSequence|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1014-L1018 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_getitemvalues | def GET_getitemvalues(self) -> None:
"""Get the values of all |Variable| objects observed by the
current |GetItem| objects.
For |GetItem| objects observing time series,
|HydPyServer.GET_getitemvalues| returns only the values within
the current simulation period.
"""
... | python | def GET_getitemvalues(self) -> None:
"""Get the values of all |Variable| objects observed by the
current |GetItem| objects.
For |GetItem| objects observing time series,
|HydPyServer.GET_getitemvalues| returns only the values within
the current simulation period.
"""
... | [
"def",
"GET_getitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"getitems",
":",
"for",
"name",
",",
"value",
"in",
"item",
".",
"yield_name2value",
"(",
"state",
".",
"idx1",
",",
"state",
".",
"idx2",
")",
":",
"... | Get the values of all |Variable| objects observed by the
current |GetItem| objects.
For |GetItem| objects observing time series,
|HydPyServer.GET_getitemvalues| returns only the values within
the current simulation period. | [
"Get",
"the",
"values",
"of",
"all",
"|Variable|",
"objects",
"observed",
"by",
"the",
"current",
"|GetItem|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1025-L1035 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_load_conditionvalues | def GET_load_conditionvalues(self) -> None:
"""Assign the |StateSequence| or |LogSequence| object values available
for the current simulation start point to the current |HydPy| instance.
When the simulation start point is identical with the initialisation
time point and you did not save... | python | def GET_load_conditionvalues(self) -> None:
"""Assign the |StateSequence| or |LogSequence| object values available
for the current simulation start point to the current |HydPy| instance.
When the simulation start point is identical with the initialisation
time point and you did not save... | [
"def",
"GET_load_conditionvalues",
"(",
"self",
")",
"->",
"None",
":",
"try",
":",
"state",
".",
"hp",
".",
"conditions",
"=",
"state",
".",
"conditions",
"[",
"self",
".",
"_id",
"]",
"[",
"state",
".",
"idx1",
"]",
"except",
"KeyError",
":",
"if",
... | Assign the |StateSequence| or |LogSequence| object values available
for the current simulation start point to the current |HydPy| instance.
When the simulation start point is identical with the initialisation
time point and you did not save conditions for it beforehand, the
"original" i... | [
"Assign",
"the",
"|StateSequence|",
"or",
"|LogSequence|",
"object",
"values",
"available",
"for",
"the",
"current",
"simulation",
"start",
"point",
"to",
"the",
"current",
"|HydPy|",
"instance",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1037-L1056 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_save_conditionvalues | def GET_save_conditionvalues(self) -> None:
"""Save the |StateSequence| and |LogSequence| object values of the
current |HydPy| instance for the current simulation endpoint."""
state.conditions[self._id] = state.conditions.get(self._id, {})
state.conditions[self._id][state.idx2] = state.h... | python | def GET_save_conditionvalues(self) -> None:
"""Save the |StateSequence| and |LogSequence| object values of the
current |HydPy| instance for the current simulation endpoint."""
state.conditions[self._id] = state.conditions.get(self._id, {})
state.conditions[self._id][state.idx2] = state.h... | [
"def",
"GET_save_conditionvalues",
"(",
"self",
")",
"->",
"None",
":",
"state",
".",
"conditions",
"[",
"self",
".",
"_id",
"]",
"=",
"state",
".",
"conditions",
".",
"get",
"(",
"self",
".",
"_id",
",",
"{",
"}",
")",
"state",
".",
"conditions",
"[... | Save the |StateSequence| and |LogSequence| object values of the
current |HydPy| instance for the current simulation endpoint. | [
"Save",
"the",
"|StateSequence|",
"and",
"|LogSequence|",
"object",
"values",
"of",
"the",
"current",
"|HydPy|",
"instance",
"for",
"the",
"current",
"simulation",
"endpoint",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1058-L1062 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_save_parameteritemvalues | def GET_save_parameteritemvalues(self) -> None:
"""Save the values of those |ChangeItem| objects which are
handling |Parameter| objects."""
for item in state.parameteritems:
state.parameteritemvalues[self._id][item.name] = item.value.copy() | python | def GET_save_parameteritemvalues(self) -> None:
"""Save the values of those |ChangeItem| objects which are
handling |Parameter| objects."""
for item in state.parameteritems:
state.parameteritemvalues[self._id][item.name] = item.value.copy() | [
"def",
"GET_save_parameteritemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"parameteritems",
":",
"state",
".",
"parameteritemvalues",
"[",
"self",
".",
"_id",
"]",
"[",
"item",
".",
"name",
"]",
"=",
"item",
".",
"val... | Save the values of those |ChangeItem| objects which are
handling |Parameter| objects. | [
"Save",
"the",
"values",
"of",
"those",
"|ChangeItem|",
"objects",
"which",
"are",
"handling",
"|Parameter|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1064-L1068 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_savedparameteritemvalues | def GET_savedparameteritemvalues(self) -> None:
"""Get the previously saved values of those |ChangeItem| objects
which are handling |Parameter| objects."""
dict_ = state.parameteritemvalues.get(self._id)
if dict_ is None:
self.GET_parameteritemvalues()
else:
... | python | def GET_savedparameteritemvalues(self) -> None:
"""Get the previously saved values of those |ChangeItem| objects
which are handling |Parameter| objects."""
dict_ = state.parameteritemvalues.get(self._id)
if dict_ is None:
self.GET_parameteritemvalues()
else:
... | [
"def",
"GET_savedparameteritemvalues",
"(",
"self",
")",
"->",
"None",
":",
"dict_",
"=",
"state",
".",
"parameteritemvalues",
".",
"get",
"(",
"self",
".",
"_id",
")",
"if",
"dict_",
"is",
"None",
":",
"self",
".",
"GET_parameteritemvalues",
"(",
")",
"el... | Get the previously saved values of those |ChangeItem| objects
which are handling |Parameter| objects. | [
"Get",
"the",
"previously",
"saved",
"values",
"of",
"those",
"|ChangeItem|",
"objects",
"which",
"are",
"handling",
"|Parameter|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1070-L1078 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_save_modifiedconditionitemvalues | def GET_save_modifiedconditionitemvalues(self) -> None:
"""ToDo: extend functionality and add tests"""
for item in state.conditionitems:
state.modifiedconditionitemvalues[self._id][item.name] = \
list(item.device2target.values())[0].value | python | def GET_save_modifiedconditionitemvalues(self) -> None:
"""ToDo: extend functionality and add tests"""
for item in state.conditionitems:
state.modifiedconditionitemvalues[self._id][item.name] = \
list(item.device2target.values())[0].value | [
"def",
"GET_save_modifiedconditionitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"conditionitems",
":",
"state",
".",
"modifiedconditionitemvalues",
"[",
"self",
".",
"_id",
"]",
"[",
"item",
".",
"name",
"]",
"=",
"list... | ToDo: extend functionality and add tests | [
"ToDo",
":",
"extend",
"functionality",
"and",
"add",
"tests"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1080-L1084 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_savedmodifiedconditionitemvalues | def GET_savedmodifiedconditionitemvalues(self) -> None:
"""ToDo: extend functionality and add tests"""
dict_ = state.modifiedconditionitemvalues.get(self._id)
if dict_ is None:
self.GET_conditionitemvalues()
else:
for name, value in dict_.items():
... | python | def GET_savedmodifiedconditionitemvalues(self) -> None:
"""ToDo: extend functionality and add tests"""
dict_ = state.modifiedconditionitemvalues.get(self._id)
if dict_ is None:
self.GET_conditionitemvalues()
else:
for name, value in dict_.items():
... | [
"def",
"GET_savedmodifiedconditionitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"dict_",
"=",
"state",
".",
"modifiedconditionitemvalues",
".",
"get",
"(",
"self",
".",
"_id",
")",
"if",
"dict_",
"is",
"None",
":",
"self",
".",
"GET_conditionitemvalues",
"... | ToDo: extend functionality and add tests | [
"ToDo",
":",
"extend",
"functionality",
"and",
"add",
"tests"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1086-L1093 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_save_getitemvalues | def GET_save_getitemvalues(self) -> None:
"""Save the values of all current |GetItem| objects."""
for item in state.getitems:
for name, value in item.yield_name2value(state.idx1, state.idx2):
state.getitemvalues[self._id][name] = value | python | def GET_save_getitemvalues(self) -> None:
"""Save the values of all current |GetItem| objects."""
for item in state.getitems:
for name, value in item.yield_name2value(state.idx1, state.idx2):
state.getitemvalues[self._id][name] = value | [
"def",
"GET_save_getitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"for",
"item",
"in",
"state",
".",
"getitems",
":",
"for",
"name",
",",
"value",
"in",
"item",
".",
"yield_name2value",
"(",
"state",
".",
"idx1",
",",
"state",
".",
"idx2",
")",
":"... | Save the values of all current |GetItem| objects. | [
"Save",
"the",
"values",
"of",
"all",
"current",
"|GetItem|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1095-L1099 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_savedgetitemvalues | def GET_savedgetitemvalues(self) -> None:
"""Get the previously saved values of all |GetItem| objects."""
dict_ = state.getitemvalues.get(self._id)
if dict_ is None:
self.GET_getitemvalues()
else:
for name, value in dict_.items():
self._outputs[nam... | python | def GET_savedgetitemvalues(self) -> None:
"""Get the previously saved values of all |GetItem| objects."""
dict_ = state.getitemvalues.get(self._id)
if dict_ is None:
self.GET_getitemvalues()
else:
for name, value in dict_.items():
self._outputs[nam... | [
"def",
"GET_savedgetitemvalues",
"(",
"self",
")",
"->",
"None",
":",
"dict_",
"=",
"state",
".",
"getitemvalues",
".",
"get",
"(",
"self",
".",
"_id",
")",
"if",
"dict_",
"is",
"None",
":",
"self",
".",
"GET_getitemvalues",
"(",
")",
"else",
":",
"for... | Get the previously saved values of all |GetItem| objects. | [
"Get",
"the",
"previously",
"saved",
"values",
"of",
"all",
"|GetItem|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1101-L1108 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_save_timegrid | def GET_save_timegrid(self) -> None:
"""Save the current simulation period."""
state.timegrids[self._id] = copy.deepcopy(hydpy.pub.timegrids.sim) | python | def GET_save_timegrid(self) -> None:
"""Save the current simulation period."""
state.timegrids[self._id] = copy.deepcopy(hydpy.pub.timegrids.sim) | [
"def",
"GET_save_timegrid",
"(",
"self",
")",
"->",
"None",
":",
"state",
".",
"timegrids",
"[",
"self",
".",
"_id",
"]",
"=",
"copy",
".",
"deepcopy",
"(",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"sim",
")"
] | Save the current simulation period. | [
"Save",
"the",
"current",
"simulation",
"period",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1110-L1112 | train |
hydpy-dev/hydpy | hydpy/exe/servertools.py | HydPyServer.GET_savedtimegrid | def GET_savedtimegrid(self) -> None:
"""Get the previously saved simulation period."""
try:
self._write_timegrid(state.timegrids[self._id])
except KeyError:
self._write_timegrid(hydpy.pub.timegrids.init) | python | def GET_savedtimegrid(self) -> None:
"""Get the previously saved simulation period."""
try:
self._write_timegrid(state.timegrids[self._id])
except KeyError:
self._write_timegrid(hydpy.pub.timegrids.init) | [
"def",
"GET_savedtimegrid",
"(",
"self",
")",
"->",
"None",
":",
"try",
":",
"self",
".",
"_write_timegrid",
"(",
"state",
".",
"timegrids",
"[",
"self",
".",
"_id",
"]",
")",
"except",
"KeyError",
":",
"self",
".",
"_write_timegrid",
"(",
"hydpy",
".",
... | Get the previously saved simulation period. | [
"Get",
"the",
"previously",
"saved",
"simulation",
"period",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/exe/servertools.py#L1114-L1119 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | trim | def trim(self: 'Variable', lower=None, upper=None) -> None:
"""Trim the value(s) of a |Variable| instance.
Usually, users do not need to apply function |trim| directly.
Instead, some |Variable| subclasses implement their own `trim`
methods relying on function |trim|. Model developers should
implem... | python | def trim(self: 'Variable', lower=None, upper=None) -> None:
"""Trim the value(s) of a |Variable| instance.
Usually, users do not need to apply function |trim| directly.
Instead, some |Variable| subclasses implement their own `trim`
methods relying on function |trim|. Model developers should
implem... | [
"def",
"trim",
"(",
"self",
":",
"'Variable'",
",",
"lower",
"=",
"None",
",",
"upper",
"=",
"None",
")",
"->",
"None",
":",
"if",
"hydpy",
".",
"pub",
".",
"options",
".",
"trimvariables",
":",
"if",
"lower",
"is",
"None",
":",
"lower",
"=",
"self... | Trim the value(s) of a |Variable| instance.
Usually, users do not need to apply function |trim| directly.
Instead, some |Variable| subclasses implement their own `trim`
methods relying on function |trim|. Model developers should
implement individual `trim` methods for their |Parameter| or
|Sequenc... | [
"Trim",
"the",
"value",
"(",
"s",
")",
"of",
"a",
"|Variable|",
"instance",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L47-L376 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | _get_tolerance | def _get_tolerance(values):
"""Return some "numerical accuracy" to be expected for the
given floating point value(s) (see method |trim|)."""
tolerance = numpy.abs(values*1e-15)
if hasattr(tolerance, '__setitem__'):
tolerance[numpy.isinf(tolerance)] = 0.
elif numpy.isinf(tolerance):
t... | python | def _get_tolerance(values):
"""Return some "numerical accuracy" to be expected for the
given floating point value(s) (see method |trim|)."""
tolerance = numpy.abs(values*1e-15)
if hasattr(tolerance, '__setitem__'):
tolerance[numpy.isinf(tolerance)] = 0.
elif numpy.isinf(tolerance):
t... | [
"def",
"_get_tolerance",
"(",
"values",
")",
":",
"tolerance",
"=",
"numpy",
".",
"abs",
"(",
"values",
"*",
"1e-15",
")",
"if",
"hasattr",
"(",
"tolerance",
",",
"'__setitem__'",
")",
":",
"tolerance",
"[",
"numpy",
".",
"isinf",
"(",
"tolerance",
")",
... | Return some "numerical accuracy" to be expected for the
given floating point value(s) (see method |trim|). | [
"Return",
"some",
"numerical",
"accuracy",
"to",
"be",
"expected",
"for",
"the",
"given",
"floating",
"point",
"value",
"(",
"s",
")",
"(",
"see",
"method",
"|trim|",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L451-L459 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | _compare_variables_function_generator | def _compare_variables_function_generator(
method_string, aggregation_func):
"""Return a function usable as a comparison method for class |Variable|.
Pass the specific method (e.g. `__eq__`) and the corresponding
operator (e.g. `==`) as strings. Also pass either |numpy.all| or
|numpy.any| for... | python | def _compare_variables_function_generator(
method_string, aggregation_func):
"""Return a function usable as a comparison method for class |Variable|.
Pass the specific method (e.g. `__eq__`) and the corresponding
operator (e.g. `==`) as strings. Also pass either |numpy.all| or
|numpy.any| for... | [
"def",
"_compare_variables_function_generator",
"(",
"method_string",
",",
"aggregation_func",
")",
":",
"def",
"comparison_function",
"(",
"self",
",",
"other",
")",
":",
"\"\"\"Wrapper for comparison functions for class |Variable|.\"\"\"",
"if",
"self",
"is",
"other",
":"... | Return a function usable as a comparison method for class |Variable|.
Pass the specific method (e.g. `__eq__`) and the corresponding
operator (e.g. `==`) as strings. Also pass either |numpy.all| or
|numpy.any| for aggregating multiple boolean values. | [
"Return",
"a",
"function",
"usable",
"as",
"a",
"comparison",
"method",
"for",
"class",
"|Variable|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L470-L495 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | to_repr | def to_repr(self: Variable, values, brackets1d: Optional[bool] = False) \
-> str:
"""Return a valid string representation for the given |Variable|
object.
Function |to_repr| it thought for internal purposes only, more
specifically for defining string representations of subclasses
of class |... | python | def to_repr(self: Variable, values, brackets1d: Optional[bool] = False) \
-> str:
"""Return a valid string representation for the given |Variable|
object.
Function |to_repr| it thought for internal purposes only, more
specifically for defining string representations of subclasses
of class |... | [
"def",
"to_repr",
"(",
"self",
":",
"Variable",
",",
"values",
",",
"brackets1d",
":",
"Optional",
"[",
"bool",
"]",
"=",
"False",
")",
"->",
"str",
":",
"prefix",
"=",
"f'{self.name}('",
"if",
"isinstance",
"(",
"values",
",",
"str",
")",
":",
"string... | Return a valid string representation for the given |Variable|
object.
Function |to_repr| it thought for internal purposes only, more
specifically for defining string representations of subclasses
of class |Variable| like the following:
>>> from hydpy.core.variabletools import to_repr, Variable
... | [
"Return",
"a",
"valid",
"string",
"representation",
"for",
"the",
"given",
"|Variable|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L1930-L1997 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | Variable.verify | def verify(self) -> None:
"""Raises a |RuntimeError| if at least one of the required values
of a |Variable| object is |None| or |numpy.nan|. The descriptor
`mask` defines, which values are considered to be necessary.
Example on a 0-dimensional |Variable|:
>>> from hydpy.core.va... | python | def verify(self) -> None:
"""Raises a |RuntimeError| if at least one of the required values
of a |Variable| object is |None| or |numpy.nan|. The descriptor
`mask` defines, which values are considered to be necessary.
Example on a 0-dimensional |Variable|:
>>> from hydpy.core.va... | [
"def",
"verify",
"(",
"self",
")",
"->",
"None",
":",
"nmbnan",
":",
"int",
"=",
"numpy",
".",
"sum",
"(",
"numpy",
".",
"isnan",
"(",
"numpy",
".",
"array",
"(",
"self",
".",
"value",
")",
"[",
"self",
".",
"mask",
"]",
")",
")",
"if",
"nmbnan... | Raises a |RuntimeError| if at least one of the required values
of a |Variable| object is |None| or |numpy.nan|. The descriptor
`mask` defines, which values are considered to be necessary.
Example on a 0-dimensional |Variable|:
>>> from hydpy.core.variabletools import Variable
>... | [
"Raises",
"a",
"|RuntimeError|",
"if",
"at",
"least",
"one",
"of",
"the",
"required",
"values",
"of",
"a",
"|Variable|",
"object",
"is",
"|None|",
"or",
"|numpy",
".",
"nan|",
".",
"The",
"descriptor",
"mask",
"defines",
"which",
"values",
"are",
"considered... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L1271-L1327 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | Variable.average_values | def average_values(self, *args, **kwargs) -> float:
"""Average the actual values of the |Variable| object.
For 0-dimensional |Variable| objects, the result of method
|Variable.average_values| equals |Variable.value|. The
following example shows this for the sloppily defined class
... | python | def average_values(self, *args, **kwargs) -> float:
"""Average the actual values of the |Variable| object.
For 0-dimensional |Variable| objects, the result of method
|Variable.average_values| equals |Variable.value|. The
following example shows this for the sloppily defined class
... | [
"def",
"average_values",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"->",
"float",
":",
"try",
":",
"if",
"not",
"self",
".",
"NDIM",
":",
"return",
"self",
".",
"value",
"mask",
"=",
"self",
".",
"get_submask",
"(",
"*",
"args",
... | Average the actual values of the |Variable| object.
For 0-dimensional |Variable| objects, the result of method
|Variable.average_values| equals |Variable.value|. The
following example shows this for the sloppily defined class
`SoilMoisture`:
>>> from hydpy.core.variabletools i... | [
"Average",
"the",
"actual",
"values",
"of",
"the",
"|Variable|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L1339-L1510 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | Variable.get_submask | def get_submask(self, *args, **kwargs) -> masktools.CustomMask:
"""Get a sub-mask of the mask handled by the actual |Variable| object
based on the given arguments.
See the documentation on method |Variable.average_values| for
further information.
"""
if args or kwargs:
... | python | def get_submask(self, *args, **kwargs) -> masktools.CustomMask:
"""Get a sub-mask of the mask handled by the actual |Variable| object
based on the given arguments.
See the documentation on method |Variable.average_values| for
further information.
"""
if args or kwargs:
... | [
"def",
"get_submask",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"->",
"masktools",
".",
"CustomMask",
":",
"if",
"args",
"or",
"kwargs",
":",
"masks",
"=",
"self",
".",
"availablemasks",
"mask",
"=",
"masktools",
".",
"CustomMask",
"... | Get a sub-mask of the mask handled by the actual |Variable| object
based on the given arguments.
See the documentation on method |Variable.average_values| for
further information. | [
"Get",
"a",
"sub",
"-",
"mask",
"of",
"the",
"mask",
"handled",
"by",
"the",
"actual",
"|Variable|",
"object",
"based",
"on",
"the",
"given",
"arguments",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L1517-L1538 | train |
hydpy-dev/hydpy | hydpy/core/variabletools.py | Variable.commentrepr | def commentrepr(self) -> List[str]:
"""A list with comments for making string representations
more informative.
With option |Options.reprcomments| being disabled,
|Variable.commentrepr| is empty.
"""
if hydpy.pub.options.reprcomments:
return [f'# {line}' for ... | python | def commentrepr(self) -> List[str]:
"""A list with comments for making string representations
more informative.
With option |Options.reprcomments| being disabled,
|Variable.commentrepr| is empty.
"""
if hydpy.pub.options.reprcomments:
return [f'# {line}' for ... | [
"def",
"commentrepr",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"if",
"hydpy",
".",
"pub",
".",
"options",
".",
"reprcomments",
":",
"return",
"[",
"f'# {line}'",
"for",
"line",
"in",
"textwrap",
".",
"wrap",
"(",
"objecttools",
".",
"descr... | A list with comments for making string representations
more informative.
With option |Options.reprcomments| being disabled,
|Variable.commentrepr| is empty. | [
"A",
"list",
"with",
"comments",
"for",
"making",
"string",
"representations",
"more",
"informative",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/variabletools.py#L1744-L1754 | train |
wind39/spartacus | Spartacus/Report.py | AddTable | def AddTable(p_workSheet = None, p_headerDict = None, p_startColumn = 1, p_startRow = 1, p_headerHeight = None, p_data = None, p_mainTable = False, p_conditionalFormatting = None, p_tableStyleInfo = None, p_withFilters = True):
"""Insert a table in a given worksheet.
Args:
p_workSheet (openpyxl... | python | def AddTable(p_workSheet = None, p_headerDict = None, p_startColumn = 1, p_startRow = 1, p_headerHeight = None, p_data = None, p_mainTable = False, p_conditionalFormatting = None, p_tableStyleInfo = None, p_withFilters = True):
"""Insert a table in a given worksheet.
Args:
p_workSheet (openpyxl... | [
"def",
"AddTable",
"(",
"p_workSheet",
"=",
"None",
",",
"p_headerDict",
"=",
"None",
",",
"p_startColumn",
"=",
"1",
",",
"p_startRow",
"=",
"1",
",",
"p_headerHeight",
"=",
"None",
",",
"p_data",
"=",
"None",
",",
"p_mainTable",
"=",
"False",
",",
"p_c... | Insert a table in a given worksheet.
Args:
p_workSheet (openpyxl.worksheet.worksheet.Worksheet): the worksheet where the table will be inserted. Defaults to None.
p_headerDict (collections.OrderedDict): an ordered dict that contains table header columns.
Notes:
... | [
"Insert",
"a",
"table",
"in",
"a",
"given",
"worksheet",
"."
] | 622261e9c5d05c2e385d81171acb910c63aa1669 | https://github.com/wind39/spartacus/blob/622261e9c5d05c2e385d81171acb910c63aa1669/Spartacus/Report.py#L607-L1054 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | get_controlfileheader | def get_controlfileheader(
model: Union[str, 'modeltools.Model'],
parameterstep: timetools.PeriodConstrArg = None,
simulationstep: timetools.PeriodConstrArg = None) -> str:
"""Return the header of a regular or auxiliary parameter control file.
The header contains the default coding info... | python | def get_controlfileheader(
model: Union[str, 'modeltools.Model'],
parameterstep: timetools.PeriodConstrArg = None,
simulationstep: timetools.PeriodConstrArg = None) -> str:
"""Return the header of a regular or auxiliary parameter control file.
The header contains the default coding info... | [
"def",
"get_controlfileheader",
"(",
"model",
":",
"Union",
"[",
"str",
",",
"'modeltools.Model'",
"]",
",",
"parameterstep",
":",
"timetools",
".",
"PeriodConstrArg",
"=",
"None",
",",
"simulationstep",
":",
"timetools",
".",
"PeriodConstrArg",
"=",
"None",
")"... | Return the header of a regular or auxiliary parameter control file.
The header contains the default coding information, the import command
for the given model and the actual parameter and simulation step sizes.
The first example shows that, if you pass the model argument as a
string, you have to take ... | [
"Return",
"the",
"header",
"of",
"a",
"regular",
"or",
"auxiliary",
"parameter",
"control",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L28-L80 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Constants._prepare_docstrings | def _prepare_docstrings(self, frame):
"""Assign docstrings to the constants handled by |Constants|
to make them available in the interactive mode of Python."""
if config.USEAUTODOC:
filename = inspect.getsourcefile(frame)
with open(filename) as file_:
sour... | python | def _prepare_docstrings(self, frame):
"""Assign docstrings to the constants handled by |Constants|
to make them available in the interactive mode of Python."""
if config.USEAUTODOC:
filename = inspect.getsourcefile(frame)
with open(filename) as file_:
sour... | [
"def",
"_prepare_docstrings",
"(",
"self",
",",
"frame",
")",
":",
"if",
"config",
".",
"USEAUTODOC",
":",
"filename",
"=",
"inspect",
".",
"getsourcefile",
"(",
"frame",
")",
"with",
"open",
"(",
"filename",
")",
"as",
"file_",
":",
"sources",
"=",
"fil... | Assign docstrings to the constants handled by |Constants|
to make them available in the interactive mode of Python. | [
"Assign",
"docstrings",
"to",
"the",
"constants",
"handled",
"by",
"|Constants|",
"to",
"make",
"them",
"available",
"in",
"the",
"interactive",
"mode",
"of",
"Python",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L106-L118 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameters.update | def update(self) -> None:
"""Call method |Parameter.update| of all "secondary" parameters.
Directly after initialisation, neither the primary (`control`)
parameters nor the secondary (`derived`) parameters of
application model |hstream_v1| are ready for usage:
>>> from hydpy.m... | python | def update(self) -> None:
"""Call method |Parameter.update| of all "secondary" parameters.
Directly after initialisation, neither the primary (`control`)
parameters nor the secondary (`derived`) parameters of
application model |hstream_v1| are ready for usage:
>>> from hydpy.m... | [
"def",
"update",
"(",
"self",
")",
"->",
"None",
":",
"for",
"subpars",
"in",
"self",
".",
"secondary_subpars",
":",
"for",
"par",
"in",
"subpars",
":",
"try",
":",
"par",
".",
"update",
"(",
")",
"except",
"BaseException",
":",
"objecttools",
".",
"au... | Call method |Parameter.update| of all "secondary" parameters.
Directly after initialisation, neither the primary (`control`)
parameters nor the secondary (`derived`) parameters of
application model |hstream_v1| are ready for usage:
>>> from hydpy.models.hstream_v1 import *
>>>... | [
"Call",
"method",
"|Parameter",
".",
"update|",
"of",
"all",
"secondary",
"parameters",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L143-L188 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameters.save_controls | def save_controls(self, filepath: Optional[str] = None,
parameterstep: timetools.PeriodConstrArg = None,
simulationstep: timetools.PeriodConstrArg = None,
auxfiler: 'auxfiletools.Auxfiler' = None):
"""Write the control parameters to file.
... | python | def save_controls(self, filepath: Optional[str] = None,
parameterstep: timetools.PeriodConstrArg = None,
simulationstep: timetools.PeriodConstrArg = None,
auxfiler: 'auxfiletools.Auxfiler' = None):
"""Write the control parameters to file.
... | [
"def",
"save_controls",
"(",
"self",
",",
"filepath",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"parameterstep",
":",
"timetools",
".",
"PeriodConstrArg",
"=",
"None",
",",
"simulationstep",
":",
"timetools",
".",
"PeriodConstrArg",
"=",
"None",
",... | Write the control parameters to file.
Usually, a control file consists of a header (see the documentation
on the method |get_controlfileheader|) and the string representations
of the individual |Parameter| objects handled by the `control`
|SubParameters| object.
The main functi... | [
"Write",
"the",
"control",
"parameters",
"to",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L190-L272 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter._get_values_from_auxiliaryfile | def _get_values_from_auxiliaryfile(self, auxfile):
"""Try to return the parameter values from the auxiliary control file
with the given name.
Things are a little complicated here. To understand this method, you
should first take a look at the |parameterstep| function.
"""
... | python | def _get_values_from_auxiliaryfile(self, auxfile):
"""Try to return the parameter values from the auxiliary control file
with the given name.
Things are a little complicated here. To understand this method, you
should first take a look at the |parameterstep| function.
"""
... | [
"def",
"_get_values_from_auxiliaryfile",
"(",
"self",
",",
"auxfile",
")",
":",
"try",
":",
"frame",
"=",
"inspect",
".",
"currentframe",
"(",
")",
".",
"f_back",
".",
"f_back",
"while",
"frame",
":",
"namespace",
"=",
"frame",
".",
"f_locals",
"try",
":",... | Try to return the parameter values from the auxiliary control file
with the given name.
Things are a little complicated here. To understand this method, you
should first take a look at the |parameterstep| function. | [
"Try",
"to",
"return",
"the",
"parameter",
"values",
"from",
"the",
"auxiliary",
"control",
"file",
"with",
"the",
"given",
"name",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L920-L952 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter.initinfo | def initinfo(self) -> Tuple[Union[float, int, bool], bool]:
"""The actual initial value of the given parameter.
Some |Parameter| subclasses define another value for class
attribute `INIT` than |None| to provide a default value.
Let's define a parameter test class and prepare a function... | python | def initinfo(self) -> Tuple[Union[float, int, bool], bool]:
"""The actual initial value of the given parameter.
Some |Parameter| subclasses define another value for class
attribute `INIT` than |None| to provide a default value.
Let's define a parameter test class and prepare a function... | [
"def",
"initinfo",
"(",
"self",
")",
"->",
"Tuple",
"[",
"Union",
"[",
"float",
",",
"int",
",",
"bool",
"]",
",",
"bool",
"]",
":",
"init",
"=",
"self",
".",
"INIT",
"if",
"(",
"init",
"is",
"not",
"None",
")",
"and",
"hydpy",
".",
"pub",
".",... | The actual initial value of the given parameter.
Some |Parameter| subclasses define another value for class
attribute `INIT` than |None| to provide a default value.
Let's define a parameter test class and prepare a function for
initialising it and connecting the resulting instance to a... | [
"The",
"actual",
"initial",
"value",
"of",
"the",
"given",
"parameter",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L971-L1034 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter.get_timefactor | def get_timefactor(cls) -> float:
"""Factor to adjust a new value of a time-dependent parameter.
For a time-dependent parameter, its effective value depends on the
simulation step size. Method |Parameter.get_timefactor| returns
the fraction between the current simulation step size and ... | python | def get_timefactor(cls) -> float:
"""Factor to adjust a new value of a time-dependent parameter.
For a time-dependent parameter, its effective value depends on the
simulation step size. Method |Parameter.get_timefactor| returns
the fraction between the current simulation step size and ... | [
"def",
"get_timefactor",
"(",
"cls",
")",
"->",
"float",
":",
"try",
":",
"parfactor",
"=",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"parfactor",
"except",
"RuntimeError",
":",
"if",
"not",
"(",
"cls",
".",
"parameterstep",
"and",
"cls",
".",
"simulat... | Factor to adjust a new value of a time-dependent parameter.
For a time-dependent parameter, its effective value depends on the
simulation step size. Method |Parameter.get_timefactor| returns
the fraction between the current simulation step size and the
current parameter step size.
... | [
"Factor",
"to",
"adjust",
"a",
"new",
"value",
"of",
"a",
"time",
"-",
"dependent",
"parameter",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1037-L1093 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter.apply_timefactor | def apply_timefactor(cls, values):
"""Change and return the given value(s) in accordance with
|Parameter.get_timefactor| and the type of time-dependence
of the actual parameter subclass.
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
For... | python | def apply_timefactor(cls, values):
"""Change and return the given value(s) in accordance with
|Parameter.get_timefactor| and the type of time-dependence
of the actual parameter subclass.
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
For... | [
"def",
"apply_timefactor",
"(",
"cls",
",",
"values",
")",
":",
"if",
"cls",
".",
"TIME",
"is",
"True",
":",
"return",
"values",
"*",
"cls",
".",
"get_timefactor",
"(",
")",
"if",
"cls",
".",
"TIME",
"is",
"False",
":",
"return",
"values",
"/",
"cls"... | Change and return the given value(s) in accordance with
|Parameter.get_timefactor| and the type of time-dependence
of the actual parameter subclass.
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
For the same conversion factor returned by method... | [
"Change",
"and",
"return",
"the",
"given",
"value",
"(",
"s",
")",
"in",
"accordance",
"with",
"|Parameter",
".",
"get_timefactor|",
"and",
"the",
"type",
"of",
"time",
"-",
"dependence",
"of",
"the",
"actual",
"parameter",
"subclass",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1100-L1152 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter.revert_timefactor | def revert_timefactor(cls, values):
"""The inverse version of method |Parameter.apply_timefactor|.
See the explanations on method Parameter.apply_timefactor| to
understand the following examples:
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
... | python | def revert_timefactor(cls, values):
"""The inverse version of method |Parameter.apply_timefactor|.
See the explanations on method Parameter.apply_timefactor| to
understand the following examples:
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
... | [
"def",
"revert_timefactor",
"(",
"cls",
",",
"values",
")",
":",
"if",
"cls",
".",
"TIME",
"is",
"True",
":",
"return",
"values",
"/",
"cls",
".",
"get_timefactor",
"(",
")",
"if",
"cls",
".",
"TIME",
"is",
"False",
":",
"return",
"values",
"*",
"cls... | The inverse version of method |Parameter.apply_timefactor|.
See the explanations on method Parameter.apply_timefactor| to
understand the following examples:
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
>>> from hydpy.core.parametertools impor... | [
"The",
"inverse",
"version",
"of",
"method",
"|Parameter",
".",
"apply_timefactor|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1155-L1186 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | Parameter.compress_repr | def compress_repr(self) -> Optional[str]:
"""Try to find a compressed parameter value representation and
return it.
|Parameter.compress_repr| raises a |NotImplementedError| when
failing to find a compressed representation.
.. testsetup::
>>> from hydpy import pub
... | python | def compress_repr(self) -> Optional[str]:
"""Try to find a compressed parameter value representation and
return it.
|Parameter.compress_repr| raises a |NotImplementedError| when
failing to find a compressed representation.
.. testsetup::
>>> from hydpy import pub
... | [
"def",
"compress_repr",
"(",
"self",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'value'",
")",
":",
"return",
"'?'",
"if",
"not",
"self",
":",
"return",
"f\"{self.NDIM * '['}{self.NDIM * ']'}\"",
"unique",
"=",
... | Try to find a compressed parameter value representation and
return it.
|Parameter.compress_repr| raises a |NotImplementedError| when
failing to find a compressed representation.
.. testsetup::
>>> from hydpy import pub
>>> del pub.timegrids
For the fol... | [
"Try",
"to",
"find",
"a",
"compressed",
"parameter",
"value",
"representation",
"and",
"return",
"it",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1209-L1336 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | NameParameter.compress_repr | def compress_repr(self) -> str:
"""Works as |Parameter.compress_repr|, but returns a
string with constant names instead of constant values.
See the main documentation on class |NameParameter| for
further information.
"""
string = super().compress_repr()
if string... | python | def compress_repr(self) -> str:
"""Works as |Parameter.compress_repr|, but returns a
string with constant names instead of constant values.
See the main documentation on class |NameParameter| for
further information.
"""
string = super().compress_repr()
if string... | [
"def",
"compress_repr",
"(",
"self",
")",
"->",
"str",
":",
"string",
"=",
"super",
"(",
")",
".",
"compress_repr",
"(",
")",
"if",
"string",
"in",
"(",
"'?'",
",",
"'[]'",
")",
":",
"return",
"string",
"if",
"string",
"is",
"None",
":",
"values",
... | Works as |Parameter.compress_repr|, but returns a
string with constant names instead of constant values.
See the main documentation on class |NameParameter| for
further information. | [
"Works",
"as",
"|Parameter",
".",
"compress_repr|",
"but",
"returns",
"a",
"string",
"with",
"constant",
"names",
"instead",
"of",
"constant",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1431-L1451 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | ZipParameter.compress_repr | def compress_repr(self) -> Optional[str]:
"""Works as |Parameter.compress_repr|, but alternatively
tries to compress by following an external classification.
See the main documentation on class |ZipParameter| for
further information.
"""
string = super().compress_repr()
... | python | def compress_repr(self) -> Optional[str]:
"""Works as |Parameter.compress_repr|, but alternatively
tries to compress by following an external classification.
See the main documentation on class |ZipParameter| for
further information.
"""
string = super().compress_repr()
... | [
"def",
"compress_repr",
"(",
"self",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"string",
"=",
"super",
"(",
")",
".",
"compress_repr",
"(",
")",
"if",
"string",
"is",
"not",
"None",
":",
"return",
"string",
"results",
"=",
"[",
"]",
"mask",
"=",
... | Works as |Parameter.compress_repr|, but alternatively
tries to compress by following an external classification.
See the main documentation on class |ZipParameter| for
further information. | [
"Works",
"as",
"|Parameter",
".",
"compress_repr|",
"but",
"alternatively",
"tries",
"to",
"compress",
"by",
"following",
"an",
"external",
"classification",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1647-L1670 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | SeasonalParameter.refresh | def refresh(self) -> None:
"""Update the actual simulation values based on the toy-value pairs.
Usually, one does not need to call refresh explicitly. The
"magic" methods __call__, __setattr__, and __delattr__ invoke
it automatically, when required.
Instantiate a 1-dimensional... | python | def refresh(self) -> None:
"""Update the actual simulation values based on the toy-value pairs.
Usually, one does not need to call refresh explicitly. The
"magic" methods __call__, __setattr__, and __delattr__ invoke
it automatically, when required.
Instantiate a 1-dimensional... | [
"def",
"refresh",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
":",
"self",
".",
"values",
"[",
":",
"]",
"=",
"0.",
"elif",
"len",
"(",
"self",
")",
"==",
"1",
":",
"values",
"=",
"list",
"(",
"self",
".",
"_toy2values",
".",
"val... | Update the actual simulation values based on the toy-value pairs.
Usually, one does not need to call refresh explicitly. The
"magic" methods __call__, __setattr__, and __delattr__ invoke
it automatically, when required.
Instantiate a 1-dimensional |SeasonalParameter| object:
... | [
"Update",
"the",
"actual",
"simulation",
"values",
"based",
"on",
"the",
"toy",
"-",
"value",
"pairs",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1861-L1935 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | SeasonalParameter.interp | def interp(self, date: timetools.Date) -> float:
"""Perform a linear value interpolation for the given `date` and
return the result.
Instantiate a 1-dimensional |SeasonalParameter| object:
>>> from hydpy.core.parametertools import SeasonalParameter
>>> class Par(SeasonalParamet... | python | def interp(self, date: timetools.Date) -> float:
"""Perform a linear value interpolation for the given `date` and
return the result.
Instantiate a 1-dimensional |SeasonalParameter| object:
>>> from hydpy.core.parametertools import SeasonalParameter
>>> class Par(SeasonalParamet... | [
"def",
"interp",
"(",
"self",
",",
"date",
":",
"timetools",
".",
"Date",
")",
"->",
"float",
":",
"xnew",
"=",
"timetools",
".",
"TOY",
"(",
"date",
")",
"xys",
"=",
"list",
"(",
"self",
")",
"for",
"idx",
",",
"(",
"x_1",
",",
"y_1",
")",
"in... | Perform a linear value interpolation for the given `date` and
return the result.
Instantiate a 1-dimensional |SeasonalParameter| object:
>>> from hydpy.core.parametertools import SeasonalParameter
>>> class Par(SeasonalParameter):
... NDIM = 1
... TYPE = float
... | [
"Perform",
"a",
"linear",
"value",
"interpolation",
"for",
"the",
"given",
"date",
"and",
"return",
"the",
"result",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L1937-L2019 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | RelSubweightsMixin.update | def update(self) -> None:
"""Update subclass of |RelSubweightsMixin| based on `refweights`."""
mask = self.mask
weights = self.refweights[mask]
self[~mask] = numpy.nan
self[mask] = weights/numpy.sum(weights) | python | def update(self) -> None:
"""Update subclass of |RelSubweightsMixin| based on `refweights`."""
mask = self.mask
weights = self.refweights[mask]
self[~mask] = numpy.nan
self[mask] = weights/numpy.sum(weights) | [
"def",
"update",
"(",
"self",
")",
"->",
"None",
":",
"mask",
"=",
"self",
".",
"mask",
"weights",
"=",
"self",
".",
"refweights",
"[",
"mask",
"]",
"self",
"[",
"~",
"mask",
"]",
"=",
"numpy",
".",
"nan",
"self",
"[",
"mask",
"]",
"=",
"weights"... | Update subclass of |RelSubweightsMixin| based on `refweights`. | [
"Update",
"subclass",
"of",
"|RelSubweightsMixin|",
"based",
"on",
"refweights",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L2476-L2481 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | SolverParameter.alternative_initvalue | def alternative_initvalue(self) -> Union[bool, int, float]:
"""A user-defined value to be used instead of the value of class
constant `INIT`.
See the main documentation on class |SolverParameter| for more
information.
"""
if self._alternative_initvalue is None:
... | python | def alternative_initvalue(self) -> Union[bool, int, float]:
"""A user-defined value to be used instead of the value of class
constant `INIT`.
See the main documentation on class |SolverParameter| for more
information.
"""
if self._alternative_initvalue is None:
... | [
"def",
"alternative_initvalue",
"(",
"self",
")",
"->",
"Union",
"[",
"bool",
",",
"int",
",",
"float",
"]",
":",
"if",
"self",
".",
"_alternative_initvalue",
"is",
"None",
":",
"raise",
"AttributeError",
"(",
"f'No alternative initial value for solver parameter '",... | A user-defined value to be used instead of the value of class
constant `INIT`.
See the main documentation on class |SolverParameter| for more
information. | [
"A",
"user",
"-",
"defined",
"value",
"to",
"be",
"used",
"instead",
"of",
"the",
"value",
"of",
"class",
"constant",
"INIT",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L2740-L2752 | train |
hydpy-dev/hydpy | hydpy/core/parametertools.py | TOYParameter.update | def update(self) -> None:
"""Reference the actual |Indexer.timeofyear| array of the
|Indexer| object available in module |pub|.
>>> from hydpy import pub
>>> pub.timegrids = '27.02.2004', '3.03.2004', '1d'
>>> from hydpy.core.parametertools import TOYParameter
>>> toypar... | python | def update(self) -> None:
"""Reference the actual |Indexer.timeofyear| array of the
|Indexer| object available in module |pub|.
>>> from hydpy import pub
>>> pub.timegrids = '27.02.2004', '3.03.2004', '1d'
>>> from hydpy.core.parametertools import TOYParameter
>>> toypar... | [
"def",
"update",
"(",
"self",
")",
"->",
"None",
":",
"indexarray",
"=",
"hydpy",
".",
"pub",
".",
"indexer",
".",
"timeofyear",
"self",
".",
"shape",
"=",
"indexarray",
".",
"shape",
"self",
".",
"values",
"=",
"indexarray"
] | Reference the actual |Indexer.timeofyear| array of the
|Indexer| object available in module |pub|.
>>> from hydpy import pub
>>> pub.timegrids = '27.02.2004', '3.03.2004', '1d'
>>> from hydpy.core.parametertools import TOYParameter
>>> toyparameter = TOYParameter(None)
>... | [
"Reference",
"the",
"actual",
"|Indexer",
".",
"timeofyear|",
"array",
"of",
"the",
"|Indexer|",
"object",
"available",
"in",
"module",
"|pub|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/parametertools.py#L2792-L2806 | train |
arteria/django-openinghours | openinghours/utils.py | get_premises_model | def get_premises_model():
"""
Support for custom company premises model
with developer friendly validation.
"""
try:
app_label, model_name = PREMISES_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL must be of the"
... | python | def get_premises_model():
"""
Support for custom company premises model
with developer friendly validation.
"""
try:
app_label, model_name = PREMISES_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL must be of the"
... | [
"def",
"get_premises_model",
"(",
")",
":",
"try",
":",
"app_label",
",",
"model_name",
"=",
"PREMISES_MODEL",
".",
"split",
"(",
"'.'",
")",
"except",
"ValueError",
":",
"raise",
"ImproperlyConfigured",
"(",
"\"OPENINGHOURS_PREMISES_MODEL must be of the\"",
"\" form ... | Support for custom company premises model
with developer friendly validation. | [
"Support",
"for",
"custom",
"company",
"premises",
"model",
"with",
"developer",
"friendly",
"validation",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/utils.py#L13-L28 | train |
arteria/django-openinghours | openinghours/utils.py | get_now | def get_now():
"""
Allows to access global request and read a timestamp from query.
"""
if not get_current_request:
return datetime.datetime.now()
request = get_current_request()
if request:
openinghours_now = request.GET.get('openinghours-now')
if openinghours_now:
... | python | def get_now():
"""
Allows to access global request and read a timestamp from query.
"""
if not get_current_request:
return datetime.datetime.now()
request = get_current_request()
if request:
openinghours_now = request.GET.get('openinghours-now')
if openinghours_now:
... | [
"def",
"get_now",
"(",
")",
":",
"if",
"not",
"get_current_request",
":",
"return",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"request",
"=",
"get_current_request",
"(",
")",
"if",
"request",
":",
"openinghours_now",
"=",
"request",
".",
"GET",
".... | Allows to access global request and read a timestamp from query. | [
"Allows",
"to",
"access",
"global",
"request",
"and",
"read",
"a",
"timestamp",
"from",
"query",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/utils.py#L33-L44 | train |
arteria/django-openinghours | openinghours/utils.py | get_closing_rule_for_now | def get_closing_rule_for_now(location):
"""
Returns QuerySet of ClosingRules that are currently valid
"""
now = get_now()
if location:
return ClosingRules.objects.filter(company=location,
start__lte=now, end__gte=now)
return Company.objects.fi... | python | def get_closing_rule_for_now(location):
"""
Returns QuerySet of ClosingRules that are currently valid
"""
now = get_now()
if location:
return ClosingRules.objects.filter(company=location,
start__lte=now, end__gte=now)
return Company.objects.fi... | [
"def",
"get_closing_rule_for_now",
"(",
"location",
")",
":",
"now",
"=",
"get_now",
"(",
")",
"if",
"location",
":",
"return",
"ClosingRules",
".",
"objects",
".",
"filter",
"(",
"company",
"=",
"location",
",",
"start__lte",
"=",
"now",
",",
"end__gte",
... | Returns QuerySet of ClosingRules that are currently valid | [
"Returns",
"QuerySet",
"of",
"ClosingRules",
"that",
"are",
"currently",
"valid"
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/utils.py#L47-L58 | train |
arteria/django-openinghours | openinghours/utils.py | is_open | def is_open(location, now=None):
"""
Is the company currently open? Pass "now" to test with a specific
timestamp. Can be used stand-alone or as a helper.
"""
if now is None:
now = get_now()
if has_closing_rule_for_now(location):
return False
now_time = datetime.time(now.hou... | python | def is_open(location, now=None):
"""
Is the company currently open? Pass "now" to test with a specific
timestamp. Can be used stand-alone or as a helper.
"""
if now is None:
now = get_now()
if has_closing_rule_for_now(location):
return False
now_time = datetime.time(now.hou... | [
"def",
"is_open",
"(",
"location",
",",
"now",
"=",
"None",
")",
":",
"if",
"now",
"is",
"None",
":",
"now",
"=",
"get_now",
"(",
")",
"if",
"has_closing_rule_for_now",
"(",
"location",
")",
":",
"return",
"False",
"now_time",
"=",
"datetime",
".",
"ti... | Is the company currently open? Pass "now" to test with a specific
timestamp. Can be used stand-alone or as a helper. | [
"Is",
"the",
"company",
"currently",
"open?",
"Pass",
"now",
"to",
"test",
"with",
"a",
"specific",
"timestamp",
".",
"Can",
"be",
"used",
"stand",
"-",
"alone",
"or",
"as",
"a",
"helper",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/utils.py#L69-L111 | train |
arteria/django-openinghours | openinghours/utils.py | next_time_open | def next_time_open(location):
"""
Returns the next possible opening hours object, or (False, None)
if location is currently open or there is no such object
I.e. when is the company open for the next time?
"""
if not is_open(location):
now = get_now()
now_time = datetime.time(now.... | python | def next_time_open(location):
"""
Returns the next possible opening hours object, or (False, None)
if location is currently open or there is no such object
I.e. when is the company open for the next time?
"""
if not is_open(location):
now = get_now()
now_time = datetime.time(now.... | [
"def",
"next_time_open",
"(",
"location",
")",
":",
"if",
"not",
"is_open",
"(",
"location",
")",
":",
"now",
"=",
"get_now",
"(",
")",
"now_time",
"=",
"datetime",
".",
"time",
"(",
"now",
".",
"hour",
",",
"now",
".",
"minute",
",",
"now",
".",
"... | Returns the next possible opening hours object, or (False, None)
if location is currently open or there is no such object
I.e. when is the company open for the next time? | [
"Returns",
"the",
"next",
"possible",
"opening",
"hours",
"object",
"or",
"(",
"False",
"None",
")",
"if",
"location",
"is",
"currently",
"open",
"or",
"there",
"is",
"no",
"such",
"object",
"I",
".",
"e",
".",
"when",
"is",
"the",
"company",
"open",
"... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/utils.py#L114-L148 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_states.py | QJoints.refweights | def refweights(self):
"""A |numpy| |numpy.ndarray| with equal weights for all segment
junctions..
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> states.qjoints.shape = 5
>>> states.qjoints.refweights
array([ 0.2, 0.2, 0.2, 0.2, 0.2])
... | python | def refweights(self):
"""A |numpy| |numpy.ndarray| with equal weights for all segment
junctions..
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> states.qjoints.shape = 5
>>> states.qjoints.refweights
array([ 0.2, 0.2, 0.2, 0.2, 0.2])
... | [
"def",
"refweights",
"(",
"self",
")",
":",
"# pylint: disable=unsubscriptable-object",
"# due to a pylint bug (see https://github.com/PyCQA/pylint/issues/870)",
"return",
"numpy",
".",
"full",
"(",
"self",
".",
"shape",
",",
"1.",
"/",
"self",
".",
"shape",
"[",
"0",
... | A |numpy| |numpy.ndarray| with equal weights for all segment
junctions..
>>> from hydpy.models.hstream import *
>>> parameterstep('1d')
>>> states.qjoints.shape = 5
>>> states.qjoints.refweights
array([ 0.2, 0.2, 0.2, 0.2, 0.2]) | [
"A",
"|numpy|",
"|numpy",
".",
"ndarray|",
"with",
"equal",
"weights",
"for",
"all",
"segment",
"junctions",
".."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_states.py#L57-L69 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | Folder2Path.add | def add(self, directory, path=None) -> None:
"""Add a directory and optionally its path."""
objecttools.valid_variable_identifier(directory)
if path is None:
path = directory
setattr(self, directory, path) | python | def add(self, directory, path=None) -> None:
"""Add a directory and optionally its path."""
objecttools.valid_variable_identifier(directory)
if path is None:
path = directory
setattr(self, directory, path) | [
"def",
"add",
"(",
"self",
",",
"directory",
",",
"path",
"=",
"None",
")",
"->",
"None",
":",
"objecttools",
".",
"valid_variable_identifier",
"(",
"directory",
")",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"directory",
"setattr",
"(",
"self",
",",... | Add a directory and optionally its path. | [
"Add",
"a",
"directory",
"and",
"optionally",
"its",
"path",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L108-L113 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.basepath | def basepath(self) -> str:
"""Absolute path pointing to the available working directories.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy impo... | python | def basepath(self) -> str:
"""Absolute path pointing to the available working directories.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy impo... | [
"def",
"basepath",
"(",
"self",
")",
"->",
"str",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"projectdir",
",",
"self",
".",
"BASEDIR",
")",
")"
] | Absolute path pointing to the available working directories.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy import repr_, TestIO
>>> with Test... | [
"Absolute",
"path",
"pointing",
"to",
"the",
"available",
"working",
"directories",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L218-L231 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.availabledirs | def availabledirs(self) -> Folder2Path:
"""Names and paths of the available working directories.
Available working directories are those beeing stored in the
base directory of the respective |FileManager| subclass.
Folders with names starting with an underscore are ignored
(use ... | python | def availabledirs(self) -> Folder2Path:
"""Names and paths of the available working directories.
Available working directories are those beeing stored in the
base directory of the respective |FileManager| subclass.
Folders with names starting with an underscore are ignored
(use ... | [
"def",
"availabledirs",
"(",
"self",
")",
"->",
"Folder2Path",
":",
"directories",
"=",
"Folder2Path",
"(",
")",
"for",
"directory",
"in",
"os",
".",
"listdir",
"(",
"self",
".",
"basepath",
")",
":",
"if",
"not",
"directory",
".",
"startswith",
"(",
"'_... | Names and paths of the available working directories.
Available working directories are those beeing stored in the
base directory of the respective |FileManager| subclass.
Folders with names starting with an underscore are ignored
(use this for directories handling additional data files... | [
"Names",
"and",
"paths",
"of",
"the",
"available",
"working",
"directories",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L234-L270 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.currentdir | def currentdir(self) -> str:
"""Name of the current working directory containing the relevant files.
To show most of the functionality of |property|
|FileManager.currentdir| (unpacking zip files on the fly is
explained in the documentation on function
(|FileManager.zip_currentdi... | python | def currentdir(self) -> str:
"""Name of the current working directory containing the relevant files.
To show most of the functionality of |property|
|FileManager.currentdir| (unpacking zip files on the fly is
explained in the documentation on function
(|FileManager.zip_currentdi... | [
"def",
"currentdir",
"(",
"self",
")",
"->",
"str",
":",
"if",
"self",
".",
"_currentdir",
"is",
"None",
":",
"directories",
"=",
"self",
".",
"availabledirs",
".",
"folders",
"if",
"len",
"(",
"directories",
")",
"==",
"1",
":",
"self",
".",
"currentd... | Name of the current working directory containing the relevant files.
To show most of the functionality of |property|
|FileManager.currentdir| (unpacking zip files on the fly is
explained in the documentation on function
(|FileManager.zip_currentdir|), we first prepare a |FileManager|
... | [
"Name",
"of",
"the",
"current",
"working",
"directory",
"containing",
"the",
"relevant",
"files",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L273-L435 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.currentpath | def currentpath(self) -> str:
"""Absolute path of the current working directory.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy import repr_, ... | python | def currentpath(self) -> str:
"""Absolute path of the current working directory.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy import repr_, ... | [
"def",
"currentpath",
"(",
"self",
")",
"->",
"str",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"basepath",
",",
"self",
".",
"currentdir",
")"
] | Absolute path of the current working directory.
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'
>>> from hydpy import repr_, TestIO
>>> with TestIO():
... | [
"Absolute",
"path",
"of",
"the",
"current",
"working",
"directory",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L469-L482 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.filenames | def filenames(self) -> List[str]:
"""Names of the files contained in the the current working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
... | python | def filenames(self) -> List[str]:
"""Names of the files contained in the the current working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
... | [
"def",
"filenames",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"sorted",
"(",
"fn",
"for",
"fn",
"in",
"os",
".",
"listdir",
"(",
"self",
".",
"currentpath",
")",
"if",
"not",
"fn",
".",
"startswith",
"(",
"'_'",
")",
")"
] | Names of the files contained in the the current working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectdir = 'projectname'... | [
"Names",
"of",
"the",
"files",
"contained",
"in",
"the",
"the",
"current",
"working",
"directory",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L485-L505 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.filepaths | def filepaths(self) -> List[str]:
"""Absolute path names of the files contained in the current
working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR ... | python | def filepaths(self) -> List[str]:
"""Absolute path names of the files contained in the current
working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR ... | [
"def",
"filepaths",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"path",
"=",
"self",
".",
"currentpath",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"name",
")",
"for",
"name",
"in",
"self",
".",
"filenames",
"]"
] | Absolute path names of the files contained in the current
working directory.
Files names starting with underscores are ignored:
>>> from hydpy.core.filetools import FileManager
>>> filemanager = FileManager()
>>> filemanager.BASEDIR = 'basename'
>>> filemanager.projectd... | [
"Absolute",
"path",
"names",
"of",
"the",
"files",
"contained",
"in",
"the",
"current",
"working",
"directory",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L508-L530 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | FileManager.zip_currentdir | def zip_currentdir(self) -> None:
"""Pack the current working directory in a `zip` file.
|FileManager| subclasses allow for manual packing and automatic
unpacking of working directories. The only supported format is `zip`.
To avoid possible inconsistencies, origin directories and zip
... | python | def zip_currentdir(self) -> None:
"""Pack the current working directory in a `zip` file.
|FileManager| subclasses allow for manual packing and automatic
unpacking of working directories. The only supported format is `zip`.
To avoid possible inconsistencies, origin directories and zip
... | [
"def",
"zip_currentdir",
"(",
"self",
")",
"->",
"None",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"f'{self.currentpath}.zip'",
",",
"'w'",
")",
"as",
"zipfile_",
":",
"for",
"filepath",
",",
"filename",
"in",
"zip",
"(",
"self",
".",
"filepaths",
",",
... | Pack the current working directory in a `zip` file.
|FileManager| subclasses allow for manual packing and automatic
unpacking of working directories. The only supported format is `zip`.
To avoid possible inconsistencies, origin directories and zip
files are removed after packing or unp... | [
"Pack",
"the",
"current",
"working",
"directory",
"in",
"a",
"zip",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L532-L603 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | NetworkManager.load_files | def load_files(self) -> selectiontools.Selections:
"""Read all network files of the current working directory, structure
their contents in a |selectiontools.Selections| object, and return it.
"""
devicetools.Node.clear_all()
devicetools.Element.clear_all()
selections = se... | python | def load_files(self) -> selectiontools.Selections:
"""Read all network files of the current working directory, structure
their contents in a |selectiontools.Selections| object, and return it.
"""
devicetools.Node.clear_all()
devicetools.Element.clear_all()
selections = se... | [
"def",
"load_files",
"(",
"self",
")",
"->",
"selectiontools",
".",
"Selections",
":",
"devicetools",
".",
"Node",
".",
"clear_all",
"(",
")",
"devicetools",
".",
"Element",
".",
"clear_all",
"(",
")",
"selections",
"=",
"selectiontools",
".",
"Selections",
... | Read all network files of the current working directory, structure
their contents in a |selectiontools.Selections| object, and return it. | [
"Read",
"all",
"network",
"files",
"of",
"the",
"current",
"working",
"directory",
"structure",
"their",
"contents",
"in",
"a",
"|selectiontools",
".",
"Selections|",
"object",
"and",
"return",
"it",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L731-L763 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | NetworkManager.save_files | def save_files(self, selections) -> None:
"""Save the |Selection| objects contained in the given |Selections|
instance to separate network files."""
try:
currentpath = self.currentpath
selections = selectiontools.Selections(selections)
for selection in selecti... | python | def save_files(self, selections) -> None:
"""Save the |Selection| objects contained in the given |Selections|
instance to separate network files."""
try:
currentpath = self.currentpath
selections = selectiontools.Selections(selections)
for selection in selecti... | [
"def",
"save_files",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"try",
":",
"currentpath",
"=",
"self",
".",
"currentpath",
"selections",
"=",
"selectiontools",
".",
"Selections",
"(",
"selections",
")",
"for",
"selection",
"in",
"selections",
"... | Save the |Selection| objects contained in the given |Selections|
instance to separate network files. | [
"Save",
"the",
"|Selection|",
"objects",
"contained",
"in",
"the",
"given",
"|Selections|",
"instance",
"to",
"separate",
"network",
"files",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L765-L779 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | NetworkManager.delete_files | def delete_files(self, selections) -> None:
"""Delete the network files corresponding to the given selections
(e.g. a |list| of |str| objects or a |Selections| object)."""
try:
currentpath = self.currentpath
for selection in selections:
name = str(selectio... | python | def delete_files(self, selections) -> None:
"""Delete the network files corresponding to the given selections
(e.g. a |list| of |str| objects or a |Selections| object)."""
try:
currentpath = self.currentpath
for selection in selections:
name = str(selectio... | [
"def",
"delete_files",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"try",
":",
"currentpath",
"=",
"self",
".",
"currentpath",
"for",
"selection",
"in",
"selections",
":",
"name",
"=",
"str",
"(",
"selection",
")",
"if",
"name",
"==",
"'compl... | Delete the network files corresponding to the given selections
(e.g. a |list| of |str| objects or a |Selections| object). | [
"Delete",
"the",
"network",
"files",
"corresponding",
"to",
"the",
"given",
"selections",
"(",
"e",
".",
"g",
".",
"a",
"|list|",
"of",
"|str|",
"objects",
"or",
"a",
"|Selections|",
"object",
")",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L781-L797 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | ControlManager.load_file | def load_file(self, element=None, filename=None, clear_registry=True):
"""Return the namespace of the given file (and eventually of its
corresponding auxiliary subfiles) as a |dict|.
By default, the internal registry is cleared when a control file and
all its corresponding auxiliary fil... | python | def load_file(self, element=None, filename=None, clear_registry=True):
"""Return the namespace of the given file (and eventually of its
corresponding auxiliary subfiles) as a |dict|.
By default, the internal registry is cleared when a control file and
all its corresponding auxiliary fil... | [
"def",
"load_file",
"(",
"self",
",",
"element",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"clear_registry",
"=",
"True",
")",
":",
"if",
"not",
"filename",
":",
"filename",
"=",
"element",
".",
"name",
"type",
"(",
"self",
")",
".",
"_workingpat... | Return the namespace of the given file (and eventually of its
corresponding auxiliary subfiles) as a |dict|.
By default, the internal registry is cleared when a control file and
all its corresponding auxiliary files have been loaded. You can
change this behaviour by passing `False` for... | [
"Return",
"the",
"namespace",
"of",
"the",
"given",
"file",
"(",
"and",
"eventually",
"of",
"its",
"corresponding",
"auxiliary",
"subfiles",
")",
"as",
"a",
"|dict|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L810-L834 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | ControlManager.read2dict | def read2dict(cls, filename, info):
"""Read the control parameters from the given path (and its
auxiliary paths, where appropriate) and store them in the given
|dict| object `info`.
Note that the |dict| `info` can be used to feed information
into the execution of control files. ... | python | def read2dict(cls, filename, info):
"""Read the control parameters from the given path (and its
auxiliary paths, where appropriate) and store them in the given
|dict| object `info`.
Note that the |dict| `info` can be used to feed information
into the execution of control files. ... | [
"def",
"read2dict",
"(",
"cls",
",",
"filename",
",",
"info",
")",
":",
"if",
"not",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
":",
"filename",
"+=",
"'.py'",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cls",
".",
"_workingpath",
",",
... | Read the control parameters from the given path (and its
auxiliary paths, where appropriate) and store them in the given
|dict| object `info`.
Note that the |dict| `info` can be used to feed information
into the execution of control files. Use this method only if you
are comple... | [
"Read",
"the",
"control",
"parameters",
"from",
"the",
"given",
"path",
"(",
"and",
"its",
"auxiliary",
"paths",
"where",
"appropriate",
")",
"and",
"store",
"them",
"in",
"the",
"given",
"|dict|",
"object",
"info",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L837-L865 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | ControlManager.save_file | def save_file(self, filename, text):
"""Save the given text under the given control filename and the
current path."""
if not filename.endswith('.py'):
filename += '.py'
path = os.path.join(self.currentpath, filename)
with open(path, 'w', encoding="utf-8") as file_:
... | python | def save_file(self, filename, text):
"""Save the given text under the given control filename and the
current path."""
if not filename.endswith('.py'):
filename += '.py'
path = os.path.join(self.currentpath, filename)
with open(path, 'w', encoding="utf-8") as file_:
... | [
"def",
"save_file",
"(",
"self",
",",
"filename",
",",
"text",
")",
":",
"if",
"not",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
":",
"filename",
"+=",
"'.py'",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"currentpath",
",",
... | Save the given text under the given control filename and the
current path. | [
"Save",
"the",
"given",
"text",
"under",
"the",
"given",
"control",
"filename",
"and",
"the",
"current",
"path",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L873-L880 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | ConditionManager.load_file | def load_file(self, filename):
"""Read and return the content of the given file.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation start date. If
such an directory does not exist, it is created immediately.
"""
... | python | def load_file(self, filename):
"""Read and return the content of the given file.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation start date. If
such an directory does not exist, it is created immediately.
"""
... | [
"def",
"load_file",
"(",
"self",
",",
"filename",
")",
":",
"_defaultdir",
"=",
"self",
".",
"DEFAULTDIR",
"try",
":",
"if",
"not",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
":",
"filename",
"+=",
"'.py'",
"try",
":",
"self",
".",
"DEFAULTDIR",
"... | Read and return the content of the given file.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation start date. If
such an directory does not exist, it is created immediately. | [
"Read",
"and",
"return",
"the",
"content",
"of",
"the",
"given",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L889-L913 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | ConditionManager.save_file | def save_file(self, filename, text):
"""Save the given text under the given condition filename and the
current path.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation end date. If
such an directory does not exist, i... | python | def save_file(self, filename, text):
"""Save the given text under the given condition filename and the
current path.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation end date. If
such an directory does not exist, i... | [
"def",
"save_file",
"(",
"self",
",",
"filename",
",",
"text",
")",
":",
"_defaultdir",
"=",
"self",
".",
"DEFAULTDIR",
"try",
":",
"if",
"not",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
":",
"filename",
"+=",
"'.py'",
"try",
":",
"self",
".",
... | Save the given text under the given condition filename and the
current path.
If the current directory is not defined explicitly, the directory
name is constructed with the actual simulation end date. If
such an directory does not exist, it is created immediately. | [
"Save",
"the",
"given",
"text",
"under",
"the",
"given",
"condition",
"filename",
"and",
"the",
"current",
"path",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L915-L940 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | SequenceManager.load_file | def load_file(self, sequence):
"""Load data from an "external" data file an pass it to
the given |IOSequence|."""
try:
if sequence.filetype_ext == 'npy':
sequence.series = sequence.adjust_series(
*self._load_npy(sequence))
elif sequence... | python | def load_file(self, sequence):
"""Load data from an "external" data file an pass it to
the given |IOSequence|."""
try:
if sequence.filetype_ext == 'npy':
sequence.series = sequence.adjust_series(
*self._load_npy(sequence))
elif sequence... | [
"def",
"load_file",
"(",
"self",
",",
"sequence",
")",
":",
"try",
":",
"if",
"sequence",
".",
"filetype_ext",
"==",
"'npy'",
":",
"sequence",
".",
"series",
"=",
"sequence",
".",
"adjust_series",
"(",
"*",
"self",
".",
"_load_npy",
"(",
"sequence",
")",... | Load data from an "external" data file an pass it to
the given |IOSequence|. | [
"Load",
"data",
"from",
"an",
"external",
"data",
"file",
"an",
"pass",
"it",
"to",
"the",
"given",
"|IOSequence|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L1415-L1430 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | SequenceManager.save_file | def save_file(self, sequence, array=None):
"""Write the date stored in |IOSequence.series| of the given
|IOSequence| into an "external" data file. """
if array is None:
array = sequence.aggregate_series()
try:
if sequence.filetype_ext == 'nc':
self... | python | def save_file(self, sequence, array=None):
"""Write the date stored in |IOSequence.series| of the given
|IOSequence| into an "external" data file. """
if array is None:
array = sequence.aggregate_series()
try:
if sequence.filetype_ext == 'nc':
self... | [
"def",
"save_file",
"(",
"self",
",",
"sequence",
",",
"array",
"=",
"None",
")",
":",
"if",
"array",
"is",
"None",
":",
"array",
"=",
"sequence",
".",
"aggregate_series",
"(",
")",
"try",
":",
"if",
"sequence",
".",
"filetype_ext",
"==",
"'nc'",
":",
... | Write the date stored in |IOSequence.series| of the given
|IOSequence| into an "external" data file. | [
"Write",
"the",
"date",
"stored",
"in",
"|IOSequence",
".",
"series|",
"of",
"the",
"given",
"|IOSequence|",
"into",
"an",
"external",
"data",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L1450-L1476 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | SequenceManager.open_netcdf_reader | def open_netcdf_reader(self, flatten=False, isolate=False, timeaxis=1):
"""Prepare a new |NetCDFInterface| object for reading data."""
self._netcdf_reader = netcdftools.NetCDFInterface(
flatten=bool(flatten),
isolate=bool(isolate),
timeaxis=int(timeaxis)) | python | def open_netcdf_reader(self, flatten=False, isolate=False, timeaxis=1):
"""Prepare a new |NetCDFInterface| object for reading data."""
self._netcdf_reader = netcdftools.NetCDFInterface(
flatten=bool(flatten),
isolate=bool(isolate),
timeaxis=int(timeaxis)) | [
"def",
"open_netcdf_reader",
"(",
"self",
",",
"flatten",
"=",
"False",
",",
"isolate",
"=",
"False",
",",
"timeaxis",
"=",
"1",
")",
":",
"self",
".",
"_netcdf_reader",
"=",
"netcdftools",
".",
"NetCDFInterface",
"(",
"flatten",
"=",
"bool",
"(",
"flatten... | Prepare a new |NetCDFInterface| object for reading data. | [
"Prepare",
"a",
"new",
"|NetCDFInterface|",
"object",
"for",
"reading",
"data",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L1528-L1533 | train |
hydpy-dev/hydpy | hydpy/core/filetools.py | SequenceManager.open_netcdf_writer | def open_netcdf_writer(self, flatten=False, isolate=False, timeaxis=1):
"""Prepare a new |NetCDFInterface| object for writing data."""
self._netcdf_writer = netcdftools.NetCDFInterface(
flatten=bool(flatten),
isolate=bool(isolate),
timeaxis=int(timeaxis)) | python | def open_netcdf_writer(self, flatten=False, isolate=False, timeaxis=1):
"""Prepare a new |NetCDFInterface| object for writing data."""
self._netcdf_writer = netcdftools.NetCDFInterface(
flatten=bool(flatten),
isolate=bool(isolate),
timeaxis=int(timeaxis)) | [
"def",
"open_netcdf_writer",
"(",
"self",
",",
"flatten",
"=",
"False",
",",
"isolate",
"=",
"False",
",",
"timeaxis",
"=",
"1",
")",
":",
"self",
".",
"_netcdf_writer",
"=",
"netcdftools",
".",
"NetCDFInterface",
"(",
"flatten",
"=",
"bool",
"(",
"flatten... | Prepare a new |NetCDFInterface| object for writing data. | [
"Prepare",
"a",
"new",
"|NetCDFInterface|",
"object",
"for",
"writing",
"data",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/filetools.py#L1572-L1577 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_nkor_v1 | def calc_nkor_v1(self):
"""Adjust the given precipitation values.
Required control parameters:
|NHRU|
|KG|
Required input sequence:
|Nied|
Calculated flux sequence:
|NKor|
Basic equation:
:math:`NKor = KG \\cdot Nied`
Example:
>>> from hydpy.models.lla... | python | def calc_nkor_v1(self):
"""Adjust the given precipitation values.
Required control parameters:
|NHRU|
|KG|
Required input sequence:
|Nied|
Calculated flux sequence:
|NKor|
Basic equation:
:math:`NKor = KG \\cdot Nied`
Example:
>>> from hydpy.models.lla... | [
"def",
"calc_nkor_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"f... | Adjust the given precipitation values.
Required control parameters:
|NHRU|
|KG|
Required input sequence:
|Nied|
Calculated flux sequence:
|NKor|
Basic equation:
:math:`NKor = KG \\cdot Nied`
Example:
>>> from hydpy.models.lland import *
>>> paramet... | [
"Adjust",
"the",
"given",
"precipitation",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L13-L44 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_tkor_v1 | def calc_tkor_v1(self):
"""Adjust the given air temperature values.
Required control parameters:
|NHRU|
|KT|
Required input sequence:
|TemL|
Calculated flux sequence:
|TKor|
Basic equation:
:math:`TKor = KT + TemL`
Example:
>>> from hydpy.models.lland ... | python | def calc_tkor_v1(self):
"""Adjust the given air temperature values.
Required control parameters:
|NHRU|
|KT|
Required input sequence:
|TemL|
Calculated flux sequence:
|TKor|
Basic equation:
:math:`TKor = KT + TemL`
Example:
>>> from hydpy.models.lland ... | [
"def",
"calc_tkor_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"f... | Adjust the given air temperature values.
Required control parameters:
|NHRU|
|KT|
Required input sequence:
|TemL|
Calculated flux sequence:
|TKor|
Basic equation:
:math:`TKor = KT + TemL`
Example:
>>> from hydpy.models.lland import *
>>> parameters... | [
"Adjust",
"the",
"given",
"air",
"temperature",
"values",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L47-L78 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_et0_v1 | def calc_et0_v1(self):
"""Calculate reference evapotranspiration after Turc-Wendling.
Required control parameters:
|NHRU|
|KE|
|KF|
|HNN|
Required input sequence:
|Glob|
Required flux sequence:
|TKor|
Calculated flux sequence:
|ET0|
Basic equation:
... | python | def calc_et0_v1(self):
"""Calculate reference evapotranspiration after Turc-Wendling.
Required control parameters:
|NHRU|
|KE|
|KF|
|HNN|
Required input sequence:
|Glob|
Required flux sequence:
|TKor|
Calculated flux sequence:
|ET0|
Basic equation:
... | [
"def",
"calc_et0_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fa... | Calculate reference evapotranspiration after Turc-Wendling.
Required control parameters:
|NHRU|
|KE|
|KF|
|HNN|
Required input sequence:
|Glob|
Required flux sequence:
|TKor|
Calculated flux sequence:
|ET0|
Basic equation:
:math:`ET0 = KE \\cdot
... | [
"Calculate",
"reference",
"evapotranspiration",
"after",
"Turc",
"-",
"Wendling",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L81-L126 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_et0_wet0_v1 | def calc_et0_wet0_v1(self):
"""Correct the given reference evapotranspiration and update the
corresponding log sequence.
Required control parameters:
|NHRU|
|KE|
|WfET0|
Required input sequence:
|PET|
Calculated flux sequence:
|ET0|
Updated log sequence:
|... | python | def calc_et0_wet0_v1(self):
"""Correct the given reference evapotranspiration and update the
corresponding log sequence.
Required control parameters:
|NHRU|
|KE|
|WfET0|
Required input sequence:
|PET|
Calculated flux sequence:
|ET0|
Updated log sequence:
|... | [
"def",
"calc_et0_wet0_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"inp",
"=",
"self",
".",
"sequences",
".",
"inputs",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Correct the given reference evapotranspiration and update the
corresponding log sequence.
Required control parameters:
|NHRU|
|KE|
|WfET0|
Required input sequence:
|PET|
Calculated flux sequence:
|ET0|
Updated log sequence:
|WET0|
Basic equations:
:... | [
"Correct",
"the",
"given",
"reference",
"evapotranspiration",
"and",
"update",
"the",
"corresponding",
"log",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L129-L192 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_evpo_v1 | def calc_evpo_v1(self):
"""Calculate land use and month specific values of potential
evapotranspiration.
Required control parameters:
|NHRU|
|Lnk|
|FLn|
Required derived parameter:
|MOY|
Required flux sequence:
|ET0|
Calculated flux sequence:
|EvPo|
A... | python | def calc_evpo_v1(self):
"""Calculate land use and month specific values of potential
evapotranspiration.
Required control parameters:
|NHRU|
|Lnk|
|FLn|
Required derived parameter:
|MOY|
Required flux sequence:
|ET0|
Calculated flux sequence:
|EvPo|
A... | [
"def",
"calc_evpo_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate land use and month specific values of potential
evapotranspiration.
Required control parameters:
|NHRU|
|Lnk|
|FLn|
Required derived parameter:
|MOY|
Required flux sequence:
|ET0|
Calculated flux sequence:
|EvPo|
Additional requirements:
|... | [
"Calculate",
"land",
"use",
"and",
"month",
"specific",
"values",
"of",
"potential",
"evapotranspiration",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L195-L276 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_nbes_inzp_v1 | def calc_nbes_inzp_v1(self):
"""Calculate stand precipitation and update the interception storage
accordingly.
Required control parameters:
|NHRU|
|Lnk|
Required derived parameter:
|KInz|
Required flux sequence:
|NKor|
Calculated flux sequence:
|NBes|
Updat... | python | def calc_nbes_inzp_v1(self):
"""Calculate stand precipitation and update the interception storage
accordingly.
Required control parameters:
|NHRU|
|Lnk|
Required derived parameter:
|KInz|
Required flux sequence:
|NKor|
Calculated flux sequence:
|NBes|
Updat... | [
"def",
"calc_nbes_inzp_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".... | Calculate stand precipitation and update the interception storage
accordingly.
Required control parameters:
|NHRU|
|Lnk|
Required derived parameter:
|KInz|
Required flux sequence:
|NKor|
Calculated flux sequence:
|NBes|
Updated state sequence:
|Inzp|
... | [
"Calculate",
"stand",
"precipitation",
"and",
"update",
"the",
"interception",
"storage",
"accordingly",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L279-L394 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_evi_inzp_v1 | def calc_evi_inzp_v1(self):
"""Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NHRU|
|Lnk|
|TRefT|
|TRefN|
Required flux sequence:
|EvPo|
Calculated flux sequence:
|EvI|
Updated state sequen... | python | def calc_evi_inzp_v1(self):
"""Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NHRU|
|Lnk|
|TRefT|
|TRefN|
Required flux sequence:
|EvPo|
Calculated flux sequence:
|EvI|
Updated state sequen... | [
"def",
"calc_evi_inzp_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
... | Calculate interception evaporation and update the interception
storage accordingly.
Required control parameters:
|NHRU|
|Lnk|
|TRefT|
|TRefN|
Required flux sequence:
|EvPo|
Calculated flux sequence:
|EvI|
Updated state sequence:
|Inzp|
Basic equatio... | [
"Calculate",
"interception",
"evaporation",
"and",
"update",
"the",
"interception",
"storage",
"accordingly",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L397-L459 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_sbes_v1 | def calc_sbes_v1(self):
"""Calculate the frozen part of stand precipitation.
Required control parameters:
|NHRU|
|TGr|
|TSp|
Required flux sequences:
|TKor|
|NBes|
Calculated flux sequence:
|SBes|
Examples:
In the first example, the threshold temperat... | python | def calc_sbes_v1(self):
"""Calculate the frozen part of stand precipitation.
Required control parameters:
|NHRU|
|TGr|
|TSp|
Required flux sequences:
|TKor|
|NBes|
Calculated flux sequence:
|SBes|
Examples:
In the first example, the threshold temperat... | [
"def",
"calc_sbes_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"k",
"in",
"range",
"(",
"con",
".",
"nhru",
")",
"... | Calculate the frozen part of stand precipitation.
Required control parameters:
|NHRU|
|TGr|
|TSp|
Required flux sequences:
|TKor|
|NBes|
Calculated flux sequence:
|SBes|
Examples:
In the first example, the threshold temperature of seven hydrological
... | [
"Calculate",
"the",
"frozen",
"part",
"of",
"stand",
"precipitation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L462-L519 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_wgtf_v1 | def calc_wgtf_v1(self):
"""Calculate the potential snowmelt.
Required control parameters:
|NHRU|
|Lnk|
|GTF|
|TRefT|
|TRefN|
|RSchmelz|
|CPWasser|
Required flux sequence:
|TKor|
Calculated fluxes sequence:
|WGTF|
Basic equation:
:math:`... | python | def calc_wgtf_v1(self):
"""Calculate the potential snowmelt.
Required control parameters:
|NHRU|
|Lnk|
|GTF|
|TRefT|
|TRefN|
|RSchmelz|
|CPWasser|
Required flux sequence:
|TKor|
Calculated fluxes sequence:
|WGTF|
Basic equation:
:math:`... | [
"def",
"calc_wgtf_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"for",
"k",
"in",
"range",
"(",
"con",
".",
"nhru",
")",
"... | Calculate the potential snowmelt.
Required control parameters:
|NHRU|
|Lnk|
|GTF|
|TRefT|
|TRefN|
|RSchmelz|
|CPWasser|
Required flux sequence:
|TKor|
Calculated fluxes sequence:
|WGTF|
Basic equation:
:math:`WGTF = max(GTF \\cdot (TKor - T... | [
"Calculate",
"the",
"potential",
"snowmelt",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L522-L601 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_schm_wats_v1 | def calc_schm_wats_v1(self):
"""Calculate the actual amount of water melting within the snow cover.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequences:
|SBes|
|WGTF|
Calculated flux sequence:
|Schm|
Updated state sequence:
|WATS|
Basic equa... | python | def calc_schm_wats_v1(self):
"""Calculate the actual amount of water melting within the snow cover.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequences:
|SBes|
|WGTF|
Calculated flux sequence:
|Schm|
Updated state sequence:
|WATS|
Basic equa... | [
"def",
"calc_schm_wats_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Calculate the actual amount of water melting within the snow cover.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequences:
|SBes|
|WGTF|
Calculated flux sequence:
|Schm|
Updated state sequence:
|WATS|
Basic equations:
:math:`\\frac{dWATS}{dt... | [
"Calculate",
"the",
"actual",
"amount",
"of",
"water",
"melting",
"within",
"the",
"snow",
"cover",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L604-L666 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_wada_waes_v1 | def calc_wada_waes_v1(self):
"""Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|PWMax|
Required flux sequences:
|NBes|
Calculated flux sequence:
|WaDa|
Updated state sequence:
|WAeS|
Basic equations:
... | python | def calc_wada_waes_v1(self):
"""Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|PWMax|
Required flux sequences:
|NBes|
Calculated flux sequence:
|WaDa|
Updated state sequence:
|WAeS|
Basic equations:
... | [
"def",
"calc_wada_waes_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|PWMax|
Required flux sequences:
|NBes|
Calculated flux sequence:
|WaDa|
Updated state sequence:
|WAeS|
Basic equations:
:math:`\\frac{dWAeS}{dt} = NBes - ... | [
"Calculate",
"the",
"actual",
"water",
"release",
"from",
"the",
"snow",
"cover",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L669-L729 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_evb_v1 | def calc_evb_v1(self):
"""Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|GrasRef_R|
Required state sequence:
|BoWa|
Required flux sequences:
|EvPo|
|EvI|
Calculated flux sequence:
|EvB|
... | python | def calc_evb_v1(self):
"""Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|GrasRef_R|
Required state sequence:
|BoWa|
Required flux sequences:
|EvPo|
|EvI|
Calculated flux sequence:
|EvB|
... | [
"def",
"calc_evb_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fa... | Calculate the actual water release from the snow cover.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|GrasRef_R|
Required state sequence:
|BoWa|
Required flux sequences:
|EvPo|
|EvI|
Calculated flux sequence:
|EvB|
Basic equations:
:math:... | [
"Calculate",
"the",
"actual",
"water",
"release",
"from",
"the",
"snow",
"cover",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L732-L793 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qbb_v1 | def calc_qbb_v1(self):
"""Calculate the amount of base flow released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|Beta|
|FBeta|
Required derived parameter:
|WB|
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QBB|
... | python | def calc_qbb_v1(self):
"""Calculate the amount of base flow released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|Beta|
|FBeta|
Required derived parameter:
|WB|
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QBB|
... | [
"def",
"calc_qbb_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"... | Calculate the amount of base flow released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|Beta|
|FBeta|
Required derived parameter:
|WB|
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QBB|
Basic equations:
:math:`... | [
"Calculate",
"the",
"amount",
"of",
"base",
"flow",
"released",
"from",
"the",
"soil",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L796-L896 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qib1_v1 | def calc_qib1_v1(self):
"""Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
Required derived parameter:
|WB|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB1|
Basic eq... | python | def calc_qib1_v1(self):
"""Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
Required derived parameter:
|WB|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB1|
Basic eq... | [
"def",
"calc_qib1_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
Required derived parameter:
|WB|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB1|
Basic equation:
:math:`QIB1 = DMi... | [
"Calculate",
"the",
"first",
"inflow",
"component",
"released",
"from",
"the",
"soil",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L899-L969 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qib2_v1 | def calc_qib2_v1(self):
"""Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
|DMax|
Required derived parameter:
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB2|
... | python | def calc_qib2_v1(self):
"""Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
|DMax|
Required derived parameter:
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB2|
... | [
"def",
"calc_qib2_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
... | Calculate the first inflow component released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|DMin|
|DMax|
Required derived parameter:
|WZ|
Required state sequence:
|BoWa|
Calculated flux sequence:
|QIB2|
Basic equation:
:mat... | [
"Calculate",
"the",
"first",
"inflow",
"component",
"released",
"from",
"the",
"soil",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L972-L1049 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qdb_v1 | def calc_qdb_v1(self):
"""Calculate direct runoff released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|BSf|
Required state sequence:
|BoWa|
Required flux sequence:
|WaDa|
Calculated flux sequence:
|QDB|
Basic equations:
:ma... | python | def calc_qdb_v1(self):
"""Calculate direct runoff released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|BSf|
Required state sequence:
|BoWa|
Required flux sequence:
|WaDa|
Calculated flux sequence:
|QDB|
Basic equations:
:ma... | [
"def",
"calc_qdb_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fa... | Calculate direct runoff released from the soil.
Required control parameters:
|NHRU|
|Lnk|
|NFk|
|BSf|
Required state sequence:
|BoWa|
Required flux sequence:
|WaDa|
Calculated flux sequence:
|QDB|
Basic equations:
:math:`QDB = \\Bigl \\lbrace
... | [
"Calculate",
"direct",
"runoff",
"released",
"from",
"the",
"soil",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1052-L1131 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_bowa_v1 | def calc_bowa_v1(self):
"""Update soil moisture and correct fluxes if necessary.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequence:
|WaDa|
Updated state sequence:
|BoWa|
Required (and eventually corrected) flux sequences:
|EvB|
|QBB|
|QIB1... | python | def calc_bowa_v1(self):
"""Update soil moisture and correct fluxes if necessary.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequence:
|WaDa|
Updated state sequence:
|BoWa|
Required (and eventually corrected) flux sequences:
|EvB|
|QBB|
|QIB1... | [
"def",
"calc_bowa_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"f... | Update soil moisture and correct fluxes if necessary.
Required control parameters:
|NHRU|
|Lnk|
Required flux sequence:
|WaDa|
Updated state sequence:
|BoWa|
Required (and eventually corrected) flux sequences:
|EvB|
|QBB|
|QIB1|
|QIB2|
|QDB|
... | [
"Update",
"soil",
"moisture",
"and",
"correct",
"fluxes",
"if",
"necessary",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1134-L1216 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qbgz_v1 | def calc_qbgz_v1(self):
"""Aggregate the amount of base flow released by all "soil type" HRUs
and the "net precipitation" above water areas of type |SEE|.
Water areas of type |SEE| are assumed to be directly connected with
groundwater, but not with the stream network. This is modelled by
adding th... | python | def calc_qbgz_v1(self):
"""Aggregate the amount of base flow released by all "soil type" HRUs
and the "net precipitation" above water areas of type |SEE|.
Water areas of type |SEE| are assumed to be directly connected with
groundwater, but not with the stream network. This is modelled by
adding th... | [
"def",
"calc_qbgz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"f... | Aggregate the amount of base flow released by all "soil type" HRUs
and the "net precipitation" above water areas of type |SEE|.
Water areas of type |SEE| are assumed to be directly connected with
groundwater, but not with the stream network. This is modelled by
adding their (positive or negative) "net... | [
"Aggregate",
"the",
"amount",
"of",
"base",
"flow",
"released",
"by",
"all",
"soil",
"type",
"HRUs",
"and",
"the",
"net",
"precipitation",
"above",
"water",
"areas",
"of",
"type",
"|SEE|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1219-L1281 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qigz1_v1 | def calc_qigz1_v1(self):
"""Aggregate the amount of the first interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB1|
Calculated state sequence:
|QIGZ1|
Basic equation:
:math:`QIGZ1 = \\Sigma(FHRU \\cd... | python | def calc_qigz1_v1(self):
"""Aggregate the amount of the first interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB1|
Calculated state sequence:
|QIGZ1|
Basic equation:
:math:`QIGZ1 = \\Sigma(FHRU \\cd... | [
"def",
"calc_qigz1_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Aggregate the amount of the first interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB1|
Calculated state sequence:
|QIGZ1|
Basic equation:
:math:`QIGZ1 = \\Sigma(FHRU \\cdot QIB1)`
Example:
... | [
"Aggregate",
"the",
"amount",
"of",
"the",
"first",
"interflow",
"component",
"released",
"by",
"all",
"HRUs",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1284-L1317 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qigz2_v1 | def calc_qigz2_v1(self):
"""Aggregate the amount of the second interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB2|
Calculated state sequence:
|QIGZ2|
Basic equation:
:math:`QIGZ2 = \\Sigma(FHRU \\c... | python | def calc_qigz2_v1(self):
"""Aggregate the amount of the second interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB2|
Calculated state sequence:
|QIGZ2|
Basic equation:
:math:`QIGZ2 = \\Sigma(FHRU \\c... | [
"def",
"calc_qigz2_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"... | Aggregate the amount of the second interflow component released
by all HRUs.
Required control parameters:
|NHRU|
|FHRU|
Required flux sequence:
|QIB2|
Calculated state sequence:
|QIGZ2|
Basic equation:
:math:`QIGZ2 = \\Sigma(FHRU \\cdot QIB2)`
Example:
... | [
"Aggregate",
"the",
"amount",
"of",
"the",
"second",
"interflow",
"component",
"released",
"by",
"all",
"HRUs",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1320-L1353 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qdgz_v1 | def calc_qdgz_v1(self):
"""Aggregate the amount of total direct flow released by all HRUs.
Required control parameters:
|Lnk|
|NHRU|
|FHRU|
Required flux sequence:
|QDB|
|NKor|
|EvI|
Calculated flux sequence:
|QDGZ|
Basic equation:
:math:`QDGZ = \... | python | def calc_qdgz_v1(self):
"""Aggregate the amount of total direct flow released by all HRUs.
Required control parameters:
|Lnk|
|NHRU|
|FHRU|
Required flux sequence:
|QDB|
|NKor|
|EvI|
Calculated flux sequence:
|QDGZ|
Basic equation:
:math:`QDGZ = \... | [
"def",
"calc_qdgz_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"qdgz",
"=",
"0.",
"for",
"k",
"in",
"range",
... | Aggregate the amount of total direct flow released by all HRUs.
Required control parameters:
|Lnk|
|NHRU|
|FHRU|
Required flux sequence:
|QDB|
|NKor|
|EvI|
Calculated flux sequence:
|QDGZ|
Basic equation:
:math:`QDGZ = \\Sigma(FHRU \\cdot QDB) +
... | [
"Aggregate",
"the",
"amount",
"of",
"total",
"direct",
"flow",
"released",
"by",
"all",
"HRUs",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1356-L1411 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qdgz1_qdgz2_v1 | def calc_qdgz1_qdgz2_v1(self):
"""Seperate total direct flow into a small and a fast component.
Required control parameters:
|A1|
|A2|
Required flux sequence:
|QDGZ|
Calculated state sequences:
|QDGZ1|
|QDGZ2|
Basic equation:
:math:`QDGZ2 = \\frac{(QDGZ-A2)^2... | python | def calc_qdgz1_qdgz2_v1(self):
"""Seperate total direct flow into a small and a fast component.
Required control parameters:
|A1|
|A2|
Required flux sequence:
|QDGZ|
Calculated state sequences:
|QDGZ1|
|QDGZ2|
Basic equation:
:math:`QDGZ2 = \\frac{(QDGZ-A2)^2... | [
"def",
"calc_qdgz1_qdgz2_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".... | Seperate total direct flow into a small and a fast component.
Required control parameters:
|A1|
|A2|
Required flux sequence:
|QDGZ|
Calculated state sequences:
|QDGZ1|
|QDGZ2|
Basic equation:
:math:`QDGZ2 = \\frac{(QDGZ-A2)^2}{QDGZ+A1-A2}`
:math:`QDGZ1 = Q... | [
"Seperate",
"total",
"direct",
"flow",
"into",
"a",
"small",
"and",
"a",
"fast",
"component",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1414-L1520 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qbga_v1 | def calc_qbga_v1(self):
"""Perform the runoff concentration calculation for base flow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KB|
Requi... | python | def calc_qbga_v1(self):
"""Perform the runoff concentration calculation for base flow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KB|
Requi... | [
"def",
"calc_qbga_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
... | Perform the runoff concentration calculation for base flow.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KB|
Required flux sequence:
|QBGZ|... | [
"Perform",
"the",
"runoff",
"concentration",
"calculation",
"for",
"base",
"flow",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1523-L1583 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qiga1_v1 | def calc_qiga1_v1(self):
"""Perform the runoff concentration calculation for the first
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived paramet... | python | def calc_qiga1_v1(self):
"""Perform the runoff concentration calculation for the first
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived paramet... | [
"def",
"calc_qiga1_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Perform the runoff concentration calculation for the first
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KI1|
Required st... | [
"Perform",
"the",
"runoff",
"concentration",
"calculation",
"for",
"the",
"first",
"interflow",
"component",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1586-L1647 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qiga2_v1 | def calc_qiga2_v1(self):
"""Perform the runoff concentration calculation for the second
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parame... | python | def calc_qiga2_v1(self):
"""Perform the runoff concentration calculation for the second
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parame... | [
"def",
"calc_qiga2_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Perform the runoff concentration calculation for the second
interflow component.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KI2|
Required s... | [
"Perform",
"the",
"runoff",
"concentration",
"calculation",
"for",
"the",
"second",
"interflow",
"component",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1650-L1711 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qdga1_v1 | def calc_qdga1_v1(self):
"""Perform the runoff concentration calculation for "slow" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD... | python | def calc_qdga1_v1(self):
"""Perform the runoff concentration calculation for "slow" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD... | [
"def",
"calc_qdga1_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Perform the runoff concentration calculation for "slow" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD1|
Required state sequence:... | [
"Perform",
"the",
"runoff",
"concentration",
"calculation",
"for",
"slow",
"direct",
"runoff",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1714-L1774 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_qdga2_v1 | def calc_qdga2_v1(self):
"""Perform the runoff concentration calculation for "fast" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD... | python | def calc_qdga2_v1(self):
"""Perform the runoff concentration calculation for "fast" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD... | [
"def",
"calc_qdga2_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_old",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",... | Perform the runoff concentration calculation for "fast" direct runoff.
The working equation is the analytical solution of the linear storage
equation under the assumption of constant change in inflow during
the simulation time step.
Required derived parameter:
|KD2|
Required state sequence:... | [
"Perform",
"the",
"runoff",
"concentration",
"calculation",
"for",
"fast",
"direct",
"runoff",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1777-L1837 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_model.py | calc_q_v1 | def calc_q_v1(self):
"""Calculate the final runoff.
Note that, in case there are water areas, their |NKor| values are
added and their |EvPo| values are subtracted from the "potential"
runoff value, if possible. This hold true for |WASSER| only and is
due to compatibility with the original LARSIM i... | python | def calc_q_v1(self):
"""Calculate the final runoff.
Note that, in case there are water areas, their |NKor| values are
added and their |EvPo| values are subtracted from the "potential"
runoff value, if possible. This hold true for |WASSER| only and is
due to compatibility with the original LARSIM i... | [
"def",
"calc_q_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sta",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fast... | Calculate the final runoff.
Note that, in case there are water areas, their |NKor| values are
added and their |EvPo| values are subtracted from the "potential"
runoff value, if possible. This hold true for |WASSER| only and is
due to compatibility with the original LARSIM implementation. Using land
... | [
"Calculate",
"the",
"final",
"runoff",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_model.py#L1840-L2002 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.