Skip to content

Fix Generate_results_figures for Model B outputs and overlapping columns - #4

Open
Watcher1223 wants to merge 1 commit into
idaholab:mainfrom
Watcher1223:fix/generate-results-figures-join-and-columns
Open

Fix Generate_results_figures for Model B outputs and overlapping columns#4
Watcher1223 wants to merge 1 commit into
idaholab:mainfrom
Watcher1223:fix/generate-results-figures-join-and-columns

Conversation

@Watcher1223

Copy link
Copy Markdown

Summary

Updates Generate_results_figures.py so post-optimization HTML figures build reliably for current HydroBoost CSV layouts (including Model B).

Changes

  • Result paths: _find_result_dir locates hydro / plant / storage dispatch CSVs under Simulation_Results/<project> or the first subfolder that contains all three (when Julia writes case-specific subdirs).
  • Validation: Clear messages and exit when files are missing or row counts are not 8760 (hourly year).
  • Plant column names: Map p_G_ht and p_G_Gr_ht (Model A/B naming) to the same display labels as p_HT_ht / p_HG_ht, so revenue columns resolve (Hydropower to Grid, etc.).
  • Join: Hydro and plant frames can both include q_G_jht; merge plant+storage first, rename overlapping columns with a _plant suffix on the plant side, then join hydro.
  • Pandas: resample('ME') instead of deprecated 'M'; remove noisy print(df.columns); one-line confirmation of output directory.

Testing

  • Ran python Generate_results_figures.py Model_B locally against Model B simulation outputs; figures written under Simulation_Results/.../Figures/.

Upstream reference: idaholab/HydroBoost.

Made with Cursor

- Find dispatch CSVs in Simulation_Results/<project> or first subfolder that
  contains all three files (Julia may write nested case dirs).
- Validate row counts (8760) and missing files with clear messages.
- Map p_G_ht and p_G_Gr_ht from Model A/B plant outputs to display names.
- Disambiguate duplicate column names (e.g. q_G_jht) before joining hydro
  with plant+storage.
- Use resample ME instead of deprecated M; trim debug output.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant