Open jobrachem opened 1 month ago
Discussion notes
.new_param
, new_obs
and new_calc
appear to be unproblematic..new_const
. The naming could imply that it is immutable, which it is not. It is possible to change the name.What is the purpose of .new_const
?
lsl.Var
without specifying a distribution..new_
constructors.Maybe .new_const
just needs a better name. Maybe lsl.Var.new_value
? That would provide a nice parallel to how lsl.Var.new_calc
wraps a lsl.Calc
.
This PR is now ready for review. In addition to th new constructors, I added and updated the documentation:
Var
docstringCalc
docstringModel
docstring a bit, and gave the Model
class a more prominent position on the "model building" overview page.The helper functions lsl.param
and lsl.obs
are marked as deprecated and emit a FutureWarning
now. They are announced as scheduled for removal in v0.4.0
. Currently we are moving towards v0.2.10
.
During the review, please pay attention not only to the pure code implementation, but also to the clarity of the documentation 🙏
For a while now, I have been a little unsatisfied with two things:
Var
class vs.param
andobs
functions. See also #130Data
(or, in #170 :Value
) node vs.Var
: Which should you use?I think there is a satisfying solution:
Var
that fullfill the tasks above.Var.new_<constructor>
as a default.If I recall correctly, using constructors has been proposed before by @wiep.
This PR implements four constructors.
Var.new_param
Supersedes
lsl.param()
Var.new_obs
Supersedes
lsl.obs()
Var.new_calc
New. Having this constructor available makes the interface more consistent. Users can simply start typing
Var.new_
and see the available options via auto-completion. It also reduces errors from confusion about nestingCalc
objects inVar
constructors.Var.new_const
New. Like with
Var.new_calc
, having this constructor makes the interface more consistent and supports a good habit.Todo
This is a draft PR for a first discussion. Even if it remains unchanged, documentation has to be added if it ends up being merged.
param
andobs
Var
constructor