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

Enforce immutability with dataclasses #65

Open
ShantanuKodgirwar opened this issue Aug 30, 2024 · 0 comments
Open

Enforce immutability with dataclasses #65

ShantanuKodgirwar opened this issue Aug 30, 2024 · 0 comments

Comments

@ShantanuKodgirwar
Copy link
Contributor

ShantanuKodgirwar commented Aug 30, 2024

As per the paper and the design principle, ExperimentalData, Engines, Params and Monitor must be immutable. However, python doesn't allow this by default. I recommend some refactoring to the base classes to use the python dataclasses library by specifying a decorator @dataclass(frozen=True). This would enforce immutability and also avoid potential bugs and might simplify fixing them in the long-run.

@ShantanuKodgirwar ShantanuKodgirwar changed the title Enforce immutability with package dataclasses Enforce immutability with dataclasses Aug 30, 2024
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

No branches or pull requests

1 participant