(Running the dev branch)
When reading, modifying, then writing a design, I found that the "grid" key in the scadnano file becomes mangled.
It appears that the problem is:
- The grid value in the scadnano file is a string, without any "Grid." prefix.
- When read with
Design.from_scadnano_file, the grid value remains a string, rather than being interpreted as a Grid Enum.
- When written,
str(grid) is written with the first 5 characters removed, to remove "Grid.". But as a string, instead of a Grid, it doesn't have the "Grid." prefix, resulting in either a blank string (with "none") or "e" (with "square"), which then crashes scadnano itself.
I'm a bit confused as to why it appears this is apparently not being caught by type checking, though it might have to do with the underlying Enum representation being a string.
I quickly wrote a modification to the writer, in the fix-grid branch on my fork, but I don't think this is actually the correct way to fix the problem.
(Running the dev branch)
When reading, modifying, then writing a design, I found that the "grid" key in the scadnano file becomes mangled.
It appears that the problem is:
Design.from_scadnano_file, the grid value remains a string, rather than being interpreted as a Grid Enum.str(grid)is written with the first 5 characters removed, to remove "Grid.". But as a string, instead of a Grid, it doesn't have the "Grid." prefix, resulting in either a blank string (with "none") or "e" (with "square"), which then crashes scadnano itself.I'm a bit confused as to why it appears this is apparently not being caught by type checking, though it might have to do with the underlying Enum representation being a string.
I quickly wrote a modification to the writer, in the fix-grid branch on my fork, but I don't think this is actually the correct way to fix the problem.