repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
solve_dv_dt_v1
def solve_dv_dt_v1(self): """Solve the differential equation of HydPy-L. At the moment, HydPy-L only implements a simple numerical solution of its underlying ordinary differential equation. To increase the accuracy (or sometimes even to prevent instability) of this approximation, one can set the v...
python
def solve_dv_dt_v1(self): """Solve the differential equation of HydPy-L. At the moment, HydPy-L only implements a simple numerical solution of its underlying ordinary differential equation. To increase the accuracy (or sometimes even to prevent instability) of this approximation, one can set the v...
[ "def", "solve_dv_dt_v1", "(", "self", ")", ":", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", "fastaccess", "old", "=", "self", ".", "sequences", ".", "states", ".", ...
Solve the differential equation of HydPy-L. At the moment, HydPy-L only implements a simple numerical solution of its underlying ordinary differential equation. To increase the accuracy (or sometimes even to prevent instability) of this approximation, one can set the value of parameter |MaxDT| to a va...
[ "Solve", "the", "differential", "equation", "of", "HydPy", "-", "L", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L10-L69
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
calc_vq_v1
def calc_vq_v1(self): """Calculate the auxiliary term. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: |QZ| Required aide sequence: |llake_aides.V| Calculated aide sequence: |llake_aides.VQ| Basic equation: :math:`VQ = 2 \\cdo...
python
def calc_vq_v1(self): """Calculate the auxiliary term. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: |QZ| Required aide sequence: |llake_aides.V| Calculated aide sequence: |llake_aides.VQ| Basic equation: :math:`VQ = 2 \\cdo...
[ "def", "calc_vq_v1", "(", "self", ")", ":", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", "fastaccess", "aid", "=", "self", ".", "sequences", ".", "aides", ".", "fast...
Calculate the auxiliary term. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: |QZ| Required aide sequence: |llake_aides.V| Calculated aide sequence: |llake_aides.VQ| Basic equation: :math:`VQ = 2 \\cdot V + \\frac{Seconds}{NmbSubs...
[ "Calculate", "the", "auxiliary", "term", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L72-L112
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
interp_qa_v1
def interp_qa_v1(self): """Calculate the lake outflow based on linear interpolation. Required control parameters: |N| |llake_control.Q| Required derived parameters: |llake_derived.TOY| |llake_derived.VQ| Required aide sequence: |llake_aides.VQ| Calculated aide seque...
python
def interp_qa_v1(self): """Calculate the lake outflow based on linear interpolation. Required control parameters: |N| |llake_control.Q| Required derived parameters: |llake_derived.TOY| |llake_derived.VQ| Required aide sequence: |llake_aides.VQ| Calculated aide seque...
[ "def", "interp_qa_v1", "(", "self", ")", ":", "con", "=", "self", ".", "parameters", ".", "control", ".", "fastaccess", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "aid", "=", "self", ".", "sequences", ".", "aides", ".", "...
Calculate the lake outflow based on linear interpolation. Required control parameters: |N| |llake_control.Q| Required derived parameters: |llake_derived.TOY| |llake_derived.VQ| Required aide sequence: |llake_aides.VQ| Calculated aide sequence: |llake_aides.QA| ...
[ "Calculate", "the", "lake", "outflow", "based", "on", "linear", "interpolation", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L115-L222
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
calc_v_qa_v1
def calc_v_qa_v1(self): """Update the stored water volume based on the equation of continuity. Note that for too high outflow values, which would result in overdraining the lake, the outflow is trimmed. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: ...
python
def calc_v_qa_v1(self): """Update the stored water volume based on the equation of continuity. Note that for too high outflow values, which would result in overdraining the lake, the outflow is trimmed. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: ...
[ "def", "calc_v_qa_v1", "(", "self", ")", ":", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", "fastaccess", "aid", "=", "self", ".", "sequences", ".", "aides", ".", "fa...
Update the stored water volume based on the equation of continuity. Note that for too high outflow values, which would result in overdraining the lake, the outflow is trimmed. Required derived parameters: |Seconds| |NmbSubsteps| Required flux sequence: |QZ| Updated aide sequenc...
[ "Update", "the", "stored", "water", "volume", "based", "on", "the", "equation", "of", "continuity", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L225-L290
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
interp_w_v1
def interp_w_v1(self): """Calculate the actual water stage based on linear interpolation. Required control parameters: |N| |llake_control.V| |llake_control.W| Required state sequence: |llake_states.V| Calculated state sequence: |llake_states.W| Examples: Pr...
python
def interp_w_v1(self): """Calculate the actual water stage based on linear interpolation. Required control parameters: |N| |llake_control.V| |llake_control.W| Required state sequence: |llake_states.V| Calculated state sequence: |llake_states.W| Examples: Pr...
[ "def", "interp_w_v1", "(", "self", ")", ":", "con", "=", "self", ".", "parameters", ".", "control", ".", "fastaccess", "new", "=", "self", ".", "sequences", ".", "states", ".", "fastaccess_new", "for", "jdx", "in", "range", "(", "1", ",", "con", ".", ...
Calculate the actual water stage based on linear interpolation. Required control parameters: |N| |llake_control.V| |llake_control.W| Required state sequence: |llake_states.V| Calculated state sequence: |llake_states.W| Examples: Prepare a model object: ...
[ "Calculate", "the", "actual", "water", "stage", "based", "on", "linear", "interpolation", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L293-L354
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
corr_dw_v1
def corr_dw_v1(self): """Adjust the water stage drop to the highest value allowed and correct the associated fluxes. Note that method |corr_dw_v1| calls the method `interp_v` of the respective application model. Hence the requirements of the actual `interp_v` need to be considered additionally. ...
python
def corr_dw_v1(self): """Adjust the water stage drop to the highest value allowed and correct the associated fluxes. Note that method |corr_dw_v1| calls the method `interp_v` of the respective application model. Hence the requirements of the actual `interp_v` need to be considered additionally. ...
[ "def", "corr_dw_v1", "(", "self", ")", ":", "con", "=", "self", ".", "parameters", ".", "control", ".", "fastaccess", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", "f...
Adjust the water stage drop to the highest value allowed and correct the associated fluxes. Note that method |corr_dw_v1| calls the method `interp_v` of the respective application model. Hence the requirements of the actual `interp_v` need to be considered additionally. Required control parameter...
[ "Adjust", "the", "water", "stage", "drop", "to", "the", "highest", "value", "allowed", "and", "correct", "the", "associated", "fluxes", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L420-L561
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
modify_qa_v1
def modify_qa_v1(self): """Add water to or remove water from the calculated lake outflow. Required control parameter: |Verzw| Required derived parameter: |llake_derived.TOY| Updated flux sequence: |llake_fluxes.QA| Basic Equation: :math:`QA = QA* - Verzw` Examples: ...
python
def modify_qa_v1(self): """Add water to or remove water from the calculated lake outflow. Required control parameter: |Verzw| Required derived parameter: |llake_derived.TOY| Updated flux sequence: |llake_fluxes.QA| Basic Equation: :math:`QA = QA* - Verzw` Examples: ...
[ "def", "modify_qa_v1", "(", "self", ")", ":", "con", "=", "self", ".", "parameters", ".", "control", ".", "fastaccess", "der", "=", "self", ".", "parameters", ".", "derived", ".", "fastaccess", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", ...
Add water to or remove water from the calculated lake outflow. Required control parameter: |Verzw| Required derived parameter: |llake_derived.TOY| Updated flux sequence: |llake_fluxes.QA| Basic Equation: :math:`QA = QA* - Verzw` Examples: In preparation for the f...
[ "Add", "water", "to", "or", "remove", "water", "from", "the", "calculated", "lake", "outflow", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L564-L637
hydpy-dev/hydpy
hydpy/models/llake/llake_model.py
pass_q_v1
def pass_q_v1(self): """Update the outlet link sequence.""" flu = self.sequences.fluxes.fastaccess out = self.sequences.outlets.fastaccess out.q[0] += flu.qa
python
def pass_q_v1(self): """Update the outlet link sequence.""" flu = self.sequences.fluxes.fastaccess out = self.sequences.outlets.fastaccess out.q[0] += flu.qa
[ "def", "pass_q_v1", "(", "self", ")", ":", "flu", "=", "self", ".", "sequences", ".", "fluxes", ".", "fastaccess", "out", "=", "self", ".", "sequences", ".", "outlets", ".", "fastaccess", "out", ".", "q", "[", "0", "]", "+=", "flu", ".", "qa" ]
Update the outlet link sequence.
[ "Update", "the", "outlet", "link", "sequence", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/llake/llake_model.py#L649-L653
hydpy-dev/hydpy
hydpy/models/arma/arma_control.py
Responses.thresholds
def thresholds(self): """Threshold values of the response functions.""" return numpy.array( sorted(self._key2float(key) for key in self._coefs), dtype=float)
python
def thresholds(self): """Threshold values of the response functions.""" return numpy.array( sorted(self._key2float(key) for key in self._coefs), dtype=float)
[ "def", "thresholds", "(", "self", ")", ":", "return", "numpy", ".", "array", "(", "sorted", "(", "self", ".", "_key2float", "(", "key", ")", "for", "key", "in", "self", ".", "_coefs", ")", ",", "dtype", "=", "float", ")" ]
Threshold values of the response functions.
[ "Threshold", "values", "of", "the", "response", "functions", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/arma/arma_control.py#L308-L311
hydpy-dev/hydpy
hydpy/auxs/statstools.py
prepare_arrays
def prepare_arrays(sim=None, obs=None, node=None, skip_nan=False): """Prepare and return two |numpy| arrays based on the given arguments. Note that many functions provided by module |statstools| apply function |prepare_arrays| internally (e.g. |nse|). But you can also apply it manually, as shown in th...
python
def prepare_arrays(sim=None, obs=None, node=None, skip_nan=False): """Prepare and return two |numpy| arrays based on the given arguments. Note that many functions provided by module |statstools| apply function |prepare_arrays| internally (e.g. |nse|). But you can also apply it manually, as shown in th...
[ "def", "prepare_arrays", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "if", "node", ":", "if", "sim", "is", "not", "None", ":", "raise", "ValueError", "(", "'Values are passed to b...
Prepare and return two |numpy| arrays based on the given arguments. Note that many functions provided by module |statstools| apply function |prepare_arrays| internally (e.g. |nse|). But you can also apply it manually, as shown in the following examples. Function |prepare_arrays| can extract time seri...
[ "Prepare", "and", "return", "two", "|numpy|", "arrays", "based", "on", "the", "given", "arguments", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L18-L135
hydpy-dev/hydpy
hydpy/auxs/statstools.py
nse
def nse(sim=None, obs=None, node=None, skip_nan=False): """Calculate the efficiency criteria after Nash & Sutcliffe. If the simulated values predict the observed values as well as the average observed value (regarding the the mean square error), the NSE value is zero: >>> from hydpy import nse ...
python
def nse(sim=None, obs=None, node=None, skip_nan=False): """Calculate the efficiency criteria after Nash & Sutcliffe. If the simulated values predict the observed values as well as the average observed value (regarding the the mean square error), the NSE value is zero: >>> from hydpy import nse ...
[ "def", "nse", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", ",", "obs", ",", "node", ",", "skip_nan", ")", "return", "1."...
Calculate the efficiency criteria after Nash & Sutcliffe. If the simulated values predict the observed values as well as the average observed value (regarding the the mean square error), the NSE value is zero: >>> from hydpy import nse >>> nse(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0]) 0.0 ...
[ "Calculate", "the", "efficiency", "criteria", "after", "Nash", "&", "Sutcliffe", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L140-L170
hydpy-dev/hydpy
hydpy/auxs/statstools.py
bias_abs
def bias_abs(sim=None, obs=None, node=None, skip_nan=False): """Calculate the absolute difference between the means of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import bias_abs >>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> ro...
python
def bias_abs(sim=None, obs=None, node=None, skip_nan=False): """Calculate the absolute difference between the means of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import bias_abs >>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> ro...
[ "def", "bias_abs", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", ",", "obs", ",", "node", ",", "skip_nan", ")", "return", ...
Calculate the absolute difference between the means of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import bias_abs >>> round_(bias_abs(sim=[2.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> round_(bias_abs(sim=[5.0, 2.0, 2.0], obs=[1.0, 2.0, 3.0])) 1.0 ...
[ "Calculate", "the", "absolute", "difference", "between", "the", "means", "of", "the", "simulated", "and", "the", "observed", "values", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L175-L192
hydpy-dev/hydpy
hydpy/auxs/statstools.py
std_ratio
def std_ratio(sim=None, obs=None, node=None, skip_nan=False): """Calculate the ratio between the standard deviation of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import std_ratio >>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> ...
python
def std_ratio(sim=None, obs=None, node=None, skip_nan=False): """Calculate the ratio between the standard deviation of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import std_ratio >>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> ...
[ "def", "std_ratio", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", ",", "obs", ",", "node", ",", "skip_nan", ")", "return", ...
Calculate the ratio between the standard deviation of the simulated and the observed values. >>> from hydpy import round_ >>> from hydpy import std_ratio >>> round_(std_ratio(sim=[1.0, 2.0, 3.0], obs=[1.0, 2.0, 3.0])) 0.0 >>> round_(std_ratio(sim=[1.0, 1.0, 1.0], obs=[1.0, 2.0, 3.0])) -1.0 ...
[ "Calculate", "the", "ratio", "between", "the", "standard", "deviation", "of", "the", "simulated", "and", "the", "observed", "values", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L219-L236
hydpy-dev/hydpy
hydpy/auxs/statstools.py
corr
def corr(sim=None, obs=None, node=None, skip_nan=False): """Calculate the product-moment correlation coefficient after Pearson. >>> from hydpy import round_ >>> from hydpy import corr >>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0])) 1.0 >>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2...
python
def corr(sim=None, obs=None, node=None, skip_nan=False): """Calculate the product-moment correlation coefficient after Pearson. >>> from hydpy import round_ >>> from hydpy import corr >>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0])) 1.0 >>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2...
[ "def", "corr", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", ",", "obs", ",", "node", ",", "skip_nan", ")", "return", "nu...
Calculate the product-moment correlation coefficient after Pearson. >>> from hydpy import round_ >>> from hydpy import corr >>> round_(corr(sim=[0.5, 1.0, 1.5], obs=[1.0, 2.0, 3.0])) 1.0 >>> round_(corr(sim=[4.0, 2.0, 0.0], obs=[1.0, 2.0, 3.0])) -1.0 >>> round_(corr(sim=[1.0, 2.0, 1.0], obs...
[ "Calculate", "the", "product", "-", "moment", "correlation", "coefficient", "after", "Pearson", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L241-L257
hydpy-dev/hydpy
hydpy/auxs/statstools.py
hsepd_pdf
def hsepd_pdf(sigma1, sigma2, xi, beta, sim=None, obs=None, node=None, skip_nan=False): """Calculate the probability densities based on the heteroskedastic skewed exponential power distribution. For convenience, the required parameters of the probability density function as well as the si...
python
def hsepd_pdf(sigma1, sigma2, xi, beta, sim=None, obs=None, node=None, skip_nan=False): """Calculate the probability densities based on the heteroskedastic skewed exponential power distribution. For convenience, the required parameters of the probability density function as well as the si...
[ "def", "hsepd_pdf", "(", "sigma1", ",", "sigma2", ",", "xi", ",", "beta", ",", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", "...
Calculate the probability densities based on the heteroskedastic skewed exponential power distribution. For convenience, the required parameters of the probability density function as well as the simulated and observed values are stored in a dictonary: >>> import numpy >>> from hydpy import ro...
[ "Calculate", "the", "probability", "densities", "based", "on", "the", "heteroskedastic", "skewed", "exponential", "power", "distribution", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L279-L388
hydpy-dev/hydpy
hydpy/auxs/statstools.py
hsepd_manual
def hsepd_manual(sigma1, sigma2, xi, beta, sim=None, obs=None, node=None, skip_nan=False): """Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. The following examples are taken from the documentation of function ...
python
def hsepd_manual(sigma1, sigma2, xi, beta, sim=None, obs=None, node=None, skip_nan=False): """Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. The following examples are taken from the documentation of function ...
[ "def", "hsepd_manual", "(", "sigma1", ",", "sigma2", ",", "xi", ",", "beta", ",", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "sim", ",", "obs", "=", "prepare_arrays", "(", "sim", ...
Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. The following examples are taken from the documentation of function |hsepd_pdf|, which is used by function |hsepd_manual|. The first one deals with a heteroscedastic normal dist...
[ "Calculate", "the", "mean", "of", "the", "logarithmised", "probability", "densities", "of", "the", "heteroskedastic", "skewed", "exponential", "power", "distribution", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L399-L428
hydpy-dev/hydpy
hydpy/auxs/statstools.py
hsepd
def hsepd(sim=None, obs=None, node=None, skip_nan=False, inits=None, return_pars=False, silent=True): """Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. Function |hsepd| serves the same purpose as function |hsepd_manual|...
python
def hsepd(sim=None, obs=None, node=None, skip_nan=False, inits=None, return_pars=False, silent=True): """Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. Function |hsepd| serves the same purpose as function |hsepd_manual|...
[ "def", "hsepd", "(", "sim", "=", "None", ",", "obs", "=", "None", ",", "node", "=", "None", ",", "skip_nan", "=", "False", ",", "inits", "=", "None", ",", "return_pars", "=", "False", ",", "silent", "=", "True", ")", ":", "def", "transform", "(", ...
Calculate the mean of the logarithmised probability densities of the 'heteroskedastic skewed exponential power distribution. Function |hsepd| serves the same purpose as function |hsepd_manual|, but tries to estimate the parameters of the heteroscedastic skewed exponential distribution via an optimizati...
[ "Calculate", "the", "mean", "of", "the", "logarithmised", "probability", "densities", "of", "the", "heteroskedastic", "skewed", "exponential", "power", "distribution", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L433-L523
hydpy-dev/hydpy
hydpy/auxs/statstools.py
calc_mean_time
def calc_mean_time(timepoints, weights): """Return the weighted mean of the given timepoints. With equal given weights, the result is simply the mean of the given time points: >>> from hydpy import calc_mean_time >>> calc_mean_time(timepoints=[3., 7.], ... weights=[2., 2.]) ...
python
def calc_mean_time(timepoints, weights): """Return the weighted mean of the given timepoints. With equal given weights, the result is simply the mean of the given time points: >>> from hydpy import calc_mean_time >>> calc_mean_time(timepoints=[3., 7.], ... weights=[2., 2.]) ...
[ "def", "calc_mean_time", "(", "timepoints", ",", "weights", ")", ":", "timepoints", "=", "numpy", ".", "array", "(", "timepoints", ")", "weights", "=", "numpy", ".", "array", "(", "weights", ")", "validtools", ".", "test_equal_shape", "(", "timepoints", "=",...
Return the weighted mean of the given timepoints. With equal given weights, the result is simply the mean of the given time points: >>> from hydpy import calc_mean_time >>> calc_mean_time(timepoints=[3., 7.], ... weights=[2., 2.]) 5.0 With different weights, the resulting m...
[ "Return", "the", "weighted", "mean", "of", "the", "given", "timepoints", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L528-L566
hydpy-dev/hydpy
hydpy/auxs/statstools.py
calc_mean_time_deviation
def calc_mean_time_deviation(timepoints, weights, mean_time=None): """Return the weighted deviation of the given timepoints from their mean time. With equal given weights, the is simply the standard deviation of the given time points: >>> from hydpy import calc_mean_time_deviation >>> calc_mea...
python
def calc_mean_time_deviation(timepoints, weights, mean_time=None): """Return the weighted deviation of the given timepoints from their mean time. With equal given weights, the is simply the standard deviation of the given time points: >>> from hydpy import calc_mean_time_deviation >>> calc_mea...
[ "def", "calc_mean_time_deviation", "(", "timepoints", ",", "weights", ",", "mean_time", "=", "None", ")", ":", "timepoints", "=", "numpy", ".", "array", "(", "timepoints", ")", "weights", "=", "numpy", ".", "array", "(", "weights", ")", "validtools", ".", ...
Return the weighted deviation of the given timepoints from their mean time. With equal given weights, the is simply the standard deviation of the given time points: >>> from hydpy import calc_mean_time_deviation >>> calc_mean_time_deviation(timepoints=[3., 7.], ... wei...
[ "Return", "the", "weighted", "deviation", "of", "the", "given", "timepoints", "from", "their", "mean", "time", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L571-L618
hydpy-dev/hydpy
hydpy/auxs/statstools.py
evaluationtable
def evaluationtable(nodes, criteria, nodenames=None, critnames=None, skip_nan=False): """Return a table containing the results of the given evaluation criteria for the given |Node| objects. First, we define two nodes with different simulation and observation data (see function |prep...
python
def evaluationtable(nodes, criteria, nodenames=None, critnames=None, skip_nan=False): """Return a table containing the results of the given evaluation criteria for the given |Node| objects. First, we define two nodes with different simulation and observation data (see function |prep...
[ "def", "evaluationtable", "(", "nodes", ",", "criteria", ",", "nodenames", "=", "None", ",", "critnames", "=", "None", ",", "skip_nan", "=", "False", ")", ":", "if", "nodenames", ":", "if", "len", "(", "nodes", ")", "!=", "len", "(", "nodenames", ")", ...
Return a table containing the results of the given evaluation criteria for the given |Node| objects. First, we define two nodes with different simulation and observation data (see function |prepare_arrays| for some explanations): >>> from hydpy import pub, Node, nan >>> pub.timegrids = '01.01.2000...
[ "Return", "a", "table", "containing", "the", "results", "of", "the", "given", "evaluation", "criteria", "for", "the", "given", "|Node|", "objects", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/statstools.py#L623-L708
hydpy-dev/hydpy
hydpy/auxs/iuhtools.py
IUH.set_primary_parameters
def set_primary_parameters(self, **kwargs): """Set all primary parameters at once.""" given = sorted(kwargs.keys()) required = sorted(self._PRIMARY_PARAMETERS) if given == required: for (key, value) in kwargs.items(): setattr(self, key, value) else: ...
python
def set_primary_parameters(self, **kwargs): """Set all primary parameters at once.""" given = sorted(kwargs.keys()) required = sorted(self._PRIMARY_PARAMETERS) if given == required: for (key, value) in kwargs.items(): setattr(self, key, value) else: ...
[ "def", "set_primary_parameters", "(", "self", ",", "*", "*", "kwargs", ")", ":", "given", "=", "sorted", "(", "kwargs", ".", "keys", "(", ")", ")", "required", "=", "sorted", "(", "self", ".", "_PRIMARY_PARAMETERS", ")", "if", "given", "==", "required", ...
Set all primary parameters at once.
[ "Set", "all", "primary", "parameters", "at", "once", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L148-L164
hydpy-dev/hydpy
hydpy/auxs/iuhtools.py
IUH.primary_parameters_complete
def primary_parameters_complete(self): """True/False flag that indicates wheter the values of all primary parameters are defined or not.""" for primpar in self._PRIMARY_PARAMETERS.values(): if primpar.__get__(self) is None: return False return True
python
def primary_parameters_complete(self): """True/False flag that indicates wheter the values of all primary parameters are defined or not.""" for primpar in self._PRIMARY_PARAMETERS.values(): if primpar.__get__(self) is None: return False return True
[ "def", "primary_parameters_complete", "(", "self", ")", ":", "for", "primpar", "in", "self", ".", "_PRIMARY_PARAMETERS", ".", "values", "(", ")", ":", "if", "primpar", ".", "__get__", "(", "self", ")", "is", "None", ":", "return", "False", "return", "True"...
True/False flag that indicates wheter the values of all primary parameters are defined or not.
[ "True", "/", "False", "flag", "that", "indicates", "wheter", "the", "values", "of", "all", "primary", "parameters", "are", "defined", "or", "not", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L167-L173
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...
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L179-L192
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L195-L208
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L210-L225
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L228-L232
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L235-L241
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L402-L405
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/iuhtools.py#L449-L451
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L37-L55
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L64-L80
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/lland/lland_states.py#L88-L101
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", "." ]
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/views_edit.py#L28-L53
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" ]
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/views_edit.py#L55-L98
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L10-L104
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L107-L114
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hstream/hstream_model.py#L117-L123
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", "." ]
train
https://github.com/TabViewer/gtabview/blob/14ba391f0b225a1bf32d52b640a47b580f8b1b28/gtabview/dataio.py#L12-L37
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L25-L92
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L95-L162
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L165-L221
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L224-L258
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/importtools.py#L261-L357
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|", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L19-L36
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L117-L131
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|", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L168-L277
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/hland/hland_derived.py#L284-L297
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L366-L384
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L537-L562
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L565-L577
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L788-L803
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L805-L828
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L833-L850
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1323-L1370
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1372-L1448
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|", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1471-L1473
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1475-L1485
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1488-L1490
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/auxs/anntools.py#L1539-L1550
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L60-L81
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L117-L207
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",...
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L209-L222
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L329-L353
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L369-L434
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...
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L478-L504
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L516-L560
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L574-L602
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/itemtools.py#L604-L662
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", "." ]
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L14-L23
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", "." ]
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L39-L49
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...
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L53-L64
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", "." ]
train
https://github.com/arteria/django-openinghours/blob/6bad47509a14d65a3a5a08777455f4cc8b4961fa/openinghours/templatetags/openinghours_tags.py#L98-L173
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L70-L78
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L81-L86
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L93-L281
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L455-L462
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L465-L483
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L517-L528
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" ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L531-L537
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|", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L540-L545
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L547-L551
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...
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L559-L567
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L570-L597
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|", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/core/hydpytools.py#L600-L609
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L11-L25
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L28-L44
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L47-L51
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L54-L58
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L61-L65
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L68-L72
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L75-L118
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L121-L179
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L182-L293
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L296-L379
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L382-L436
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L439-L521
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L524-L595
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L598-L705
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L708-L731
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", "." ]
train
https://github.com/hydpy-dev/hydpy/blob/1bc6a82cf30786521d86b36e27900c6717d3348d/hydpy/models/dam/dam_model.py#L734-L757