Update sim.config_dict
when saving a Simulation
to a file
#435
Labels
convenience
Improve user-friendliness
enhancement
Improvement of existing features
good first issue
Good for newcomers
A
Simulation
is usually created from aconfig_dict
, which is saved undersim.config_dict
.However, when properties of a
Simulation
are changed within the code, e.g.this is not updated in the
sim.config_dict
.This is, in general, not a big issue. However, when saving a
Simulation
to an LH5 file and reading it back in, theSolidStateDetector
will be constructed from thesim.config_dict
and will have forgotten about the settings set interactively.How I envision this:
When saving, we could add a check which constructs a new
Simulation
from the currentsim.config_dict
.It, then, compares all initial fields of the new
Simulation
(excluding e.g.electric_potential
,electric_field
,weighting_potentials
, ... which may or may not have been calculated) to the existing ones. If there is a mismatch, it should update thesim.config_dict
accordingly, before saving it to a file.Up for discussion would be whether such a
config_dict
up-to-date test should be optional or not.And if so, whether it should be on by default or not.
The text was updated successfully, but these errors were encountered: