Skip to content

Adding surface serialization - #87

Closed
taylornstjean wants to merge 2 commits into
icecube:mainfrom
taylornstjean:serialization
Closed

taylornstjean wants to merge 2 commits into
icecube:mainfrom
taylornstjean:serialization

Conversation

@taylornstjean

Copy link
Copy Markdown
Member

Hi! I'm currently working on weighting for an ML project, and I need the ability to serialize surfaces so I can reload them at runtime. I figured it would be better practice to implement within simweights instead of in my own project. Let me know if you have any questions or comments!

The changes I made are:

  • Added to_dict and from_dict to CompositeSurface, GenerationSurface, PowerLaw, CircleInjector and CylinderBase.
  • Added the factories resolve_spatial and resolve_powerlaw so serialized state can be kept backwards compatible.

I included relevant tests as well.

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.

1 participant