spfrommer/torchexplorer

Major code refactor

spfrommer opened this issue · 0 comments

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:

  1. _tooltip_dict() in structure.py is really a layout thing and shouldn't be polluting the structure extraction.
  2. Get rid of the double nesting in extract_structure. This should be refactored into a StructureExtractor class with structure_id as a member. The _extract_structure and _inner_recurse functions should be subdivided. Should all go into a structure directory.
  3. layout.py is an abomination. Should go into a layout directory, and serialization and layout logic should be split up. Get rid of the stupid function nesting. Needs a NodeSerializer and EdgeSerializer with a common serialization logic for dividers / lists etc. Make a layout/serialize_utils.py with the string width stuff, string formatting logic cleanly hidden.
  4. hook.py is decent but should be split up. Again a hook 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.