-
Notifications
You must be signed in to change notification settings - Fork 7
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
The _update
, _reset
, _required_parameters
methods (and _get_derived_parameters
to a lesser degree) add a lot of boiler plate but in most cases don't actually do anything any more, as shown by the many "This implementation has nothing to do."
#203
Comments
@tilmantroester Our original idea was to make those methods abstract to make the user to think about their object structure to be sure they are not missing anything when implementing a new object. In practice, these methods are basically handling the calls to update the parameters/get a list of names/reset (that's now done automatically) and to call update/required_parameters/reset on any other Updatable object contained in the object's instance. We have the option to make all automatic, we can make a similar procedure where we inspect all properties in a object and save those which are Updatable/UpdatableCollection and automatically trigger the matching methods. However, we are worried if this would make the objects too "magical", that is, difficult to understand to the final user. Do you have an opinion on this? Should we ask on slack? |
That's an interesting question. I think it's nice to have good default behaviour (such as automatically calling the update/reset/required_parameters/get_derived_parameters methods of sub- Where the existence of nested |
This issue is partly solved with PR #275. That does not complete the work, and we’ll leave this issue open until that work is completed. |
@marcpaterno can you confirm that this was fixed by #310 ? If so, please close this issue. |
We believe that #310 has fixed this issue. If there is additional redesign needed please open a new targeted issue. |
I'd like to suggest removing the
@abstractmethod
for these inUpdatable
, or at least move the default implementations to places likeSystematic
andSource
. I imagine the most common contributions to firecrown will be in the form of new systematics by users that neither understand nor care about the very neat internals you've come up with. I believe that allowing users to write a simpleSystematics
class with just an__init__
andapply
method makes for a more welcoming environment and readable code than having to copy in a bunch of empty_*
methods that most users won't ever need to change.The existence of these methods should be documented for advanced users but even knowing what these methods do, I personally struggle to come up with a use case right now for anything but
_get_derived_parameters
.Originally posted by @tilmantroester in #194 (comment)
The text was updated successfully, but these errors were encountered: