disorderedmaterials / dissolve

Structure refinement software for total scattering data
GNU General Public License v3.0
9 stars 16 forks source link

Make Species and Configuration classes immutable #1948

Open trisyoungs opened 1 week ago

trisyoungs commented 1 week ago

Describe the feature / issue For data safety it would be good to have the Species and Configuration class as truly immutable representations for the purposes of processing. In other words, we should remove any creative / destructive functions from them and put them all in something akin to EditableSpecies and EditableConfiguration classes. The latter would be passed to Generator procedures and then the contents of an immutable Configuration constructed from it once complete. Similarly, an EditableSpecies is the subject of drawing and other editing operations, and from which a Species is constructed afterwards.

If we do this it will clean up quite a few "what if's" and "maybe"s when it comes to potential data mutations in the basic classes.

trisyoungs commented 1 week ago

Probably need an analogue of SpeciesAtom (EditableSpeciesAtom) as well.