temoa icon indicating copy to clipboard operation
temoa copied to clipboard

Graphviz plotting: Fix multi-region file naming and implement general upgrades

Open coderabbitai[bot] opened this issue 2 months ago • 0 comments

Overview

This issue tracks improvements to the graphviz-based static plotting functionality in temoa/data_processing/make_graphviz.py.

Multi-region file naming issue

When using the GraphvizDiagramGenerator class methods (create_main_results_diagram, create_tech_results_diagrams, create_commodity_partial_results, create_complete_input_graph), there is a mismatch between the region parameter used for database queries and self.region used for output filename construction. This causes files to be mislabeled or overwritten when a single generator instance is reused for multiple regions.

Expected behavior

Both database queries and filename construction should use the same effective region value (parameter fallback to instance attribute).

General upgrades needed

In addition to fixing the region parameter issue, the graphviz plotting functionality needs general modernization and upgrades.

Context

  • Related PR: #180
  • Comment: https://github.com/TemoaProject/temoa/pull/180#discussion_r2478505690
  • Requested by: @ParticularlyPythonicBS

References

  • temoa/data_processing/make_graphviz.py

coderabbitai[bot] avatar Oct 30 '25 15:10 coderabbitai[bot]