Make ASCII, not war: ascii-art for testing network analysis
summary
An ASCII-diagram parser turns text art into networkx graphs and then into power-system objects and CIM XML so tests contain the diagram not 40 lines of XML. Phase labels map to conductor count, one character equals 100 m per character for line length, labels create sources, loads, PV, transformers and switches, and pytest parameterization runs many phase/config cases. Code is open source as asciigraf on PyPI and feeds power-flow and UI checks.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:23The problem
- 3:48The data model
- 5:29Simple test
- 5:59Hard to read
- 6:22New tests
- 6:49Documentation
- 8:00Maintaining rings
- 8:17Testing in XML
- 8:31Not perfect
- 8:41The test
- 9:15ASCII graph
- 10:11NetworkX graph
- 10:47NetworkX neighbors
- 11:12Skew
- 12:18Node Labels
- 13:30Power Flow
- 14:41Test yourself
- 14:55New test cases
- 16:08Conclusion
