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

Subclass registration for Perturbation #1251

Closed
yifanmai opened this issue Dec 15, 2022 · 1 comment
Closed

Subclass registration for Perturbation #1251

yifanmai opened this issue Dec 15, 2022 · 1 comment
Assignees

Comments

@yifanmai
Copy link
Collaborator

yifanmai commented Dec 15, 2022

In order to round-trip Perturbation to and from JSON, we need a map of names to Perturbation subclasses. We can use subclass registration to do this automatically (also see this Stack Overflow article). This would eliminate the need to add every new Perturbation subclass to this map.

We should consider doing this for Scenario subclasses too, which have a similar problem.

@yifanmai
Copy link
Collaborator Author

yifanmai commented Nov 6, 2024

I now think that this is not the right approach, and that the current approach (explicitly registering the classes in the serialization module) is more explicit and preferred.

@yifanmai yifanmai closed this as completed Nov 6, 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