SpineOpt.jl
SpineOpt.jl copied to clipboard
Some non-trivial (maybe trivial) clarification for code writing
Noticed that before hunting the monster of stochastic
and temporal
, there are some prerequisites which might be worth a clarification somewhere for those who wish and dare to create and change the codes:
- the purpose and under what circumstance (not) to use the
t0 = _analysis_time(m)
among the indices. (could be appended in the docstring https://github.com/spine-tools/SpineOpt.jl/blob/bb96d0f3679364c52f8bda1dc75291c6befbd3b5/src/util/misc.jl#L168) To my understanding, this is basically used in aCall
of parameters. What confuses me is that some parameter calls use it while others do not. - the meaning, purpose, use, and difference between and/or whether such syntax is allowed or makes sense (I attach my naive understanding or question for showcase):
-
parameter_name()
: basic way to call a parameter defined in aDB
(Q: withkwargs
or simply indices arguments or both? Same question applies to the following terms) -
parameter_name[]
: this doesn't seem to exist/allowed -
parameter_name[()]
: ACall
of the parameter that may contain indices not defined, typically used for extension withstochastic
andtemporal
indices -
variable_name()
: only acts as the defining function of thevariable
? -
variable_name[]
: the way to use a variable asvariable_name[u, s, t ... ]
(Q:kwargs
not exist/allowed?) -
variable_name[()]
: this doesn't seem to exist/allowed
-