-
Notifications
You must be signed in to change notification settings - Fork 318
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
arbitrary class to Instrument.add_parameter #28
Conversation
This will definitely work for me, but it might be easier if it were (also) possible to just add an instance of a parameter. Then the parameters can be initialized without the need of using **kwargs in the code which leads to easier code in my opinion. Secondly, it would then be possible to add the same (instance of a) parameter to multiple instruments (although I am not convinced that we need this, but it could have some uses I think) |
What do you mean, easier to read, or to write? I think parameters are complicated enough that we should always be constructing them using keyword arguments anyway, and if you do that then this form seems like it pretty easily maps onto whatever class you want to instantiate.
Perhaps, but I've been trying to mostly duck type, rather than relying on param_obj = MyParameter(...)
self.parameters[param_obj.name] = param_obj the only thing you miss then is the uniqueness check (that you're not overwriting an existing parameter) |
Ok, that would indeed be a way out for the special cases. |
arbitrary class to Instrument.add_parameter
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
And add a note to pdf that this has happened
@damazter as discussed, in case you want your own parameter class for Alazar or other complicated instruments.