How tekshteint/shiftplotter works
Project type and purpose
• It takes user input (gear ratios, tire size, final drive ratios, or an existing file), computes speed vs. RPM for each gear, and renders a plot (on screen or as files in MatPlotLib’s formats or GML).
File structure
• Top level:
• shiftPlotter.py – contains all logic (CLI parsing, computation, plotting, exporting)
• README.md – usage, flags, example
• .gitignore / .gitattributes – standard repo configs
• No frontend/backend distinction – it’s a single-process CLI utility with internal modules (all in one file).
README for additional insights
• Flags handled:
• --save “filename.gml” → export a GML graph file
• --open “filename.gml” → re-open an existing graph
• Primary external libraries implied: MatPlotLib, possibly NetworkX (for GML export)
A. Command-Line Interface (argparse)
B. Input Loader / Parser (parses --open GML if requested)
C. Calculation Engine (computes RPM vs. speed trajectories per gear)
D. Plot Generator
• Delegates to MatPlotLib
E. GML Exporter / Importer
• Delegates to NetworkX or custom routines
F. Output Renderer
• On-screen interactive window or saved image (PNG/GML)
Relationships & data flow
• User → (1) CLI Parser
• CLI Parser → (2a) Input Loader OR (2b) Calculation Engine
• Calculation Engine → Plot Generator
• Plot Generator → MatPlotLib → Output Renderer
• CLI Parser → GML Exporter → File System (save .gml)
• File System → GML Importer → Calculation Engine (on --open)
Architectural patterns / design principles
• Single process, modular functional decomposition
• Clear separation between “compute” and “render”
• Extensibility point: add new exporters (e.g., SVG) or input file formats
• No persistent state beyond local files; stateless per invocation
Relevant technologies / libraries
• Python 3.x standard library: argparse, sys, math
• MatPlotLib for plotting
• (Optionally) NetworkX or built-in GML routines for file export/import
• Clear, concise labels for each internal module
• Internal modules (e.g., blue rectangles)
• External libraries (green rounded rectangles)
Final advice
• Be exhaustive but not overly granular—group related functions into these high-level components.
• Every logical step from user invocation to final output.
• Extensibility: if someone wants to add a new file format, where would it plug in?