repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.update | def update(self):
"""Delete the coefficients of the pure MA model and also all MA and
AR coefficients of the ARMA model. Also calculate or delete the values
of all secondary iuh parameters, depending on the completeness of the
values of the primary parameters.
"""
del se... | python | def update(self):
"""Delete the coefficients of the pure MA model and also all MA and
AR coefficients of the ARMA model. Also calculate or delete the values
of all secondary iuh parameters, depending on the completeness of the
values of the primary parameters.
"""
del se... | [
"def",
"update",
"(",
"self",
")",
":",
"del",
"self",
".",
"ma",
".",
"coefs",
"del",
"self",
".",
"arma",
".",
"ma_coefs",
"del",
"self",
".",
"arma",
".",
"ar_coefs",
"if",
"self",
".",
"primary_parameters_complete",
":",
"self",
".",
"calc_secondary_... | Delete the coefficients of the pure MA model and also all MA and
AR coefficients of the ARMA model. Also calculate or delete the values
of all secondary iuh parameters, depending on the completeness of the
values of the primary parameters. | [
"Delete",
"the",
"coefficients",
"of",
"the",
"pure",
"MA",
"model",
"and",
"also",
"all",
"MA",
"and",
"AR",
"coefficients",
"of",
"the",
"ARMA",
"model",
".",
"Also",
"calculate",
"or",
"delete",
"the",
"values",
"of",
"all",
"secondary",
"iuh",
"paramet... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L179-L192 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.delay_response_series | def delay_response_series(self):
"""A tuple of two numpy arrays, which hold the time delays and the
associated iuh values respectively."""
delays = []
responses = []
sum_responses = 0.
for t in itertools.count(self.dt_response/2., self.dt_response):
delays.app... | python | def delay_response_series(self):
"""A tuple of two numpy arrays, which hold the time delays and the
associated iuh values respectively."""
delays = []
responses = []
sum_responses = 0.
for t in itertools.count(self.dt_response/2., self.dt_response):
delays.app... | [
"def",
"delay_response_series",
"(",
"self",
")",
":",
"delays",
"=",
"[",
"]",
"responses",
"=",
"[",
"]",
"sum_responses",
"=",
"0.",
"for",
"t",
"in",
"itertools",
".",
"count",
"(",
"self",
".",
"dt_response",
"/",
"2.",
",",
"self",
".",
"dt_respo... | A tuple of two numpy arrays, which hold the time delays and the
associated iuh values respectively. | [
"A",
"tuple",
"of",
"two",
"numpy",
"arrays",
"which",
"hold",
"the",
"time",
"delays",
"and",
"the",
"associated",
"iuh",
"values",
"respectively",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L195-L208 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.plot | def plot(self, threshold=None, **kwargs):
"""Plot the instanteneous unit hydrograph.
The optional argument allows for defining a threshold of the cumulative
sum uf the hydrograph, used to adjust the largest value of the x-axis.
It must be a value between zero and one.
"""
... | python | def plot(self, threshold=None, **kwargs):
"""Plot the instanteneous unit hydrograph.
The optional argument allows for defining a threshold of the cumulative
sum uf the hydrograph, used to adjust the largest value of the x-axis.
It must be a value between zero and one.
"""
... | [
"def",
"plot",
"(",
"self",
",",
"threshold",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"delays",
",",
"responses",
"=",
"self",
".",
"delay_response_series",
"pyplot",
".",
"plot",
"(",
"delays",
",",
"responses",
",",
"*",
"*",
"kwargs",
")",
... | Plot the instanteneous unit hydrograph.
The optional argument allows for defining a threshold of the cumulative
sum uf the hydrograph, used to adjust the largest value of the x-axis.
It must be a value between zero and one. | [
"Plot",
"the",
"instanteneous",
"unit",
"hydrograph",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L210-L225 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.moment1 | def moment1(self):
"""The first time delay weighted statistical moment of the
instantaneous unit hydrograph."""
delays, response = self.delay_response_series
return statstools.calc_mean_time(delays, response) | python | def moment1(self):
"""The first time delay weighted statistical moment of the
instantaneous unit hydrograph."""
delays, response = self.delay_response_series
return statstools.calc_mean_time(delays, response) | [
"def",
"moment1",
"(",
"self",
")",
":",
"delays",
",",
"response",
"=",
"self",
".",
"delay_response_series",
"return",
"statstools",
".",
"calc_mean_time",
"(",
"delays",
",",
"response",
")"
] | The first time delay weighted statistical moment of the
instantaneous unit hydrograph. | [
"The",
"first",
"time",
"delay",
"weighted",
"statistical",
"moment",
"of",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L228-L232 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | IUH.moment2 | def moment2(self):
"""The second time delay weighted statistical momens of the
instantaneous unit hydrograph."""
moment1 = self.moment1
delays, response = self.delay_response_series
return statstools.calc_mean_time_deviation(
delays, response, moment1) | python | def moment2(self):
"""The second time delay weighted statistical momens of the
instantaneous unit hydrograph."""
moment1 = self.moment1
delays, response = self.delay_response_series
return statstools.calc_mean_time_deviation(
delays, response, moment1) | [
"def",
"moment2",
"(",
"self",
")",
":",
"moment1",
"=",
"self",
".",
"moment1",
"delays",
",",
"response",
"=",
"self",
".",
"delay_response_series",
"return",
"statstools",
".",
"calc_mean_time_deviation",
"(",
"delays",
",",
"response",
",",
"moment1",
")"
... | The second time delay weighted statistical momens of the
instantaneous unit hydrograph. | [
"The",
"second",
"time",
"delay",
"weighted",
"statistical",
"momens",
"of",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L235-L241 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | TranslationDiffusionEquation.calc_secondary_parameters | def calc_secondary_parameters(self):
"""Determine the values of the secondary parameters `a` and `b`."""
self.a = self.x/(2.*self.d**.5)
self.b = self.u/(2.*self.d**.5) | python | def calc_secondary_parameters(self):
"""Determine the values of the secondary parameters `a` and `b`."""
self.a = self.x/(2.*self.d**.5)
self.b = self.u/(2.*self.d**.5) | [
"def",
"calc_secondary_parameters",
"(",
"self",
")",
":",
"self",
".",
"a",
"=",
"self",
".",
"x",
"/",
"(",
"2.",
"*",
"self",
".",
"d",
"**",
".5",
")",
"self",
".",
"b",
"=",
"self",
".",
"u",
"/",
"(",
"2.",
"*",
"self",
".",
"d",
"**",
... | Determine the values of the secondary parameters `a` and `b`. | [
"Determine",
"the",
"values",
"of",
"the",
"secondary",
"parameters",
"a",
"and",
"b",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L402-L405 | train |
hydpy-dev/hydpy | hydpy/auxs/iuhtools.py | LinearStorageCascade.calc_secondary_parameters | def calc_secondary_parameters(self):
"""Determine the value of the secondary parameter `c`."""
self.c = 1./(self.k*special.gamma(self.n)) | python | def calc_secondary_parameters(self):
"""Determine the value of the secondary parameter `c`."""
self.c = 1./(self.k*special.gamma(self.n)) | [
"def",
"calc_secondary_parameters",
"(",
"self",
")",
":",
"self",
".",
"c",
"=",
"1.",
"/",
"(",
"self",
".",
"k",
"*",
"special",
".",
"gamma",
"(",
"self",
".",
"n",
")",
")"
] | Determine the value of the secondary parameter `c`. | [
"Determine",
"the",
"value",
"of",
"the",
"secondary",
"parameter",
"c",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L449-L451 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_states.py | WATS.trim | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`,
or at least in accordance with if :math:`WATS \\geq 0`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.0)
>>> sta... | python | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`,
or at least in accordance with if :math:`WATS \\geq 0`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.0)
>>> sta... | [
"def",
"trim",
"(",
"self",
",",
"lower",
"=",
"None",
",",
"upper",
"=",
"None",
")",
":",
"pwmax",
"=",
"self",
".",
"subseqs",
".",
"seqs",
".",
"model",
".",
"parameters",
".",
"control",
".",
"pwmax",
"waes",
"=",
"self",
".",
"subseqs",
".",
... | Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`,
or at least in accordance with if :math:`WATS \\geq 0`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.0)
>>> states.waes = -1., 0., 1., -1., 5., 10., 20.
>... | [
"Trim",
"values",
"in",
"accordance",
"with",
":",
"math",
":",
"WAeS",
"\\\\",
"leq",
"PWMax",
"\\\\",
"cdot",
"WATS",
"or",
"at",
"least",
"in",
"accordance",
"with",
"if",
":",
"math",
":",
"WATS",
"\\\\",
"geq",
"0",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L37-L55 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_states.py | WAeS.trim | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.)
>>> states.wats = 0., 0., 0., 5., 5., 5., 5.
>>> states.waes(-1.... | python | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.)
>>> states.wats = 0., 0., 0., 5., 5., 5., 5.
>>> states.waes(-1.... | [
"def",
"trim",
"(",
"self",
",",
"lower",
"=",
"None",
",",
"upper",
"=",
"None",
")",
":",
"pwmax",
"=",
"self",
".",
"subseqs",
".",
"seqs",
".",
"model",
".",
"parameters",
".",
"control",
".",
"pwmax",
"wats",
"=",
"self",
".",
"subseqs",
".",
... | Trim values in accordance with :math:`WAeS \\leq PWMax \\cdot WATS`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(7)
>>> pwmax(2.)
>>> states.wats = 0., 0., 0., 5., 5., 5., 5.
>>> states.waes(-1., 0., 1., -1., 5., 10., 20.)
>>> states.wae... | [
"Trim",
"values",
"in",
"accordance",
"with",
":",
"math",
":",
"WAeS",
"\\\\",
"leq",
"PWMax",
"\\\\",
"cdot",
"WATS",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L64-L80 | train |
hydpy-dev/hydpy | hydpy/models/lland/lland_states.py | BoWa.trim | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`BoWa \\leq NFk`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(5)
>>> nfk(200.)
>>> states.bowa(-100.,0., 100., 200., 300.)
>>> states.bowa
bowa(0.0, ... | python | def trim(self, lower=None, upper=None):
"""Trim values in accordance with :math:`BoWa \\leq NFk`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(5)
>>> nfk(200.)
>>> states.bowa(-100.,0., 100., 200., 300.)
>>> states.bowa
bowa(0.0, ... | [
"def",
"trim",
"(",
"self",
",",
"lower",
"=",
"None",
",",
"upper",
"=",
"None",
")",
":",
"if",
"upper",
"is",
"None",
":",
"upper",
"=",
"self",
".",
"subseqs",
".",
"seqs",
".",
"model",
".",
"parameters",
".",
"control",
".",
"nfk",
"lland_seq... | Trim values in accordance with :math:`BoWa \\leq NFk`.
>>> from hydpy.models.lland import *
>>> parameterstep('1d')
>>> nhru(5)
>>> nfk(200.)
>>> states.bowa(-100.,0., 100., 200., 300.)
>>> states.bowa
bowa(0.0, 0.0, 100.0, 200.0, 200.0) | [
"Trim",
"values",
"in",
"accordance",
"with",
":",
"math",
":",
"BoWa",
"\\\\",
"leq",
"NFk",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L88-L101 | train |
arteria/django-openinghours | openinghours/views_edit.py | OpeningHoursEditView.post | def post(self, request, pk):
""" Clean the data and save opening hours in the database.
Old opening hours are purged before new ones are saved.
"""
location = self.get_object()
# open days, disabled widget data won't make it into request.POST
present_prefixes = [x.split('... | python | def post(self, request, pk):
""" Clean the data and save opening hours in the database.
Old opening hours are purged before new ones are saved.
"""
location = self.get_object()
# open days, disabled widget data won't make it into request.POST
present_prefixes = [x.split('... | [
"def",
"post",
"(",
"self",
",",
"request",
",",
"pk",
")",
":",
"location",
"=",
"self",
".",
"get_object",
"(",
")",
"# open days, disabled widget data won't make it into request.POST",
"present_prefixes",
"=",
"[",
"x",
".",
"split",
"(",
"'-'",
")",
"[",
"... | Clean the data and save opening hours in the database.
Old opening hours are purged before new ones are saved. | [
"Clean",
"the",
"data",
"and",
"save",
"opening",
"hours",
"in",
"the",
"database",
".",
"Old",
"opening",
"hours",
"are",
"purged",
"before",
"new",
"ones",
"are",
"saved",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/views_edit.py#L28-L53 | train |
arteria/django-openinghours | openinghours/views_edit.py | OpeningHoursEditView.get | def get(self, request, pk):
""" Initialize the editing form
1. Build opening_hours, a lookup dictionary to populate the form
slots: keys are day numbers, values are lists of opening
hours for that day.
2. Build days, a list of days with 2 slot forms each.
3. Build ... | python | def get(self, request, pk):
""" Initialize the editing form
1. Build opening_hours, a lookup dictionary to populate the form
slots: keys are day numbers, values are lists of opening
hours for that day.
2. Build days, a list of days with 2 slot forms each.
3. Build ... | [
"def",
"get",
"(",
"self",
",",
"request",
",",
"pk",
")",
":",
"location",
"=",
"self",
".",
"get_object",
"(",
")",
"two_sets",
"=",
"False",
"closed",
"=",
"None",
"opening_hours",
"=",
"{",
"}",
"for",
"o",
"in",
"OpeningHours",
".",
"objects",
"... | Initialize the editing form
1. Build opening_hours, a lookup dictionary to populate the form
slots: keys are day numbers, values are lists of opening
hours for that day.
2. Build days, a list of days with 2 slot forms each.
3. Build form initials for the 2 slots padding/tr... | [
"Initialize",
"the",
"editing",
"form"
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/views_edit.py#L55-L98 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_model.py | calc_qjoints_v1 | def calc_qjoints_v1(self):
"""Apply the routing equation.
Required derived parameters:
|NmbSegments|
|C1|
|C2|
|C3|
Updated state sequence:
|QJoints|
Basic equation:
:math:`Q_{space+1,time+1} =
c1 \\cdot Q_{space,time+1} +
c2 \\cdot Q_{space,time} +
... | python | def calc_qjoints_v1(self):
"""Apply the routing equation.
Required derived parameters:
|NmbSegments|
|C1|
|C2|
|C3|
Updated state sequence:
|QJoints|
Basic equation:
:math:`Q_{space+1,time+1} =
c1 \\cdot Q_{space,time+1} +
c2 \\cdot Q_{space,time} +
... | [
"def",
"calc_qjoints_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
".... | Apply the routing equation.
Required derived parameters:
|NmbSegments|
|C1|
|C2|
|C3|
Updated state sequence:
|QJoints|
Basic equation:
:math:`Q_{space+1,time+1} =
c1 \\cdot Q_{space,time+1} +
c2 \\cdot Q_{space,time} +
c3 \\cdot Q_{space+1,time}`
... | [
"Apply",
"the",
"routing",
"equation",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L10-L104 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_model.py | pick_q_v1 | def pick_q_v1(self):
"""Assign the actual value of the inlet sequence to the upper joint
of the subreach upstream."""
inl = self.sequences.inlets.fastaccess
new = self.sequences.states.fastaccess_new
new.qjoints[0] = 0.
for idx in range(inl.len_q):
new.qjoints[0] += inl.q[idx][0] | python | def pick_q_v1(self):
"""Assign the actual value of the inlet sequence to the upper joint
of the subreach upstream."""
inl = self.sequences.inlets.fastaccess
new = self.sequences.states.fastaccess_new
new.qjoints[0] = 0.
for idx in range(inl.len_q):
new.qjoints[0] += inl.q[idx][0] | [
"def",
"pick_q_v1",
"(",
"self",
")",
":",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"new",
".",
"qjoints",
"[",
"0",
"]",
"=",
"0.",
"for",
"id... | Assign the actual value of the inlet sequence to the upper joint
of the subreach upstream. | [
"Assign",
"the",
"actual",
"value",
"of",
"the",
"inlet",
"sequence",
"to",
"the",
"upper",
"joint",
"of",
"the",
"subreach",
"upstream",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L107-L114 | train |
hydpy-dev/hydpy | hydpy/models/hstream/hstream_model.py | pass_q_v1 | def pass_q_v1(self):
"""Assing the actual value of the lower joint of of the subreach
downstream to the outlet sequence."""
der = self.parameters.derived.fastaccess
new = self.sequences.states.fastaccess_new
out = self.sequences.outlets.fastaccess
out.q[0] += new.qjoints[der.nmbsegments] | python | def pass_q_v1(self):
"""Assing the actual value of the lower joint of of the subreach
downstream to the outlet sequence."""
der = self.parameters.derived.fastaccess
new = self.sequences.states.fastaccess_new
out = self.sequences.outlets.fastaccess
out.q[0] += new.qjoints[der.nmbsegments] | [
"def",
"pass_q_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
... | Assing the actual value of the lower joint of of the subreach
downstream to the outlet sequence. | [
"Assing",
"the",
"actual",
"value",
"of",
"the",
"lower",
"joint",
"of",
"of",
"the",
"subreach",
"downstream",
"to",
"the",
"outlet",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L117-L123 | train |
TabViewer/gtabview | gtabview/dataio.py | _detect_encoding | def _detect_encoding(data=None):
"""Return the default system encoding. If data is passed, try
to decode the data with the default system encoding or from a short
list of encoding types to test.
Args:
data - list of lists
Returns:
enc - system encoding
"""
import locale
... | python | def _detect_encoding(data=None):
"""Return the default system encoding. If data is passed, try
to decode the data with the default system encoding or from a short
list of encoding types to test.
Args:
data - list of lists
Returns:
enc - system encoding
"""
import locale
... | [
"def",
"_detect_encoding",
"(",
"data",
"=",
"None",
")",
":",
"import",
"locale",
"enc_list",
"=",
"[",
"'utf-8'",
",",
"'latin-1'",
",",
"'iso8859-1'",
",",
"'iso8859-2'",
",",
"'utf-16'",
",",
"'cp720'",
"]",
"code",
"=",
"locale",
".",
"getpreferredencod... | Return the default system encoding. If data is passed, try
to decode the data with the default system encoding or from a short
list of encoding types to test.
Args:
data - list of lists
Returns:
enc - system encoding | [
"Return",
"the",
"default",
"system",
"encoding",
".",
"If",
"data",
"is",
"passed",
"try",
"to",
"decode",
"the",
"data",
"with",
"the",
"default",
"system",
"encoding",
"or",
"from",
"a",
"short",
"list",
"of",
"encoding",
"types",
"to",
"test",
"."
] | 14ba391f0b225a1bf32d52b640a47b580f8b1b28 | https://github.com/TabViewer/gtabview/blob/14ba391f0b225a1bf32d52b640a47b580f8b1b28/gtabview/dataio.py#L12-L37 | train |
hydpy-dev/hydpy | hydpy/core/importtools.py | parameterstep | def parameterstep(timestep=None):
"""Define a parameter time step size within a parameter control file.
Argument:
* timestep(|Period|): Time step size.
Function parameterstep should usually be be applied in a line
immediately behind the model import. Defining the step size of time
dependent... | python | def parameterstep(timestep=None):
"""Define a parameter time step size within a parameter control file.
Argument:
* timestep(|Period|): Time step size.
Function parameterstep should usually be be applied in a line
immediately behind the model import. Defining the step size of time
dependent... | [
"def",
"parameterstep",
"(",
"timestep",
"=",
"None",
")",
":",
"if",
"timestep",
"is",
"not",
"None",
":",
"parametertools",
".",
"Parameter",
".",
"parameterstep",
"(",
"timestep",
")",
"namespace",
"=",
"inspect",
".",
"currentframe",
"(",
")",
".",
"f_... | Define a parameter time step size within a parameter control file.
Argument:
* timestep(|Period|): Time step size.
Function parameterstep should usually be be applied in a line
immediately behind the model import. Defining the step size of time
dependent parameters is a prerequisite to access a... | [
"Define",
"a",
"parameter",
"time",
"step",
"size",
"within",
"a",
"parameter",
"control",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L25-L92 | train |
hydpy-dev/hydpy | hydpy/core/importtools.py | reverse_model_wildcard_import | def reverse_model_wildcard_import():
"""Clear the local namespace from a model wildcard import.
Calling this method should remove the critical imports into the local
namespace due the last wildcard import of a certain application model.
It is thought for securing the successive preperation of different... | python | def reverse_model_wildcard_import():
"""Clear the local namespace from a model wildcard import.
Calling this method should remove the critical imports into the local
namespace due the last wildcard import of a certain application model.
It is thought for securing the successive preperation of different... | [
"def",
"reverse_model_wildcard_import",
"(",
")",
":",
"namespace",
"=",
"inspect",
".",
"currentframe",
"(",
")",
".",
"f_back",
".",
"f_locals",
"model",
"=",
"namespace",
".",
"get",
"(",
"'model'",
")",
"if",
"model",
"is",
"not",
"None",
":",
"for",
... | Clear the local namespace from a model wildcard import.
Calling this method should remove the critical imports into the local
namespace due the last wildcard import of a certain application model.
It is thought for securing the successive preperation of different
types of models via wildcard imports. ... | [
"Clear",
"the",
"local",
"namespace",
"from",
"a",
"model",
"wildcard",
"import",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L95-L162 | train |
hydpy-dev/hydpy | hydpy/core/importtools.py | prepare_model | def prepare_model(module: Union[types.ModuleType, str],
timestep: PeriodABC.ConstrArg = None):
"""Prepare and return the model of the given module.
In usual HydPy projects, each hydrological model instance is prepared
in an individual control file. This allows for "polluting" the
nam... | python | def prepare_model(module: Union[types.ModuleType, str],
timestep: PeriodABC.ConstrArg = None):
"""Prepare and return the model of the given module.
In usual HydPy projects, each hydrological model instance is prepared
in an individual control file. This allows for "polluting" the
nam... | [
"def",
"prepare_model",
"(",
"module",
":",
"Union",
"[",
"types",
".",
"ModuleType",
",",
"str",
"]",
",",
"timestep",
":",
"PeriodABC",
".",
"ConstrArg",
"=",
"None",
")",
":",
"if",
"timestep",
"is",
"not",
"None",
":",
"parametertools",
".",
"Paramet... | Prepare and return the model of the given module.
In usual HydPy projects, each hydrological model instance is prepared
in an individual control file. This allows for "polluting" the
namespace with different model attributes. There is no danger of
name conflicts, as long as no other (wildcard) import... | [
"Prepare",
"and",
"return",
"the",
"model",
"of",
"the",
"given",
"module",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L165-L221 | train |
hydpy-dev/hydpy | hydpy/core/importtools.py | simulationstep | def simulationstep(timestep):
""" Define a simulation time step size for testing purposes within a
parameter control file.
Using |simulationstep| only affects the values of time dependent
parameters, when `pub.timegrids.stepsize` is not defined. It thus has
no influence on usual hydpy simulations ... | python | def simulationstep(timestep):
""" Define a simulation time step size for testing purposes within a
parameter control file.
Using |simulationstep| only affects the values of time dependent
parameters, when `pub.timegrids.stepsize` is not defined. It thus has
no influence on usual hydpy simulations ... | [
"def",
"simulationstep",
"(",
"timestep",
")",
":",
"if",
"hydpy",
".",
"pub",
".",
"options",
".",
"warnsimulationstep",
":",
"warnings",
".",
"warn",
"(",
"'Note that the applied function `simulationstep` is intended for '",
"'testing purposes only. When doing a HydPy simu... | Define a simulation time step size for testing purposes within a
parameter control file.
Using |simulationstep| only affects the values of time dependent
parameters, when `pub.timegrids.stepsize` is not defined. It thus has
no influence on usual hydpy simulations at all. Use it just to check
your... | [
"Define",
"a",
"simulation",
"time",
"step",
"size",
"for",
"testing",
"purposes",
"within",
"a",
"parameter",
"control",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L224-L258 | train |
hydpy-dev/hydpy | hydpy/core/importtools.py | controlcheck | def controlcheck(controldir='default', projectdir=None, controlfile=None):
"""Define the corresponding control file within a condition file.
Function |controlcheck| serves similar purposes as function
|parameterstep|. It is the reason why one can interactively
access the state and/or the log sequences... | python | def controlcheck(controldir='default', projectdir=None, controlfile=None):
"""Define the corresponding control file within a condition file.
Function |controlcheck| serves similar purposes as function
|parameterstep|. It is the reason why one can interactively
access the state and/or the log sequences... | [
"def",
"controlcheck",
"(",
"controldir",
"=",
"'default'",
",",
"projectdir",
"=",
"None",
",",
"controlfile",
"=",
"None",
")",
":",
"namespace",
"=",
"inspect",
".",
"currentframe",
"(",
")",
".",
"f_back",
".",
"f_locals",
"model",
"=",
"namespace",
".... | Define the corresponding control file within a condition file.
Function |controlcheck| serves similar purposes as function
|parameterstep|. It is the reason why one can interactively
access the state and/or the log sequences within condition files
as `land_dill.py` of the example project `LahnH`. It ... | [
"Define",
"the",
"corresponding",
"control",
"file",
"within",
"a",
"condition",
"file",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L261-L357 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_derived.py | RelSoilArea.update | def update(self):
"""Update |RelSoilArea| based on |Area|, |ZoneArea|, and |ZoneType|.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(4)
>>> zonetype(FIELD, FOREST, GLACIER, ILAKE)
>>> area(100.0)
>>> zonearea(10.0, 20.0, 30.0, 40.0)
... | python | def update(self):
"""Update |RelSoilArea| based on |Area|, |ZoneArea|, and |ZoneType|.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(4)
>>> zonetype(FIELD, FOREST, GLACIER, ILAKE)
>>> area(100.0)
>>> zonearea(10.0, 20.0, 30.0, 40.0)
... | [
"def",
"update",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
"temp",
"=",
"con",
".",
"zonearea",
".",
"values",
".",
"copy",
"(",
")",
"temp",
"[",
"con",
".",
"zonetype",
".",
"values",
"==",
"GLACIER",... | Update |RelSoilArea| based on |Area|, |ZoneArea|, and |ZoneType|.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(4)
>>> zonetype(FIELD, FOREST, GLACIER, ILAKE)
>>> area(100.0)
>>> zonearea(10.0, 20.0, 30.0, 40.0)
>>> derived.relsoilarea... | [
"Update",
"|RelSoilArea|",
"based",
"on",
"|Area|",
"|ZoneArea|",
"and",
"|ZoneType|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L19-L36 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_derived.py | TTM.update | def update(self):
"""Update |TTM| based on :math:`TTM = TT+DTTM`.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(1)
>>> zonetype(FIELD)
>>> tt(1.0)
>>> dttm(-2.0)
>>> derived.ttm.update()
>>> derived.ttm
ttm(-1.0... | python | def update(self):
"""Update |TTM| based on :math:`TTM = TT+DTTM`.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(1)
>>> zonetype(FIELD)
>>> tt(1.0)
>>> dttm(-2.0)
>>> derived.ttm.update()
>>> derived.ttm
ttm(-1.0... | [
"def",
"update",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
"self",
"(",
"con",
".",
"tt",
"+",
"con",
".",
"dttm",
")"
] | Update |TTM| based on :math:`TTM = TT+DTTM`.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> nmbzones(1)
>>> zonetype(FIELD)
>>> tt(1.0)
>>> dttm(-2.0)
>>> derived.ttm.update()
>>> derived.ttm
ttm(-1.0) | [
"Update",
"|TTM|",
"based",
"on",
":",
"math",
":",
"TTM",
"=",
"TT",
"+",
"DTTM",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L117-L131 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_derived.py | UH.update | def update(self):
"""Update |UH| based on |MaxBaz|.
.. note::
This method also updates the shape of log sequence |QUH|.
|MaxBaz| determines the end point of the triangle. A value of
|MaxBaz| being not larger than the simulation step size is
identical with applying... | python | def update(self):
"""Update |UH| based on |MaxBaz|.
.. note::
This method also updates the shape of log sequence |QUH|.
|MaxBaz| determines the end point of the triangle. A value of
|MaxBaz| being not larger than the simulation step size is
identical with applying... | [
"def",
"update",
"(",
"self",
")",
":",
"maxbaz",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"maxbaz",
".",
"value",
"quh",
"=",
"self",
".",
"subpars",
".",
"pars",
".",
"model",
".",
"sequences",
".",
"logs",
".",
"quh",
"# De... | Update |UH| based on |MaxBaz|.
.. note::
This method also updates the shape of log sequence |QUH|.
|MaxBaz| determines the end point of the triangle. A value of
|MaxBaz| being not larger than the simulation step size is
identical with applying no unit hydrograph at all:
... | [
"Update",
"|UH|",
"based",
"on",
"|MaxBaz|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L168-L277 | train |
hydpy-dev/hydpy | hydpy/models/hland/hland_derived.py | QFactor.update | def update(self):
"""Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfac... | python | def update(self):
"""Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfac... | [
"def",
"update",
"(",
"self",
")",
":",
"self",
"(",
"self",
".",
"subpars",
".",
"pars",
".",
"control",
".",
"area",
"*",
"1000.",
"/",
"self",
".",
"subpars",
".",
"qfactor",
".",
"simulationstep",
".",
"seconds",
")"
] | Update |QFactor| based on |Area| and the current simulation
step size.
>>> from hydpy.models.hland import *
>>> parameterstep('1d')
>>> simulationstep('12h')
>>> area(50.0)
>>> derived.qfactor.update()
>>> derived.qfactor
qfactor(1.157407) | [
"Update",
"|QFactor|",
"based",
"on",
"|Area|",
"and",
"the",
"current",
"simulation",
"step",
"size",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L284-L297 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.nmb_neurons | def nmb_neurons(self) -> Tuple[int, ...]:
"""Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_n... | python | def nmb_neurons(self) -> Tuple[int, ...]:
"""Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_n... | [
"def",
"nmb_neurons",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"numpy",
".",
"asarray",
"(",
"self",
".",
"_cann",
".",
"nmb_neurons",
")",
")"
] | Number of neurons of the hidden layers.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(2, 1), nmb_outputs=3)
>>> ann.nmb_neurons
(2, 1)
>>> ann.nmb_neurons = (3,)
>>> ann.nmb_neurons
(3,)
>>> del ann.nmb_neurons
... | [
"Number",
"of",
"neurons",
"of",
"the",
"hidden",
"layers",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L366-L384 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.shape_weights_hidden | def shape_weights_hidden(self) -> Tuple[int, int, int]:
"""Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feedin... | python | def shape_weights_hidden(self) -> Tuple[int, int, int]:
"""Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feedin... | [
"def",
"shape_weights_hidden",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
",",
"int",
"]",
":",
"if",
"self",
".",
"nmb_layers",
">",
"1",
":",
"nmb_neurons",
"=",
"self",
".",
"nmb_neurons",
"return",
"(",
"self",
".",
"nmb_layers",
"-",... | Shape of the array containing the activation of the hidden neurons.
The first integer value is the number of connection between the
hidden layers, the second integer value is maximum number of
neurons of all hidden layers feeding information into another
hidden layer (all except the las... | [
"Shape",
"of",
"the",
"array",
"containing",
"the",
"activation",
"of",
"the",
"hidden",
"neurons",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L537-L562 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.nmb_weights_hidden | def nmb_weights_hidden(self) -> int:
"""Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18
"""
nmb = 0
for idx_layer in range(self.nmb_l... | python | def nmb_weights_hidden(self) -> int:
"""Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18
"""
nmb = 0
for idx_layer in range(self.nmb_l... | [
"def",
"nmb_weights_hidden",
"(",
"self",
")",
"->",
"int",
":",
"nmb",
"=",
"0",
"for",
"idx_layer",
"in",
"range",
"(",
"self",
".",
"nmb_layers",
"-",
"1",
")",
":",
"nmb",
"+=",
"self",
".",
"nmb_neurons",
"[",
"idx_layer",
"]",
"*",
"self",
".",... | Number of hidden weights.
>>> from hydpy import ANN
>>> ann = ANN(None)
>>> ann(nmb_inputs=2, nmb_neurons=(4, 3, 2), nmb_outputs=3)
>>> ann.nmb_weights_hidden
18 | [
"Number",
"of",
"hidden",
"weights",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L565-L577 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.verify | def verify(self) -> None:
"""Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter ... | python | def verify(self) -> None:
"""Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter ... | [
"def",
"verify",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"__protectedproperties",
".",
"allready",
"(",
"self",
")",
":",
"raise",
"RuntimeError",
"(",
"'The shape of the the artificial neural network '",
"'parameter %s has not been defined so far... | Raise a |RuntimeError| if the network's shape is not defined
completely.
>>> from hydpy import ANN
>>> ANN(None).verify()
Traceback (most recent call last):
...
RuntimeError: The shape of the the artificial neural network \
parameter `ann` of element `?` has not been def... | [
"Raise",
"a",
"|RuntimeError|",
"if",
"the",
"network",
"s",
"shape",
"is",
"not",
"defined",
"completely",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L788-L803 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.assignrepr | def assignrepr(self, prefix) -> str:
"""Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string."""
prefix = '%s%s(' % (prefix, self.name)
blanks = len(prefix)*' '
lines = [
objecttools.assignrepr_value(
... | python | def assignrepr(self, prefix) -> str:
"""Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string."""
prefix = '%s%s(' % (prefix, self.name)
blanks = len(prefix)*' '
lines = [
objecttools.assignrepr_value(
... | [
"def",
"assignrepr",
"(",
"self",
",",
"prefix",
")",
"->",
"str",
":",
"prefix",
"=",
"'%s%s('",
"%",
"(",
"prefix",
",",
"self",
".",
"name",
")",
"blanks",
"=",
"len",
"(",
"prefix",
")",
"*",
"' '",
"lines",
"=",
"[",
"objecttools",
".",
"assig... | Return a string representation of the actual |anntools.ANN| object
that is prefixed with the given string. | [
"Return",
"a",
"string",
"representation",
"of",
"the",
"actual",
"|anntools",
".",
"ANN|",
"object",
"that",
"is",
"prefixed",
"with",
"the",
"given",
"string",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L805-L828 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | ANN.plot | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bou... | python | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bou... | [
"def",
"plot",
"(",
"self",
",",
"xmin",
",",
"xmax",
",",
"idx_input",
"=",
"0",
",",
"idx_output",
"=",
"0",
",",
"points",
"=",
"100",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"xs_",
"=",
"numpy",
".",
"linspace",
"(",
"xmin",
",",
"... | Plot the relationship between a certain input (`idx_input`) and a
certain output (`idx_output`) variable described by the actual
|anntools.ANN| object.
Define the lower and the upper bound of the x axis via arguments
`xmin` and `xmax`. The number of plotting points can be modified
... | [
"Plot",
"the",
"relationship",
"between",
"a",
"certain",
"input",
"(",
"idx_input",
")",
"and",
"a",
"certain",
"output",
"(",
"idx_output",
")",
"variable",
"described",
"by",
"the",
"actual",
"|anntools",
".",
"ANN|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L833-L850 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN.refresh | def refresh(self) -> None:
"""Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| in... | python | def refresh(self) -> None:
"""Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| in... | [
"def",
"refresh",
"(",
"self",
")",
"->",
"None",
":",
"# pylint: disable=unsupported-assignment-operation",
"if",
"self",
".",
"_do_refresh",
":",
"if",
"self",
".",
"anns",
":",
"self",
".",
"__sann",
"=",
"annutils",
".",
"SeasonalANN",
"(",
"self",
".",
... | Prepare the actual |anntools.SeasonalANN| object for calculations.
Dispite all automated refreshings explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.SeasonalANN| instance,
as it stores its |annt... | [
"Prepare",
"the",
"actual",
"|anntools",
".",
"SeasonalANN|",
"object",
"for",
"calculations",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1323-L1370 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN.verify | def verify(self) -> None:
"""Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the in... | python | def verify(self) -> None:
"""Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the in... | [
"def",
"verify",
"(",
"self",
")",
"->",
"None",
":",
"if",
"not",
"self",
".",
"anns",
":",
"self",
".",
"_toy2ann",
".",
"clear",
"(",
")",
"raise",
"RuntimeError",
"(",
"'Seasonal artificial neural network collections need '",
"'to handle at least one \"normal\" ... | Raise a |RuntimeError| and removes all handled neural networks,
if the they are defined inconsistently.
Dispite all automated safety checks explained in the general
documentation on class |anntools.SeasonalANN|, it is still possible
to destroy the inner consistency of a |anntools.Season... | [
"Raise",
"a",
"|RuntimeError|",
"and",
"removes",
"all",
"handled",
"neural",
"networks",
"if",
"the",
"they",
"are",
"defined",
"inconsistently",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1372-L1448 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN.shape | def shape(self) -> Tuple[int, ...]:
"""The shape of array |anntools.SeasonalANN.ratios|."""
return tuple(int(sub) for sub in self.ratios.shape) | python | def shape(self) -> Tuple[int, ...]:
"""The shape of array |anntools.SeasonalANN.ratios|."""
return tuple(int(sub) for sub in self.ratios.shape) | [
"def",
"shape",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"int",
"(",
"sub",
")",
"for",
"sub",
"in",
"self",
".",
"ratios",
".",
"shape",
")"
] | The shape of array |anntools.SeasonalANN.ratios|. | [
"The",
"shape",
"of",
"array",
"|anntools",
".",
"SeasonalANN",
".",
"ratios|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1471-L1473 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN._set_shape | def _set_shape(self, shape):
"""Private on purpose."""
try:
shape = (int(shape),)
except TypeError:
pass
shp = list(shape)
shp[0] = timetools.Period('366d')/self.simulationstep
shp[0] = int(numpy.ceil(round(shp[0], 10)))
getattr(self.fastac... | python | def _set_shape(self, shape):
"""Private on purpose."""
try:
shape = (int(shape),)
except TypeError:
pass
shp = list(shape)
shp[0] = timetools.Period('366d')/self.simulationstep
shp[0] = int(numpy.ceil(round(shp[0], 10)))
getattr(self.fastac... | [
"def",
"_set_shape",
"(",
"self",
",",
"shape",
")",
":",
"try",
":",
"shape",
"=",
"(",
"int",
"(",
"shape",
")",
",",
")",
"except",
"TypeError",
":",
"pass",
"shp",
"=",
"list",
"(",
"shape",
")",
"shp",
"[",
"0",
"]",
"=",
"timetools",
".",
... | Private on purpose. | [
"Private",
"on",
"purpose",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1475-L1485 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN.toys | def toys(self) -> Tuple[timetools.TOY, ...]:
"""A sorted |tuple| of all contained |TOY| objects."""
return tuple(toy for (toy, _) in self) | python | def toys(self) -> Tuple[timetools.TOY, ...]:
"""A sorted |tuple| of all contained |TOY| objects."""
return tuple(toy for (toy, _) in self) | [
"def",
"toys",
"(",
"self",
")",
"->",
"Tuple",
"[",
"timetools",
".",
"TOY",
",",
"...",
"]",
":",
"return",
"tuple",
"(",
"toy",
"for",
"(",
"toy",
",",
"_",
")",
"in",
"self",
")"
] | A sorted |tuple| of all contained |TOY| objects. | [
"A",
"sorted",
"|tuple|",
"of",
"all",
"contained",
"|TOY|",
"objects",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1488-L1490 | train |
hydpy-dev/hydpy | hydpy/auxs/anntools.py | SeasonalANN.plot | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object.
"""
for toy, ann_ in self:
ann_.plot(xmin, xmax,
... | python | def plot(self, xmin, xmax, idx_input=0, idx_output=0, points=100,
**kwargs) -> None:
"""Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object.
"""
for toy, ann_ in self:
ann_.plot(xmin, xmax,
... | [
"def",
"plot",
"(",
"self",
",",
"xmin",
",",
"xmax",
",",
"idx_input",
"=",
"0",
",",
"idx_output",
"=",
"0",
",",
"points",
"=",
"100",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"for",
"toy",
",",
"ann_",
"in",
"self",
":",
"ann_",
"."... | Call method |anntools.ANN.plot| of all |anntools.ANN| objects
handled by the actual |anntools.SeasonalANN| object. | [
"Call",
"method",
"|anntools",
".",
"ANN",
".",
"plot|",
"of",
"all",
"|anntools",
".",
"ANN|",
"objects",
"handled",
"by",
"the",
"actual",
"|anntools",
".",
"SeasonalANN|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1539-L1550 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | ExchangeSpecification.specstring | def specstring(self):
"""The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>... | python | def specstring(self):
"""The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>... | [
"def",
"specstring",
"(",
"self",
")",
":",
"if",
"self",
".",
"subgroup",
"is",
"None",
":",
"variable",
"=",
"self",
".",
"variable",
"else",
":",
"variable",
"=",
"f'{self.subgroup}.{self.variable}'",
"if",
"self",
".",
"series",
":",
"variable",
"=",
"... | The string corresponding to the current values of `subgroup`,
`state`, and `variable`.
>>> from hydpy.core.itemtools import ExchangeSpecification
>>> spec = ExchangeSpecification('hland_v1', 'fluxes.qt')
>>> spec.specstring
'fluxes.qt'
>>> spec.series = True
>>> ... | [
"The",
"string",
"corresponding",
"to",
"the",
"current",
"values",
"of",
"subgroup",
"state",
"and",
"variable",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L60-L81 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | ExchangeItem.collect_variables | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
... | python | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
... | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"self",
".",
"insert_variables",
"(",
"self",
".",
"device2target",
",",
"self",
".",
"targetspecs",
",",
"selections",
")"
] | Apply method |ExchangeItem.insert_variables| to collect the
relevant target variables handled by the devices of the given
|Selections| object.
We prepare the `LahnH` example project to be able to use its
|Selections| object:
>>> from hydpy.core.examples import prepare_full_exam... | [
"Apply",
"method",
"|ExchangeItem",
".",
"insert_variables|",
"to",
"collect",
"the",
"relevant",
"target",
"variables",
"handled",
"by",
"the",
"devices",
"of",
"the",
"given",
"|Selections|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L117-L207 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | ExchangeItem.insert_variables | def insert_variables(
self, device2variable, exchangespec, selections) -> None:
"""Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
... | python | def insert_variables(
self, device2variable, exchangespec, selections) -> None:
"""Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
... | [
"def",
"insert_variables",
"(",
"self",
",",
"device2variable",
",",
"exchangespec",
",",
"selections",
")",
"->",
"None",
":",
"if",
"self",
".",
"targetspecs",
".",
"master",
"in",
"(",
"'node'",
",",
"'nodes'",
")",
":",
"for",
"node",
"in",
"selections... | Determine the relevant target or base variables (as defined by
the given |ExchangeSpecification| object ) handled by the given
|Selections| object and insert them into the given `device2variable`
dictionary. | [
"Determine",
"the",
"relevant",
"target",
"or",
"base",
"variables",
"(",
"as",
"defined",
"by",
"the",
"given",
"|ExchangeSpecification|",
"object",
")",
"handled",
"by",
"the",
"given",
"|Selections|",
"object",
"and",
"insert",
"them",
"into",
"the",
"given",... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L209-L222 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | ChangeItem.update_variable | def update_variable(self, variable, value) -> None:
"""Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pu... | python | def update_variable(self, variable, value) -> None:
"""Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pu... | [
"def",
"update_variable",
"(",
"self",
",",
"variable",
",",
"value",
")",
"->",
"None",
":",
"try",
":",
"variable",
"(",
"value",
")",
"except",
"BaseException",
":",
"objecttools",
".",
"augment_excmessage",
"(",
"f'When trying to update a target variable of '",
... | Assign the given value(s) to the given target or base variable.
If the assignment fails, |ChangeItem.update_variable| raises an
error like the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>>> item = SetItem... | [
"Assign",
"the",
"given",
"value",
"(",
"s",
")",
"to",
"the",
"given",
"target",
"or",
"base",
"variable",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L329-L353 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | SetItem.update_variables | def update_variables(self) -> None:
"""Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
... | python | def update_variables(self) -> None:
"""Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
... | [
"def",
"update_variables",
"(",
"self",
")",
"->",
"None",
":",
"value",
"=",
"self",
".",
"value",
"for",
"variable",
"in",
"self",
".",
"device2target",
".",
"values",
"(",
")",
":",
"self",
".",
"update_variable",
"(",
"variable",
",",
"value",
")"
] | Assign the current objects |ChangeItem.value| to the values
of the target variables.
We use the `LahnH` project in the following:
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
In the first example, a 0-dimensional |Se... | [
"Assign",
"the",
"current",
"objects",
"|ChangeItem",
".",
"value|",
"to",
"the",
"values",
"of",
"the",
"target",
"variables",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L369-L434 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | MathItem.collect_variables | def collect_variables(self, selections) -> None:
"""Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selecti... | python | def collect_variables(self, selections) -> None:
"""Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selecti... | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"collect_variables",
"(",
"selections",
")",
"self",
".",
"insert_variables",
"(",
"self",
".",
"device2base",
",",
"self",
".",
"basespecs",
",",
"... | Apply method |ChangeItem.collect_variables| of the base class
|ChangeItem| and also apply method |ExchangeItem.insert_variables|
of class |ExchangeItem| to collect the relevant base variables
handled by the devices of the given |Selections| object.
>>> from hydpy.core.examples import pr... | [
"Apply",
"method",
"|ChangeItem",
".",
"collect_variables|",
"of",
"the",
"base",
"class",
"|ChangeItem|",
"and",
"also",
"apply",
"method",
"|ExchangeItem",
".",
"insert_variables|",
"of",
"class",
"|ExchangeItem|",
"to",
"collect",
"the",
"relevant",
"base",
"vari... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L478-L504 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | AddItem.update_variables | def update_variables(self) -> None:
"""Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>... | python | def update_variables(self) -> None:
"""Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>... | [
"def",
"update_variables",
"(",
"self",
")",
"->",
"None",
":",
"value",
"=",
"self",
".",
"value",
"for",
"device",
",",
"target",
"in",
"self",
".",
"device2target",
".",
"items",
"(",
")",
":",
"base",
"=",
"self",
".",
"device2base",
"[",
"device",... | Add the general |ChangeItem.value| with the |Device| specific base
variable and assign the result to the respective target variable.
>>> from hydpy.core.examples import prepare_full_example_2
>>> hp, pub, TestIO = prepare_full_example_2()
>>> from hydpy.models.hland_v1 import FIELD
... | [
"Add",
"the",
"general",
"|ChangeItem",
".",
"value|",
"with",
"the",
"|Device|",
"specific",
"base",
"variable",
"and",
"assign",
"the",
"result",
"to",
"the",
"respective",
"target",
"variable",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L516-L560 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | GetItem.collect_variables | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
va... | python | def collect_variables(self, selections) -> None:
"""Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
va... | [
"def",
"collect_variables",
"(",
"self",
",",
"selections",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"collect_variables",
"(",
"selections",
")",
"for",
"device",
"in",
"sorted",
"(",
"self",
".",
"device2target",
".",
"keys",
"(",
")",
",",
"key"... | Apply method |ExchangeItem.collect_variables| of the base class
|ExchangeItem| and determine the `ndim` attribute of the current
|ChangeItem| object afterwards.
The value of `ndim` depends on whether the values of the target
variable or its time series is of interest:
>>> from ... | [
"Apply",
"method",
"|ExchangeItem",
".",
"collect_variables|",
"of",
"the",
"base",
"class",
"|ExchangeItem|",
"and",
"determine",
"the",
"ndim",
"attribute",
"of",
"the",
"current",
"|ChangeItem|",
"object",
"afterwards",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L574-L602 | train |
hydpy-dev/hydpy | hydpy/core/itemtools.py | GetItem.yield_name2value | def yield_name2value(self, idx1=None, idx2=None) \
-> Iterator[Tuple[str, str]]:
"""Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |V... | python | def yield_name2value(self, idx1=None, idx2=None) \
-> Iterator[Tuple[str, str]]:
"""Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |V... | [
"def",
"yield_name2value",
"(",
"self",
",",
"idx1",
"=",
"None",
",",
"idx2",
"=",
"None",
")",
"->",
"Iterator",
"[",
"Tuple",
"[",
"str",
",",
"str",
"]",
"]",
":",
"for",
"device",
",",
"name",
"in",
"self",
".",
"_device2name",
".",
"items",
"... | Sequentially return name-value-pairs describing the current state
of the target variables.
The names are automatically generated and contain both the name of
the |Device| of the respective |Variable| object and the target
description:
>>> from hydpy.core.examples import prepare... | [
"Sequentially",
"return",
"name",
"-",
"value",
"-",
"pairs",
"describing",
"the",
"current",
"state",
"of",
"the",
"target",
"variables",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L604-L662 | train |
arteria/django-openinghours | openinghours/templatetags/openinghours_tags.py | iso_day_to_weekday | def iso_day_to_weekday(d):
"""
Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday.
"""
if int(d) == utils.get_now().isoweekday():
return _("today")
for w in WEEKDAYS:
if w[0] == int(d):
return w[1] | python | def iso_day_to_weekday(d):
"""
Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday.
"""
if int(d) == utils.get_now().isoweekday():
return _("today")
for w in WEEKDAYS:
if w[0] == int(d):
return w[1] | [
"def",
"iso_day_to_weekday",
"(",
"d",
")",
":",
"if",
"int",
"(",
"d",
")",
"==",
"utils",
".",
"get_now",
"(",
")",
".",
"isoweekday",
"(",
")",
":",
"return",
"_",
"(",
"\"today\"",
")",
"for",
"w",
"in",
"WEEKDAYS",
":",
"if",
"w",
"[",
"0",
... | Returns the weekday's name given a ISO weekday number;
"today" if today is the same weekday. | [
"Returns",
"the",
"weekday",
"s",
"name",
"given",
"a",
"ISO",
"weekday",
"number",
";",
"today",
"if",
"today",
"is",
"the",
"same",
"weekday",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L14-L23 | train |
arteria/django-openinghours | openinghours/templatetags/openinghours_tags.py | is_open | def is_open(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
"""
obj = utils.is_open(location)
if obj is False:
return False
if attr is not None:
return getattr(obj, attr)
return obj | python | def is_open(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
"""
obj = utils.is_open(location)
if obj is False:
return False
if attr is not None:
return getattr(obj, attr)
return obj | [
"def",
"is_open",
"(",
"location",
"=",
"None",
",",
"attr",
"=",
"None",
")",
":",
"obj",
"=",
"utils",
".",
"is_open",
"(",
"location",
")",
"if",
"obj",
"is",
"False",
":",
"return",
"False",
"if",
"attr",
"is",
"not",
"None",
":",
"return",
"ge... | Returns False if the location is closed, or the OpeningHours object
to show the location is currently open. | [
"Returns",
"False",
"if",
"the",
"location",
"is",
"closed",
"or",
"the",
"OpeningHours",
"object",
"to",
"show",
"the",
"location",
"is",
"currently",
"open",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L39-L49 | train |
arteria/django-openinghours | openinghours/templatetags/openinghours_tags.py | is_open_now | def is_open_now(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`.
"""
obj = utils.is_open(location, now=datetime.datetime.now())
... | python | def is_open_now(location=None, attr=None):
"""
Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`.
"""
obj = utils.is_open(location, now=datetime.datetime.now())
... | [
"def",
"is_open_now",
"(",
"location",
"=",
"None",
",",
"attr",
"=",
"None",
")",
":",
"obj",
"=",
"utils",
".",
"is_open",
"(",
"location",
",",
"now",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
")",
"if",
"obj",
"is",
"False",
":",
... | Returns False if the location is closed, or the OpeningHours object
to show the location is currently open.
Same as `is_open` but passes `now` to `utils.is_open` to bypass `get_now()`. | [
"Returns",
"False",
"if",
"the",
"location",
"is",
"closed",
"or",
"the",
"OpeningHours",
"object",
"to",
"show",
"the",
"location",
"is",
"currently",
"open",
".",
"Same",
"as",
"is_open",
"but",
"passes",
"now",
"to",
"utils",
".",
"is_open",
"to",
"bypa... | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L53-L64 | train |
arteria/django-openinghours | openinghours/templatetags/openinghours_tags.py | opening_hours | def opening_hours(location=None, concise=False):
"""
Creates a rendered listing of hours.
"""
template_name = 'openinghours/opening_hours_list.html'
days = [] # [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...
# Without `location`, choose the first company.
if location:
... | python | def opening_hours(location=None, concise=False):
"""
Creates a rendered listing of hours.
"""
template_name = 'openinghours/opening_hours_list.html'
days = [] # [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...
# Without `location`, choose the first company.
if location:
... | [
"def",
"opening_hours",
"(",
"location",
"=",
"None",
",",
"concise",
"=",
"False",
")",
":",
"template_name",
"=",
"'openinghours/opening_hours_list.html'",
"days",
"=",
"[",
"]",
"# [{'hours': '9:00am to 5:00pm', 'name': u'Monday'}, {'hours...",
"# Without `location`, choos... | Creates a rendered listing of hours. | [
"Creates",
"a",
"rendered",
"listing",
"of",
"hours",
"."
] | 6bad47509a14d65a3a5a08777455f4cc8b4961fa | https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L98-L173 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.prepare_everything | def prepare_everything(self):
"""Convenience method to make the actual |HydPy| instance runable."""
self.prepare_network()
self.init_models()
self.load_conditions()
with hydpy.pub.options.warnmissingobsfile(False):
self.prepare_nodeseries()
self.prepare_models... | python | def prepare_everything(self):
"""Convenience method to make the actual |HydPy| instance runable."""
self.prepare_network()
self.init_models()
self.load_conditions()
with hydpy.pub.options.warnmissingobsfile(False):
self.prepare_nodeseries()
self.prepare_models... | [
"def",
"prepare_everything",
"(",
"self",
")",
":",
"self",
".",
"prepare_network",
"(",
")",
"self",
".",
"init_models",
"(",
")",
"self",
".",
"load_conditions",
"(",
")",
"with",
"hydpy",
".",
"pub",
".",
"options",
".",
"warnmissingobsfile",
"(",
"Fals... | Convenience method to make the actual |HydPy| instance runable. | [
"Convenience",
"method",
"to",
"make",
"the",
"actual",
"|HydPy|",
"instance",
"runable",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L70-L78 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.prepare_network | def prepare_network(self):
"""Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object."""
hydpy.pub.selections = selectiontools.Selections()
hydpy.pub.selections += hydpy.pub.networkmanager.load_files()
self.update... | python | def prepare_network(self):
"""Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object."""
hydpy.pub.selections = selectiontools.Selections()
hydpy.pub.selections += hydpy.pub.networkmanager.load_files()
self.update... | [
"def",
"prepare_network",
"(",
"self",
")",
":",
"hydpy",
".",
"pub",
".",
"selections",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"hydpy",
".",
"pub",
".",
"selections",
"+=",
"hydpy",
".",
"pub",
".",
"networkmanager",
".",
"load_files",
"(",
... | Load all network files as |Selections| (stored in module |pub|)
and assign the "complete" selection to the |HydPy| object. | [
"Load",
"all",
"network",
"files",
"as",
"|Selections|",
"(",
"stored",
"in",
"module",
"|pub|",
")",
"and",
"assign",
"the",
"complete",
"selection",
"to",
"the",
"|HydPy|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L81-L86 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.save_controls | def save_controls(self, parameterstep=None, simulationstep=None,
auxfiler=None):
"""Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set ... | python | def save_controls(self, parameterstep=None, simulationstep=None,
auxfiler=None):
"""Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set ... | [
"def",
"save_controls",
"(",
"self",
",",
"parameterstep",
"=",
"None",
",",
"simulationstep",
"=",
"None",
",",
"auxfiler",
"=",
"None",
")",
":",
"self",
".",
"elements",
".",
"save_controls",
"(",
"parameterstep",
"=",
"parameterstep",
",",
"simulationstep"... | Call method |Elements.save_controls| of the |Elements| object
currently handled by the |HydPy| object.
We use the `LahnH` example project to demonstrate how to write
a complete set parameter control files. For convenience, we let
function |prepare_full_example_2| prepare a fully functi... | [
"Call",
"method",
"|Elements",
".",
"save_controls|",
"of",
"the",
"|Elements|",
"object",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L93-L281 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.networkproperties | def networkproperties(self):
"""Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object."""
print('Number of nodes: %d' % len(self.nodes))
print('Number of elements: %d' % len(self.elements))
print('Number of en... | python | def networkproperties(self):
"""Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object."""
print('Number of nodes: %d' % len(self.nodes))
print('Number of elements: %d' % len(self.elements))
print('Number of en... | [
"def",
"networkproperties",
"(",
"self",
")",
":",
"print",
"(",
"'Number of nodes: %d'",
"%",
"len",
"(",
"self",
".",
"nodes",
")",
")",
"print",
"(",
"'Number of elements: %d'",
"%",
"len",
"(",
"self",
".",
"elements",
")",
")",
"print",
"(",
"'Number ... | Print out some properties of the network defined by the |Node| and
|Element| objects currently handled by the |HydPy| object. | [
"Print",
"out",
"some",
"properties",
"of",
"the",
"network",
"defined",
"by",
"the",
"|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L455-L462 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.numberofnetworks | def numberofnetworks(self):
"""The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object."""
sels1 = selectiontools.Selections()
sels2 = selectiontools.Selections()
complete = selectiontools.Selection('complete',
... | python | def numberofnetworks(self):
"""The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object."""
sels1 = selectiontools.Selections()
sels2 = selectiontools.Selections()
complete = selectiontools.Selection('complete',
... | [
"def",
"numberofnetworks",
"(",
"self",
")",
":",
"sels1",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"sels2",
"=",
"selectiontools",
".",
"Selections",
"(",
")",
"complete",
"=",
"selectiontools",
".",
"Selection",
"(",
"'complete'",
",",
"self",
"... | The number of distinct networks defined by the|Node| and
|Element| objects currently handled by the |HydPy| object. | [
"The",
"number",
"of",
"distinct",
"networks",
"defined",
"by",
"the|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L465-L483 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.endnodes | def endnodes(self):
"""|Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network."""
endnodes = devicetools.Nodes()
for node in self.nodes:
for element in node.exits:
if ((element in s... | python | def endnodes(self):
"""|Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network."""
endnodes = devicetools.Nodes()
for node in self.nodes:
for element in node.exits:
if ((element in s... | [
"def",
"endnodes",
"(",
"self",
")",
":",
"endnodes",
"=",
"devicetools",
".",
"Nodes",
"(",
")",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"for",
"element",
"in",
"node",
".",
"exits",
":",
"if",
"(",
"(",
"element",
"in",
"self",
".",
"elem... | |Nodes| object containing all |Node| objects currently handled by
the |HydPy| object which define a downstream end point of a network. | [
"|Nodes|",
"object",
"containing",
"all",
"|Node|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"which",
"define",
"a",
"downstream",
"end",
"point",
"of",
"a",
"network",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L517-L528 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.variables | def variables(self):
"""Sorted list of strings summarizing all variables handled by the
|Node| objects"""
variables = set([])
for node in self.nodes:
variables.add(node.variable)
return sorted(variables) | python | def variables(self):
"""Sorted list of strings summarizing all variables handled by the
|Node| objects"""
variables = set([])
for node in self.nodes:
variables.add(node.variable)
return sorted(variables) | [
"def",
"variables",
"(",
"self",
")",
":",
"variables",
"=",
"set",
"(",
"[",
"]",
")",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"variables",
".",
"add",
"(",
"node",
".",
"variable",
")",
"return",
"sorted",
"(",
"variables",
")"
] | Sorted list of strings summarizing all variables handled by the
|Node| objects | [
"Sorted",
"list",
"of",
"strings",
"summarizing",
"all",
"variables",
"handled",
"by",
"the",
"|Node|",
"objects"
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L531-L537 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.simindices | def simindices(self):
"""Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|."""
return (hydpy.pub.timegrids.init[hydpy.pub.timegrids.sim.firstdate],
hydpy.pub.timeg... | python | def simindices(self):
"""Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|."""
return (hydpy.pub.timegrids.init[hydpy.pub.timegrids.sim.firstdate],
hydpy.pub.timeg... | [
"def",
"simindices",
"(",
"self",
")",
":",
"return",
"(",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"[",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"sim",
".",
"firstdate",
"]",
",",
"hydpy",
".",
"pub",
".",
"timegrids",
".",
"init",
"... | Tuple containing the start and end index of the simulation period
regarding the initialization period defined by the |Timegrids| object
stored in module |pub|. | [
"Tuple",
"containing",
"the",
"start",
"and",
"end",
"index",
"of",
"the",
"simulation",
"period",
"regarding",
"the",
"initialization",
"period",
"defined",
"by",
"the",
"|Timegrids|",
"object",
"stored",
"in",
"module",
"|pub|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L540-L545 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.open_files | def open_files(self, idx=0):
"""Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object."""
self.elements.open_files(idx=idx)
self.nodes.open_files(idx=idx) | python | def open_files(self, idx=0):
"""Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object."""
self.elements.open_files(idx=idx)
self.nodes.open_files(idx=idx) | [
"def",
"open_files",
"(",
"self",
",",
"idx",
"=",
"0",
")",
":",
"self",
".",
"elements",
".",
"open_files",
"(",
"idx",
"=",
"idx",
")",
"self",
".",
"nodes",
".",
"open_files",
"(",
"idx",
"=",
"idx",
")"
] | Call method |Devices.open_files| of the |Nodes| and |Elements|
objects currently handled by the |HydPy| object. | [
"Call",
"method",
"|Devices",
".",
"open_files|",
"of",
"the",
"|Nodes|",
"and",
"|Elements|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"object",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L547-L551 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.update_devices | def update_devices(self, selection=None):
"""Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be... | python | def update_devices(self, selection=None):
"""Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be... | [
"def",
"update_devices",
"(",
"self",
",",
"selection",
"=",
"None",
")",
":",
"if",
"selection",
"is",
"not",
"None",
":",
"self",
".",
"nodes",
"=",
"selection",
".",
"nodes",
"self",
".",
"elements",
"=",
"selection",
".",
"elements",
"self",
".",
"... | Determines the order, in which the |Node| and |Element| objects
currently handled by the |HydPy| objects need to be processed during
a simulation time step. Optionally, a |Selection| object for defining
new |Node| and |Element| objects can be passed. | [
"Determines",
"the",
"order",
"in",
"which",
"the",
"|Node|",
"and",
"|Element|",
"objects",
"currently",
"handled",
"by",
"the",
"|HydPy|",
"objects",
"need",
"to",
"be",
"processed",
"during",
"a",
"simulation",
"time",
"step",
".",
"Optionally",
"a",
"|Sele... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L559-L567 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.methodorder | def methodorder(self):
"""A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called."""
funcs = []
for node in self.nodes:
if node.deploymode == 'oldsim':
... | python | def methodorder(self):
"""A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called."""
funcs = []
for node in self.nodes:
if node.deploymode == 'oldsim':
... | [
"def",
"methodorder",
"(",
"self",
")",
":",
"funcs",
"=",
"[",
"]",
"for",
"node",
"in",
"self",
".",
"nodes",
":",
"if",
"node",
".",
"deploymode",
"==",
"'oldsim'",
":",
"funcs",
".",
"append",
"(",
"node",
".",
"sequences",
".",
"fastaccess",
"."... | A list containing all methods of all |Node| and |Element| objects
that need to be processed during a simulation time step in the
order they must be called. | [
"A",
"list",
"containing",
"all",
"methods",
"of",
"all",
"|Node|",
"and",
"|Element|",
"objects",
"that",
"need",
"to",
"be",
"processed",
"during",
"a",
"simulation",
"time",
"step",
"in",
"the",
"order",
"they",
"must",
"be",
"called",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L570-L597 | train |
hydpy-dev/hydpy | hydpy/core/hydpytools.py | HydPy.doit | def doit(self):
"""Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|."""
idx_start, idx_end = self.simindices
self.open_files(idx_start)
methodorder = self.methodorder
for idx in printtools.progressbar... | python | def doit(self):
"""Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|."""
idx_start, idx_end = self.simindices
self.open_files(idx_start)
methodorder = self.methodorder
for idx in printtools.progressbar... | [
"def",
"doit",
"(",
"self",
")",
":",
"idx_start",
",",
"idx_end",
"=",
"self",
".",
"simindices",
"self",
".",
"open_files",
"(",
"idx_start",
")",
"methodorder",
"=",
"self",
".",
"methodorder",
"for",
"idx",
"in",
"printtools",
".",
"progressbar",
"(",
... | Perform a simulation run over the actual simulation time period
defined by the |Timegrids| object stored in module |pub|. | [
"Perform",
"a",
"simulation",
"run",
"over",
"the",
"actual",
"simulation",
"time",
"period",
"defined",
"by",
"the",
"|Timegrids|",
"object",
"stored",
"in",
"module",
"|pub|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L600-L609 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_inflow_v1 | def pic_inflow_v1(self):
"""Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q`
"""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.inflow = in... | python | def pic_inflow_v1(self):
"""Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q`
"""
flu = self.sequences.fluxes.fastaccess
inl = self.sequences.inlets.fastaccess
flu.inflow = in... | [
"def",
"pic_inflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"inflow",
"=",
"inl",
".",
"q",
"[",
"0",
"]"
] | Update the inlet link sequence.
Required inlet sequence:
|dam_inlets.Q|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q` | [
"Update",
"the",
"inlet",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L11-L25 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_inflow_v2 | def pic_inflow_v2(self):
"""Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R`
"""
flu = self.sequences.fluxes.fastaccess
inl = ... | python | def pic_inflow_v2(self):
"""Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R`
"""
flu = self.sequences.fluxes.fastaccess
inl = ... | [
"def",
"pic_inflow_v2",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"inl",
"=",
"self",
".",
"sequences",
".",
"inlets",
".",
"fastaccess",
"flu",
".",
"inflow",
"=",
"inl",
".",
"q",
"[",
"0",
"]",
... | Update the inlet link sequences.
Required inlet sequences:
|dam_inlets.Q|
|dam_inlets.S|
|dam_inlets.R|
Calculated flux sequence:
|Inflow|
Basic equation:
:math:`Inflow = Q + S + R` | [
"Update",
"the",
"inlet",
"link",
"sequences",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L28-L44 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_totalremotedischarge_v1 | def pic_totalremotedischarge_v1(self):
"""Update the receiver link sequence."""
flu = self.sequences.fluxes.fastaccess
rec = self.sequences.receivers.fastaccess
flu.totalremotedischarge = rec.q[0] | python | def pic_totalremotedischarge_v1(self):
"""Update the receiver link sequence."""
flu = self.sequences.fluxes.fastaccess
rec = self.sequences.receivers.fastaccess
flu.totalremotedischarge = rec.q[0] | [
"def",
"pic_totalremotedischarge_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"flu",
".",
"totalremotedischarge",
"=",
"rec",
".... | Update the receiver link sequence. | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L47-L51 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_loggedrequiredremoterelease_v1 | def pic_loggedrequiredremoterelease_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.d[0] | python | def pic_loggedrequiredremoterelease_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.d[0] | [
"def",
"pic_loggedrequiredremoterelease_v1",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedrequiredremoterelease",
"[",
... | Update the receiver link sequence. | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L54-L58 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_loggedrequiredremoterelease_v2 | def pic_loggedrequiredremoterelease_v2(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.s[0] | python | def pic_loggedrequiredremoterelease_v2(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedrequiredremoterelease[0] = rec.s[0] | [
"def",
"pic_loggedrequiredremoterelease_v2",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedrequiredremoterelease",
"[",
... | Update the receiver link sequence. | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L61-L65 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pic_loggedallowedremoterelieve_v1 | def pic_loggedallowedremoterelieve_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedallowedremoterelieve[0] = rec.r[0] | python | def pic_loggedallowedremoterelieve_v1(self):
"""Update the receiver link sequence."""
log = self.sequences.logs.fastaccess
rec = self.sequences.receivers.fastaccess
log.loggedallowedremoterelieve[0] = rec.r[0] | [
"def",
"pic_loggedallowedremoterelieve_v1",
"(",
"self",
")",
":",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"rec",
"=",
"self",
".",
"sequences",
".",
"receivers",
".",
"fastaccess",
"log",
".",
"loggedallowedremoterelieve",
"[",
"... | Update the receiver link sequence. | [
"Update",
"the",
"receiver",
"link",
"sequence",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L68-L72 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | update_loggedtotalremotedischarge_v1 | def update_loggedtotalremotedischarge_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
... | python | def update_loggedtotalremotedischarge_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
... | [
"def",
"update_loggedtotalremotedischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",... | Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|TotalRemoteDischarge|
Calculated flux sequence:
|LoggedTotalRemoteDischarge|
Example:
The following example shows that, with each new method... | [
"Log",
"a",
"new",
"entry",
"of",
"discharge",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L75-L118 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_waterlevel_v1 | def calc_waterlevel_v1(self):
"""Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
... | python | def calc_waterlevel_v1(self):
"""Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
... | [
"def",
"calc_waterlevel_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"new",
"=",
"self",
".",
"sequences",
".",
"states",
".",
"fastaccess_new",
"aid",
"=",
"self",
".",
"sequences",
".",
"aides",
... | Determine the water level based on an artificial neural network
describing the relationship between water level and water stage.
Required control parameter:
|WaterVolume2WaterLevel|
Required state sequence:
|WaterVolume|
Calculated aide sequence:
|WaterLevel|
Example:
... | [
"Determine",
"the",
"water",
"level",
"based",
"on",
"an",
"artificial",
"neural",
"network",
"describing",
"the",
"relationship",
"between",
"water",
"level",
"and",
"water",
"stage",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L121-L179 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_allowedremoterelieve_v2 | def calc_allowedremoterelieve_v2(self):
"""Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Requi... | python | def calc_allowedremoterelieve_v2(self):
"""Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Requi... | [
"def",
"calc_allowedremoterelieve_v2",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fl... | Calculate the allowed maximum relieve another location
is allowed to discharge into the dam.
Required control parameters:
|HighestRemoteRelieve|
|WaterLevelRelieveThreshold|
Required derived parameter:
|WaterLevelRelieveSmoothPar|
Required aide sequence:
|WaterLevel|
Calc... | [
"Calculate",
"the",
"allowed",
"maximum",
"relieve",
"another",
"location",
"is",
"allowed",
"to",
"discharge",
"into",
"the",
"dam",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L182-L293 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_requiredremotesupply_v1 | def calc_requiredremotesupply_v1(self):
"""Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Requ... | python | def calc_requiredremotesupply_v1(self):
"""Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Requ... | [
"def",
"calc_requiredremotesupply_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fl... | Calculate the required maximum supply from another location
that can be discharged into the dam.
Required control parameters:
|HighestRemoteSupply|
|WaterLevelSupplyThreshold|
Required derived parameter:
|WaterLevelSupplySmoothPar|
Required aide sequence:
|WaterLevel|
Cal... | [
"Calculate",
"the",
"required",
"maximum",
"supply",
"from",
"another",
"location",
"that",
"can",
"be",
"discharged",
"into",
"the",
"dam",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L296-L379 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_naturalremotedischarge_v1 | def calc_naturalremotedischarge_v1(self):
"""Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculate... | python | def calc_naturalremotedischarge_v1(self):
"""Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculate... | [
"def",
"calc_naturalremotedischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"lo... | Try to estimate the natural discharge of a cross section far downstream
based on the last few simulation steps.
Required control parameter:
|NmbLogEntries|
Required log sequences:
|LoggedTotalRemoteDischarge|
|LoggedOutflow|
Calculated flux sequence:
|NaturalRemoteDischarge|
... | [
"Try",
"to",
"estimate",
"the",
"natural",
"discharge",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"based",
"on",
"the",
"last",
"few",
"simulation",
"steps",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L382-L436 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_remotedemand_v1 | def calc_remotedemand_v1(self):
"""Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|Rem... | python | def calc_remotedemand_v1(self):
"""Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|Rem... | [
"def",
"calc_remotedemand_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | Estimate the discharge demand of a cross section far downstream.
Required control parameter:
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required flux sequence:
|dam_derived.TOY|
Calculated flux sequence:
|RemoteDemand|
Basic equation:
:... | [
"Estimate",
"the",
"discharge",
"demand",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L439-L521 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_remotefailure_v1 | def calc_remotefailure_v1(self):
"""Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequen... | python | def calc_remotefailure_v1(self):
"""Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequen... | [
"def",
"calc_remotefailure_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | Estimate the shortfall of actual discharge under the required discharge
of a cross section far downstream.
Required control parameters:
|NmbLogEntries|
|RemoteDischargeMinimum|
Required derived parameters:
|dam_derived.TOY|
Required log sequence:
|LoggedTotalRemoteDischarge|
... | [
"Estimate",
"the",
"shortfall",
"of",
"actual",
"discharge",
"under",
"the",
"required",
"discharge",
"of",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L524-L595 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_requiredremoterelease_v1 | def calc_requiredremoterelease_v1(self):
"""Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoot... | python | def calc_requiredremoterelease_v1(self):
"""Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoot... | [
"def",
"calc_requiredremoterelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"f... | Guess the required release necessary to not fall below the threshold
value at a cross section far downstream with a certain level of certainty.
Required control parameter:
|RemoteDischargeSafety|
Required derived parameters:
|RemoteDischargeSmoothPar|
|dam_derived.TOY|
Required flux... | [
"Guess",
"the",
"required",
"release",
"necessary",
"to",
"not",
"fall",
"below",
"the",
"threshold",
"value",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"with",
"a",
"certain",
"level",
"of",
"certainty",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L598-L705 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_requiredremoterelease_v2 | def calc_requiredremoterelease_v2(self):
"""Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`... | python | def calc_requiredremoterelease_v2(self):
"""Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`... | [
"def",
"calc_requiredremoterelease_v2",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"flu",
".",
"requiredremoterelease",
"=",
"log",
".",... | Get the required remote release of the last simulation step.
Required log sequence:
|LoggedRequiredRemoteRelease|
Calculated flux sequence:
|RequiredRemoteRelease|
Basic equation:
:math:`RequiredRemoteRelease = LoggedRequiredRemoteRelease`
Example:
>>> from hydpy.models.da... | [
"Get",
"the",
"required",
"remote",
"release",
"of",
"the",
"last",
"simulation",
"step",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L708-L731 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_allowedremoterelieve_v1 | def calc_allowedremoterelieve_v1(self):
"""Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
... | python | def calc_allowedremoterelieve_v1(self):
"""Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
... | [
"def",
"calc_allowedremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
".",
"fastaccess",
"flu",
".",
"allowedremoterelieve",
"=",
"log",
".",
... | Get the allowed remote relieve of the last simulation step.
Required log sequence:
|LoggedAllowedRemoteRelieve|
Calculated flux sequence:
|AllowedRemoteRelieve|
Basic equation:
:math:`AllowedRemoteRelieve = LoggedAllowedRemoteRelieve`
Example:
>>> from hydpy.models.dam imp... | [
"Get",
"the",
"allowed",
"remote",
"relieve",
"of",
"the",
"last",
"simulation",
"step",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L734-L757 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_requiredrelease_v1 | def calc_requiredrelease_v1(self):
"""Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
... | python | def calc_requiredrelease_v1(self):
"""Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
... | [
"def",
"calc_requiredrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | Calculate the total water release (immediately and far downstream)
required for reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameters:
|NearDischargeMinimumSmoothPar2|
|dam_derived.TOY|
Required flux sequence:
|Require... | [
"Calculate",
"the",
"total",
"water",
"release",
"(",
"immediately",
"and",
"far",
"downstream",
")",
"required",
"for",
"reducing",
"drought",
"events",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L760-L874 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_requiredrelease_v2 | def calc_requiredrelease_v2(self):
"""Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
... | python | def calc_requiredrelease_v2(self):
"""Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
... | [
"def",
"calc_requiredrelease_v2",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | Calculate the water release (immediately downstream) required for
reducing drought events.
Required control parameter:
|NearDischargeMinimumThreshold|
Required derived parameter:
|dam_derived.TOY|
Calculated flux sequence:
|RequiredRelease|
Basic equation:
:math:`Required... | [
"Calculate",
"the",
"water",
"release",
"(",
"immediately",
"downstream",
")",
"required",
"for",
"reducing",
"drought",
"events",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L877-L930 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_possibleremoterelieve_v1 | def calc_possibleremoterelieve_v1(self):
"""Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteReliev... | python | def calc_possibleremoterelieve_v1(self):
"""Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteReliev... | [
"def",
"calc_possibleremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"aid",
"=",
"self",
".",
"sequences",
".",
"aid... | Calculate the highest possible water release that can be routed to
a remote location based on an artificial neural network describing the
relationship between possible release and water stage.
Required control parameter:
|WaterLevel2PossibleRemoteRelieve|
Required aide sequence:
|WaterLeve... | [
"Calculate",
"the",
"highest",
"possible",
"water",
"release",
"that",
"can",
"be",
"routed",
"to",
"a",
"remote",
"location",
"based",
"on",
"an",
"artificial",
"neural",
"network",
"describing",
"the",
"relationship",
"between",
"possible",
"release",
"and",
"... | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L933-L999 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_actualremoterelieve_v1 | def calc_actualremoterelieve_v1(self):
"""Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
... | python | def calc_actualremoterelieve_v1(self):
"""Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
... | [
"def",
"calc_actualremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"d_smoothpar",
"=",
"con",
".",
"remoterelievetoleran... | Calculate the actual amount of water released to a remote location
to relieve the dam during high flow conditions.
Required control parameter:
|RemoteRelieveTolerance|
Required flux sequences:
|AllowedRemoteRelieve|
|PossibleRemoteRelieve|
Calculated flux sequence:
|ActualRemo... | [
"Calculate",
"the",
"actual",
"amount",
"of",
"water",
"released",
"to",
"a",
"remote",
"location",
"to",
"relieve",
"the",
"dam",
"during",
"high",
"flow",
"conditions",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1002-L1160 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_targetedrelease_v1 | def calc_targetedrelease_v1(self):
"""Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter ... | python | def calc_targetedrelease_v1(self):
"""Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter ... | [
"def",
"calc_targetedrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes"... | Calculate the targeted water release for reducing drought events,
taking into account both the required water release and the actual
inflow into the dam.
Some dams are supposed to maintain a certain degree of low flow
variability downstream. In case parameter |RestrictTargetedRelease|
is set to `T... | [
"Calculate",
"the",
"targeted",
"water",
"release",
"for",
"reducing",
"drought",
"events",
"taking",
"into",
"account",
"both",
"the",
"required",
"water",
"release",
"and",
"the",
"actual",
"inflow",
"into",
"the",
"dam",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1163-L1475 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_actualrelease_v1 | def calc_actualrelease_v1(self):
"""Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Require... | python | def calc_actualrelease_v1(self):
"""Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Require... | [
"def",
"calc_actualrelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
... | Calculate the actual water release that can be supplied by the
dam considering the targeted release and the given water level.
Required control parameter:
|WaterLevelMinimumThreshold|
Required derived parameters:
|WaterLevelMinimumSmoothPar|
Required flux sequence:
|TargetedRelease|... | [
"Calculate",
"the",
"actual",
"water",
"release",
"that",
"can",
"be",
"supplied",
"by",
"the",
"dam",
"considering",
"the",
"targeted",
"release",
"and",
"the",
"given",
"water",
"level",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1478-L1622 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_missingremoterelease_v1 | def calc_missingremoterelease_v1(self):
"""Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:... | python | def calc_missingremoterelease_v1(self):
"""Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:... | [
"def",
"calc_missingremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"missingremoterelease",
"=",
"max",
"(",
"flu",
".",
"requiredremoterelease",
"-",
"flu",
".",
"actualrelease",
",... | Calculate the portion of the required remote demand that could not
be met by the actual discharge release.
Required flux sequences:
|RequiredRemoteRelease|
|ActualRelease|
Calculated flux sequence:
|MissingRemoteRelease|
Basic equation:
:math:`MissingRemoteRelease = max(
... | [
"Calculate",
"the",
"portion",
"of",
"the",
"required",
"remote",
"demand",
"that",
"could",
"not",
"be",
"met",
"by",
"the",
"actual",
"discharge",
"release",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1625-L1656 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_actualremoterelease_v1 | def calc_actualremoterelease_v1(self):
"""Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMini... | python | def calc_actualremoterelease_v1(self):
"""Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMini... | [
"def",
"calc_actualremoterelease_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"flu... | Calculate the actual remote water release that can be supplied by the
dam considering the required remote release and the given water level.
Required control parameter:
|WaterLevelMinimumRemoteThreshold|
Required derived parameters:
|WaterLevelMinimumRemoteSmoothPar|
Required flux sequenc... | [
"Calculate",
"the",
"actual",
"remote",
"water",
"release",
"that",
"can",
"be",
"supplied",
"by",
"the",
"dam",
"considering",
"the",
"required",
"remote",
"release",
"and",
"the",
"given",
"water",
"level",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1659-L1762 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | update_actualremoterelieve_v1 | def update_actualremoterelieve_v1(self):
"""Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - disco... | python | def update_actualremoterelieve_v1(self):
"""Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - disco... | [
"def",
"update_actualremoterelieve_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"f... | Constrain the actual relieve discharge to a remote location.
Required control parameter:
|HighestRemoteDischarge|
Required derived parameter:
|HighestRemoteSmoothPar|
Updated flux sequence:
|ActualRemoteRelieve|
Basic equation - discontinous:
:math:`ActualRemoteRelieve = min(... | [
"Constrain",
"the",
"actual",
"relieve",
"discharge",
"to",
"a",
"remote",
"location",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1765-L1869 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_flooddischarge_v1 | def calc_flooddischarge_v1(self):
"""Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_deri... | python | def calc_flooddischarge_v1(self):
"""Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_deri... | [
"def",
"calc_flooddischarge_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",... | Calculate the discharge during and after a flood event based on an
|anntools.SeasonalANN| describing the relationship(s) between discharge
and water stage.
Required control parameter:
|WaterLevel2FloodDischarge|
Required derived parameter:
|dam_derived.TOY|
Required aide sequence:
... | [
"Calculate",
"the",
"discharge",
"during",
"and",
"after",
"a",
"flood",
"event",
"based",
"on",
"an",
"|anntools",
".",
"SeasonalANN|",
"describing",
"the",
"relationship",
"(",
"s",
")",
"between",
"discharge",
"and",
"water",
"stage",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L1994-L2092 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | calc_outflow_v1 | def calc_outflow_v1(self):
"""Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
... | python | def calc_outflow_v1(self):
"""Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
... | [
"def",
"calc_outflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"flu",
".",
"outflow",
"=",
"max",
"(",
"flu",
".",
"actualrelease",
"+",
"flu",
".",
"flooddischarge",
",",
"0.",
")"
] | Calculate the total outflow of the dam.
Note that the maximum function is used to prevent from negative outflow
values, which could otherwise occur within the required level of
numerical accuracy.
Required flux sequences:
|ActualRelease|
|FloodDischarge|
Calculated flux sequence:
... | [
"Calculate",
"the",
"total",
"outflow",
"of",
"the",
"dam",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2095-L2127 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | update_watervolume_v1 | def update_watervolume_v1(self):
"""Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)... | python | def update_watervolume_v1(self):
"""Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)... | [
"def",
"update_watervolume_v1",
"(",
"self",
")",
":",
"der",
"=",
"self",
".",
"parameters",
".",
"derived",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"old",
"=",
"self",
".",
"sequences",
".",
"states",
... | Update the actual water volume.
Required derived parameter:
|Seconds|
Required flux sequences:
|Inflow|
|Outflow|
Updated state sequence:
|WaterVolume|
Basic equation:
:math:`\\frac{d}{dt}WaterVolume = 1e-6 \\cdot (Inflow-Outflow)`
Example:
>>> from hydpy.... | [
"Update",
"the",
"actual",
"water",
"volume",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2130-L2163 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_outflow_v1 | def pass_outflow_v1(self):
"""Update the outlet link sequence |dam_outlets.Q|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.outflow | python | def pass_outflow_v1(self):
"""Update the outlet link sequence |dam_outlets.Q|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.q[0] += flu.outflow | [
"def",
"pass_outflow_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"q",
"[",
"0",
"]",
"+=",
"flu",
".",
"outfl... | Update the outlet link sequence |dam_outlets.Q|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"Q|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2251-L2255 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_actualremoterelease_v1 | def pass_actualremoterelease_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.s[0] += flu.actualremoterelease | python | def pass_actualremoterelease_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.s[0] += flu.actualremoterelease | [
"def",
"pass_actualremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"s",
"[",
"0",
"]",
"+=",
"flu",
"... | Update the outlet link sequence |dam_outlets.S|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"S|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2258-L2262 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_actualremoterelieve_v1 | def pass_actualremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.r[0] += flu.actualremoterelieve | python | def pass_actualremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
out = self.sequences.outlets.fastaccess
out.r[0] += flu.actualremoterelieve | [
"def",
"pass_actualremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"out",
"=",
"self",
".",
"sequences",
".",
"outlets",
".",
"fastaccess",
"out",
".",
"r",
"[",
"0",
"]",
"+=",
"flu",
"... | Update the outlet link sequence |dam_outlets.R|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"R|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2265-L2269 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_missingremoterelease_v1 | def pass_missingremoterelease_v1(self):
"""Update the outlet link sequence |dam_senders.D|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.d[0] += flu.missingremoterelease | python | def pass_missingremoterelease_v1(self):
"""Update the outlet link sequence |dam_senders.D|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.d[0] += flu.missingremoterelease | [
"def",
"pass_missingremoterelease_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"d",
"[",
"0",
"]",
"+=",
"flu",
... | Update the outlet link sequence |dam_senders.D|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_senders",
".",
"D|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2272-L2276 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_allowedremoterelieve_v1 | def pass_allowedremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.r[0] += flu.allowedremoterelieve | python | def pass_allowedremoterelieve_v1(self):
"""Update the outlet link sequence |dam_outlets.R|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.r[0] += flu.allowedremoterelieve | [
"def",
"pass_allowedremoterelieve_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"r",
"[",
"0",
"]",
"+=",
"flu",
... | Update the outlet link sequence |dam_outlets.R|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"R|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2279-L2283 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | pass_requiredremotesupply_v1 | def pass_requiredremotesupply_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.s[0] += flu.requiredremotesupply | python | def pass_requiredremotesupply_v1(self):
"""Update the outlet link sequence |dam_outlets.S|."""
flu = self.sequences.fluxes.fastaccess
sen = self.sequences.senders.fastaccess
sen.s[0] += flu.requiredremotesupply | [
"def",
"pass_requiredremotesupply_v1",
"(",
"self",
")",
":",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"sen",
"=",
"self",
".",
"sequences",
".",
"senders",
".",
"fastaccess",
"sen",
".",
"s",
"[",
"0",
"]",
"+=",
"flu",
... | Update the outlet link sequence |dam_outlets.S|. | [
"Update",
"the",
"outlet",
"link",
"sequence",
"|dam_outlets",
".",
"S|",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2286-L2290 | train |
hydpy-dev/hydpy | hydpy/models/dam/dam_model.py | update_loggedoutflow_v1 | def update_loggedoutflow_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with... | python | def update_loggedoutflow_v1(self):
"""Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with... | [
"def",
"update_loggedoutflow_v1",
"(",
"self",
")",
":",
"con",
"=",
"self",
".",
"parameters",
".",
"control",
".",
"fastaccess",
"flu",
"=",
"self",
".",
"sequences",
".",
"fluxes",
".",
"fastaccess",
"log",
"=",
"self",
".",
"sequences",
".",
"logs",
... | Log a new entry of discharge at a cross section far downstream.
Required control parameter:
|NmbLogEntries|
Required flux sequence:
|Outflow|
Calculated flux sequence:
|LoggedOutflow|
Example:
The following example shows that, with each new method call, the
three m... | [
"Log",
"a",
"new",
"entry",
"of",
"discharge",
"at",
"a",
"cross",
"section",
"far",
"downstream",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L2293-L2335 | train |
hydpy-dev/hydpy | hydpy/auxs/armatools.py | MA.update_coefs | def update_coefs(self):
"""(Re)calculate the MA coefficients based on the instantaneous
unit hydrograph."""
coefs = []
sum_coefs = 0.
moment1 = self.iuh.moment1
for t in itertools.count(0., 1.):
points = (moment1 % 1,) if t <= moment1 <= (t+2.) else ()
... | python | def update_coefs(self):
"""(Re)calculate the MA coefficients based on the instantaneous
unit hydrograph."""
coefs = []
sum_coefs = 0.
moment1 = self.iuh.moment1
for t in itertools.count(0., 1.):
points = (moment1 % 1,) if t <= moment1 <= (t+2.) else ()
... | [
"def",
"update_coefs",
"(",
"self",
")",
":",
"coefs",
"=",
"[",
"]",
"sum_coefs",
"=",
"0.",
"moment1",
"=",
"self",
".",
"iuh",
".",
"moment1",
"for",
"t",
"in",
"itertools",
".",
"count",
"(",
"0.",
",",
"1.",
")",
":",
"points",
"=",
"(",
"mo... | (Re)calculate the MA coefficients based on the instantaneous
unit hydrograph. | [
"(",
"Re",
")",
"calculate",
"the",
"MA",
"coefficients",
"based",
"on",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L201-L233 | train |
hydpy-dev/hydpy | hydpy/auxs/armatools.py | MA.turningpoint | def turningpoint(self):
"""Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph."""
coefs = self.coefs
old_dc = coefs[1]-coefs[0]
for idx in range(self.order-2):
new_dc = coefs[idx+2]-coefs[idx+1]
... | python | def turningpoint(self):
"""Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph."""
coefs = self.coefs
old_dc = coefs[1]-coefs[0]
for idx in range(self.order-2):
new_dc = coefs[idx+2]-coefs[idx+1]
... | [
"def",
"turningpoint",
"(",
"self",
")",
":",
"coefs",
"=",
"self",
".",
"coefs",
"old_dc",
"=",
"coefs",
"[",
"1",
"]",
"-",
"coefs",
"[",
"0",
"]",
"for",
"idx",
"in",
"range",
"(",
"self",
".",
"order",
"-",
"2",
")",
":",
"new_dc",
"=",
"co... | Turning point (index and value tuple) in the recession part of the
MA approximation of the instantaneous unit hydrograph. | [
"Turning",
"point",
"(",
"index",
"and",
"value",
"tuple",
")",
"in",
"the",
"recession",
"part",
"of",
"the",
"MA",
"approximation",
"of",
"the",
"instantaneous",
"unit",
"hydrograph",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L236-L249 | train |
hydpy-dev/hydpy | hydpy/auxs/armatools.py | MA.moments | def moments(self):
"""The first two time delay weighted statistical moments of the
MA coefficients."""
moment1 = statstools.calc_mean_time(self.delays, self.coefs)
moment2 = statstools.calc_mean_time_deviation(
self.delays, self.coefs, moment1)
return numpy.array([mom... | python | def moments(self):
"""The first two time delay weighted statistical moments of the
MA coefficients."""
moment1 = statstools.calc_mean_time(self.delays, self.coefs)
moment2 = statstools.calc_mean_time_deviation(
self.delays, self.coefs, moment1)
return numpy.array([mom... | [
"def",
"moments",
"(",
"self",
")",
":",
"moment1",
"=",
"statstools",
".",
"calc_mean_time",
"(",
"self",
".",
"delays",
",",
"self",
".",
"coefs",
")",
"moment2",
"=",
"statstools",
".",
"calc_mean_time_deviation",
"(",
"self",
".",
"delays",
",",
"self"... | The first two time delay weighted statistical moments of the
MA coefficients. | [
"The",
"first",
"two",
"time",
"delay",
"weighted",
"statistical",
"moments",
"of",
"the",
"MA",
"coefficients",
"."
] | 1bc6a82cf30786521d86b36e27900c6717d3348d | https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/armatools.py#L257-L263 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.