-
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
Hashable Rules #2076
Hashable Rules #2076
Conversation
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.
Thanks for this, could you also remove frozenargs from the conda recipe / pyproject? It should not be needed anymore
(I think this closes #2027 ^^)
I am not sure I understand, do you mean |
I thought it was only needed by the filter rules? |
@@ -511,7 +558,7 @@ def __init__(self, initial_data: dict, *, defaults: dict, theory_parameters: dic | |||
self.rule_string = self.rule | |||
self.defaults = defaults | |||
self.theory_params = theory_parameters | |||
ns = {*self.numpy_functions, *self.defaults, *self.variables, "idat", "central_value"} | |||
ns = {*self.numpy_functions, *self.defaults.to_dict().keys(), *self.variables, "idat", "central_value"} |
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.
ns = {*self.numpy_functions, *self.defaults.to_dict().keys(), *self.variables, "idat", "central_value"} | |
ns = {*self.numpy_functions, *self.defaults.to_dict(), *self.variables, "idat", "central_value"} |
Not that it makes a difference though.
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
Greetings from your nice fit 🤖 !
Check the report carefully, and please buy me a ☕ , or better, a GPU 😉! |
Co-authored-by: Juan M. Cruz-Martinez <[email protected]>
Co-authored-by: Juan M. Cruz-Martinez <[email protected]>
Co-authored-by: Juan M. Cruz-Martinez <[email protected]>
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.
Thanks for this, I think this is already finished :)
Just some small comments for parse_filter_defaults
.
Co-authored-by: Juan M. Cruz-Martinez <[email protected]>
Co-authored-by: Juan M. Cruz-Martinez <[email protected]>
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.
Seems ok. I've done a few tests and I haven't seen anything obviously wrong.
|
||
|
||
@dataclasses.dataclass(frozen=True) | ||
class AddedFilterRule(FilterRule): |
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.
What is the purpose of this class?
Rules (for cuts) are made to tuple instead of list.
This makes them hashable and allows eg them to contained within a
TupleComp
object