Running quickflat-based tests or examples (e.g. pytest cortex/tests/test_quickflat.py, examples/datasets/plot_data_with_alpha.py) against the bundled filestore leaves filestore/db/S1/overlays.svg modified (a ~880-line diff: the file is re-serialized with pretty_print=True, layers get re-added, etc.).
Cause: cortex.svgoverlay.get_overlay(..., modify_svg_file=True) is the default, and the "assure all layers are present" step plus the final etree.tostring(svg, pretty_print=True) write the overlay back to disk (cortex/svgoverlay.py around L752-770 and L885).
This is a footgun: git status is dirty after every test run, and it is easy to accidentally commit the rewritten file (see 7b8ddd1 / d04acd7 for how painful this file is in history).
Suggestions:
- tests/examples should never write into the tracked filestore — e.g. a session fixture that copies
filestore/db to a temp dir and points cortex.options/db.filestore at it, or calling get_overlay with modify_svg_file=False;
- and/or make
get_overlay only write when the SVG content actually changed (no rewrite just for pretty-printing).
🤖 Generated with Claude Code
https://claude.ai/code/session_01KdjyZMFXsn6mRMJu9i8ige
Running quickflat-based tests or examples (e.g.
pytest cortex/tests/test_quickflat.py,examples/datasets/plot_data_with_alpha.py) against the bundled filestore leavesfilestore/db/S1/overlays.svgmodified (a ~880-line diff: the file is re-serialized withpretty_print=True, layers get re-added, etc.).Cause:
cortex.svgoverlay.get_overlay(..., modify_svg_file=True)is the default, and the "assure all layers are present" step plus the finaletree.tostring(svg, pretty_print=True)write the overlay back to disk (cortex/svgoverlay.pyaround L752-770 and L885).This is a footgun:
git statusis dirty after every test run, and it is easy to accidentally commit the rewritten file (see 7b8ddd1 / d04acd7 for how painful this file is in history).Suggestions:
filestore/dbto a temp dir and pointscortex.options/db.filestoreat it, or callingget_overlaywithmodify_svg_file=False;get_overlayonly write when the SVG content actually changed (no rewrite just for pretty-printing).🤖 Generated with Claude Code
https://claude.ai/code/session_01KdjyZMFXsn6mRMJu9i8ige