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

[New] serialize ODEScenario object #1239

Closed
lisphilar opened this issue Sep 25, 2022 · 2 comments · Fixed by #1240 or #1257
Closed

[New] serialize ODEScenario object #1239

lisphilar opened this issue Sep 25, 2022 · 2 comments · Fixed by #1240 or #1257
Labels
brainstorming Discussion to get creative ideas enhancement New feature or request

Comments

@lisphilar
Copy link
Owner

Summary of this new feature

Serialize ODEScenario object. This is related to #741 regarding deprecated Scenario class.
We can skip building baseline scenario when we have saved JSON file.

(Optional) Solution with the current version

import covsirphy as cs
filer = cs.Filer(directory="input", prefix="jpn")
snr_build = cs.ODEScenario.auto_build(geo="Japan", model=cs.SIRFModel)
# Dump
json_file = snr_build.to_json(**filer.json(title="scenarios"))
# Restore
snr = cs.ODEScenario.from_json(json_file)
# Check
snr_build == snr
snr.summary()

CovsirPhy version I used: 2.27.1

@lisphilar lisphilar added enhancement New feature or request brainstorming Discussion to get creative ideas labels Sep 25, 2022
@lisphilar lisphilar added this to the Release v2.28.0 milestone Sep 25, 2022
@lisphilar lisphilar mentioned this issue Sep 25, 2022
@lisphilar
Copy link
Owner Author

Documentation will be updated later.

@lisphilar
Copy link
Owner Author

With #1257,

  • update documentation
  • remove ODEScenario.__eq__ and ODEScenario.__ne__ because they are unstable

lisphilar added a commit that referenced this issue Oct 9, 2022
lisphilar added a commit that referenced this issue Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Discussion to get creative ideas enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant