Major code refactor
spfrommer opened this issue · 0 comments
spfrommer commented
With caching and other changes the code has gotten quite unwieldy with rather long functions and files. I'd like to do a ground-up refactor of the source.
Changes:
_tooltip_dict()
instructure.py
is really a layout thing and shouldn't be polluting the structure extraction.- Get rid of the double nesting in
extract_structure
. This should be refactored into aStructureExtractor
class withstructure_id
as a member. The_extract_structure
and_inner_recurse
functions should be subdivided. Should all go into astructure
directory. layout.py
is an abomination. Should go into alayout
directory, and serialization and layout logic should be split up. Get rid of the stupid function nesting. Needs aNodeSerializer
andEdgeSerializer
with a common serialization logic for dividers / lists etc. Make alayout/serialize_utils.py
with the string width stuff, string formatting logic cleanly hidden.hook.py
is decent but should be split up. Again ahook
directory with separate files for the tracking / io / io_grad hooks. Clean up record_sizes, we don't need the dynamic sizing. Flatten some indent levels with None -> continue.