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

Json export step1 #281

Merged
merged 48 commits into from
Nov 16, 2023
Merged

Json export step1 #281

merged 48 commits into from
Nov 16, 2023

Conversation

nkrah
Copy link
Collaborator

@nkrah nkrah commented Nov 7, 2023

First steps of implementing a mechanism to dump/load a simulation as a JSON file.

@nkrah nkrah marked this pull request as draft November 7, 2023 00:23
nkrah added 25 commits November 9, 2023 22:45
add read-only option for properties; improve print output; implement from_dictionary(); implement to_json_string() and to_json_file(); iimplement create_gateobject_from_dict()
…o_dictionary() and VolumeManager.to_dictionary()
@nkrah nkrah marked this pull request as ready for review November 13, 2023 21:56
@nkrah
Copy link
Collaborator Author

nkrah commented Nov 16, 2023

JSON export works for those parts of the simulation which already make use of the GateObject base class. Those are: VolumeManager and volumes, PhysicsManager, PhysicsListManager, Region, and now also Simulation.

The Simulation class has been refactored into a GateObject. User infos are now defined via the user_info_defaults class attribute. The SimulationUserInfo class has thus become obsolete and has been removed.

Using the json archiving option is simple, see test065_sim_as_dict.py.
The user activates it by setting the store_json_archive option in the simulation object to True.
When running the simulation, a json file containing all relevant parameters of the simulation will automatically be created and stored in the output directory which can be specified via the output_dir option of the simulation object.
The user can also manually call sim.to_json_file() to save the simulation as json file.

@nkrah nkrah merged commit 90fa3ea into OpenGATE:master Nov 16, 2023
@nkrah nkrah deleted the json_export_step1 branch November 16, 2023 11:58
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