Skip to content

Hashable Rules#2076

Merged
scarlehoff merged 25 commits into
masterfrom
hashable_rules
May 21, 2024
Merged

Hashable Rules#2076
scarlehoff merged 25 commits into
masterfrom
hashable_rules

Conversation

@comane
Copy link
Copy Markdown
Member

@comane comane commented May 10, 2024

Rules (for cuts) are made to tuple instead of list.
This makes them hashable and allows eg them to contained within a TupleComp object

@comane comane requested a review from scarlehoff May 10, 2024 14:43
@comane comane requested a review from Radonirinaunimi May 12, 2024 14:35
@comane comane mentioned this pull request May 12, 2024
Copy link
Copy Markdown
Member

@scarlehoff scarlehoff left a 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 ^^)

Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
@comane
Copy link
Copy Markdown
Member Author

comane commented May 13, 2024

Thanks for this, could you also remove frozenargs from the conda recipe / pyproject? It should not be needed anymore

I am not sure I understand, do you mean frozendict? Because that one is actually still needed

@scarlehoff
Copy link
Copy Markdown
Member

Because that one is actually still needed

I thought it was only needed by the filter rules?

Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py
Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/filters.py
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"}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread validphys2/src/validphys/loader.py Outdated
Comment thread validphys2/src/validphys/tests/test_filter_rules.py
Comment thread validphys2/src/validphys/config.py
Comment thread validphys2/src/validphys/filters.py Outdated
Comment thread validphys2/src/validphys/filters.py Outdated
@scarlehoff scarlehoff added the run-fit-bot Starts fit bot from a PR. label May 15, 2024
@github-actions
Copy link
Copy Markdown

Greetings from your nice fit 🤖 !
I have good news for you, I just finished my tasks:

Check the report carefully, and please buy me a ☕ , or better, a GPU 😉!

@comane comane added the enhancement New feature or request label May 17, 2024
@github-actions
Copy link
Copy Markdown

Greetings from your nice fit 🤖 !
I have good news for you, I just finished my tasks:

Check the report carefully, and please buy me a ☕ , or better, a GPU 😉!

@scarlehoff scarlehoff removed the run-fit-bot Starts fit bot from a PR. label May 17, 2024
Copy link
Copy Markdown
Member

@scarlehoff scarlehoff left a 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.

Comment thread validphys2/src/validphys/config.py Outdated
Comment thread validphys2/src/validphys/config.py Outdated
@scarlehoff scarlehoff mentioned this pull request May 20, 2024
33 tasks
comane and others added 3 commits May 20, 2024 18:27
Co-authored-by: Juan M. Cruz-Martinez <juacrumar@lairen.eu>
Co-authored-by: Juan M. Cruz-Martinez <juacrumar@lairen.eu>
Copy link
Copy Markdown
Member

@scarlehoff scarlehoff left a 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.

@scarlehoff scarlehoff merged commit d725786 into master May 21, 2024
@scarlehoff scarlehoff deleted the hashable_rules branch May 21, 2024 10:24


@dataclasses.dataclass(frozen=True)
class AddedFilterRule(FilterRule):
Copy link
Copy Markdown
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants