SpineOpt.jl icon indicating copy to clipboard operation
SpineOpt.jl copied to clipboard

Some non-trivial (maybe trivial) clarification for code writing

Open nnhjy opened this issue 1 year ago • 0 comments

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:

  1. 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 a Call of parameters. What confuses me is that some parameter calls use it while others do not.
  2. 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 a DB (Q: with kwargs or simply indices arguments or both? Same question applies to the following terms)
    • parameter_name[]: this doesn't seem to exist/allowed
    • parameter_name[()]: A Call of the parameter that may contain indices not defined, typically used for extension with stochastic and temporal indices
    • variable_name(): only acts as the defining function of the variable?
    • variable_name[]: the way to use a variable as variable_name[u, s, t ... ] (Q: kwargs not exist/allowed?)
    • variable_name[()]: this doesn't seem to exist/allowed

nnhjy avatar Dec 05 '23 15:12 nnhjy