Clean up asciimaps
See original GitHub issueThe functionality in utils/asciimaps.py has been pretty brittle, and difficult to extend and debug, and frankly pretty error prone to use. We’ve been talking for a while about perhaps taking another stab at the problem, so I am making this ticket to get it out there as a thing to do. I think a lot of the complexity stems from modelling the problem with a bunch of classes, which have pretty abstract state that needs to be ushered through a handful of methods that are subclassed in pretty nuanced and difficult to understand ways. I think the problem of mapping from a structured text grid to a dictionary of i,j indices -> specifier would better be suited to straight-up functions (e.g., fullHexFlatsUpToAscii(d)
and its inverse fullHexFlatsUpToDict(text)
. We can still provide a sort of pseudo-factory, which returns the appropriate functions given a provided geom and symmetry condition. If whoever tackles this feels like the use of some private classes would ease implementation of these functions, they are more than welcome to do so, or even try using the classes that we already have to get a fist-cut implementation of the functional interface, but I suspect that the class approach is more complicated than it needs to be.
In summary:
- replace the classes in asciimaps.py with functions for going to/from ascii<->dict
- refactor client code to use the functions. life should be way simpler!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
@scottyak, the 3.6 requirement has been removed in #491.
@jakehader @scottyak It looks like no one is using Python 3.6 anyway. Nick is hesitant to drop support for 3.10, so I think saying we support Python 3.7+ is a pretty safe bet for everyone.