question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clean up asciimaps

See original GitHub issue

The 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jakehadercommented, Nov 30, 2021

@scottyak, the 3.6 requirement has been removed in #491.

1reaction
john-sciencecommented, Nov 29, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove character ranges from data using a map - IBM
The syntax is set up for removing all numbers (0-90 but keeping all letters and spaces. This rule uses the ASCII character range, ......
Read more >
Is there a way to dumb down text from Unicode to ASCII?
Although the answer there is insufficient, it gave me an idea. I could map each of the Unicode code points in the Basic...
Read more >
MapSCII is a Braille & ASCII world map renderer for ... - GitHub
A node.js based Vector Tile to Braille and ASCII renderer for xterm-compatible terminals. asciicast. Try it out! $ telnet mapscii.me.
Read more >
Elegantly remove all ASCII characters outside the range 32 -126
I am definately in need of some extra cool points, so here is my most elegant way to remove ASCII characters outside of...
Read more >
Quick SPSS Tip: Cleaning up irregular characters in strings
We can use a simple loop and the PIB variable format in SPSS to clean out unwanted ascii codes in string characters.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found