Skip to content
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

create a decorator for _build_collection #711

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

zhichen3
Copy link
Collaborator

An attempt to address issue #668.
Not sure if this is any better or cleaner.

@zhichen3 zhichen3 marked this pull request as draft December 31, 2023 20:16
@yut23
Copy link
Collaborator

yut23 commented Jan 2, 2024

I think something like _invalidate_collection or _modifies_rates would be better for the decorator name.

@zingale
Copy link
Member

zingale commented Jan 3, 2024

this looks good to me

@yut23
Copy link
Collaborator

yut23 commented Jan 5, 2024

Huh. Turns out making that a @staticmethod only works in 3.10+: https://stackoverflow.com/a/76237739. I think the standard practice is to move it outside the class.

@zingale
Copy link
Member

zingale commented Feb 5, 2024

we seemed to stall on this one. How do we want to proceed?

@zhichen3
Copy link
Collaborator Author

zhichen3 commented Feb 5, 2024

I completely forgot about this pr, maybe I'll try to move it outside of the class like as eric suggested.

@zhichen3
Copy link
Collaborator Author

zhichen3 commented Feb 5, 2024

I think this version also works, but pylint complains that I'm accessing protected member functions. Not sure what to do with this, can I just remove the underscore in the name?

@zhichen3 zhichen3 marked this pull request as ready for review February 5, 2024 20:42
@yut23
Copy link
Collaborator

yut23 commented Feb 5, 2024

I think renaming the decorator to modifies_rates is fine. For the other warning, you can add # pylint: disable-next=protected-access on the line before self._build_collection() to suppress it.

@zhichen3
Copy link
Collaborator Author

zhichen3 commented Feb 5, 2024

I think renaming the decorator to modifies_rates is fine. For the other warning, you can add # pylint: disable-next=protected-access on the line before self._build_collection() to suppress it.

thanks Eric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants