FABLE-3DXRD / ImageD11

ImageD11 is a python code for identifying individual grains in spotty area detector X-ray diffraction images.
https://imaged11.readthedocs.io/
GNU General Public License v2.0
15 stars 25 forks source link

Unitcell: Try to cast symmetry to int during init #277

Closed jadball closed 7 months ago

jadball commented 7 months ago

Importing a .gve file into the indexer with indexer.readgvfile calls unitcell.cellfromstring to build a unitcell from the parameters at the top of the .gve file. This means that, for .gve files with spacegroup-style symmetries, a str type symmetry is passed to the unitcell.__init__ method. For numeric (i.e spacegroup) symmetries, this means we don't properly detect that a spacegroup is being supplied. This patch fixes the bug - if the symmetry is a string, it checks if the string is a digit, and converts to int if possible before continuing the init.