-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Var constructors: new_param, new_obs, new_calc, new_value #201
Conversation
Discussion notes
What is the purpose of
Maybe |
This PR is now ready for review. In addition to th new constructors, I added and updated the documentation:
The helper functions During the review, please pay attention not only to the pure code implementation, but also to the clarity of the documentation 🙏 |
@GianmarcoCallegher gentle reminder :) |
@GianmarcoCallegher As we just discussed, the test action is currently failing due to timeout. What is surprising is that I did not change any code between the previous test run and the current test run. I just re-ran the action. Locally, the tests run in <150s. This is weird to me. |
See #213 regarding the tests timing out. |
@GianmarcoCallegher the testing issue is solved for the moment, and the PR can be reviewed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All clear. Just a little comment
For a while now, I have been a little unsatisfied with two things:
Var
class vs.param
andobs
functions. See also Rename Param and Obs #130Data
(or, in Rename Data -> Value; keep old name as an alias #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