Skip to content

Update choropleth maps - #170

Merged
clairehalloran merged 45 commits into
mainfrom
ch/update-maps
Oct 9, 2026
Merged

clairehalloran merged 45 commits into
mainfrom
ch/update-maps

Conversation

@clairehalloran

@clairehalloran clairehalloran commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds adjustText package to environment as an optional package to avoid label overlap in maps and adds regional labels to some maps.

Before:
image

After:
image

Technical details

Added labels to net import, technology capacity, and H2 capacity maps in single_case_plots.py:

image image

Added labels to difference maps in compare_cases.py for both 2-case and multi-case comparison:
image

image

In hourly_plots.py, NaN values (such as for land-locked regions' offshore wind cf) are now colored white and unlabeled:
image

Implementation notes

I incorporated the adjust_text function into the existing reedsplots.label_region_value function for easy reuse.

Additional changes

  • Changes absolute color map from cmocean rain to tempo
image
  • Added outlines to sub-state regions in plot_diff_maps used for 2-case comparison in compare_cases.py
  • Squashed a bug that didn't simplify techs to their maptechs groups in plot_diff_maps function in reedsplots.py
  • Squashed small bugs in diagnostic_plots.py
    • Removed slashes from savenames that raised errors ("Oil/Gas Steam" tech)
    • Re-assigned dropped CRS

Validation, testing, and comparison report(s)

I compared USA_defaults run on this branch with a run from main. There were no changes in results, and a negligible increase in runtime (0.15 hours). Note that the difference in directory size is because I was saving vre_gen, max_cap, and load files from PRAS to run diagnostic_plots.py.

Full results here: results-main,update-maps.pptx

Checklist for author

Details to double-check

  • Charge code provided to reviewers
  • Included comparison reports for appropriate test cases
    - [ ] Documentation updated if necessary
  • Code formatting standardized
  • Reusable functions used where possible instead of copy/pasted code

General information to guide review

  • Zero impact on results of default case
  • No large data file(s) added/modified
  • No substantive impact on runtime for full-US reference case
  • No substantive impact on folder size for full-US reference case
  • No change to process flow (runreeds.py, reeds/core/solve/solve.py)
  • No change to code organization
  • No change to package requirements (environment.yml or Project.toml): adjustText package added

Did you use LLM tools (chatbot or copilot) in the preparation of this PR? If so, describe how

Yes, I used Copilot to simplify techs to their maptechs groups in plot_diff_maps function in reedsplots.py. I attempted this change manually and couldn't find a more elegant solution.

Tag points of contact here if you would like additional review of the relevant parts of the model

@patrickbrown4 patrickbrown4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Claire and sorry for the slow followup. Some high-level questions first and then I'll take another closer look.

Comment thread environment.yml Outdated
Comment thread reeds/plots.py
Comment thread reeds/reedsplots.py
Comment thread reeds/resource_adequacy/diagnostic_plots.py
Comment thread environment.yml Outdated

@patrickbrown4 patrickbrown4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks and sorry for the slow response. Some minor suggestions (happy to chat if helpful) but overall it looks good. Thanks for reorganizing to make the new package optional.

Comment thread reeds/input_processing/hourly_plots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread reeds/reedsplots.py Outdated
Comment thread docs/source/plotting_scripts/maps.py Outdated
clairehalloran and others added 25 commits October 9, 2026 13:40
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
Co-authored-by: Patrick Brown <25125211+patrickbrown4@users.noreply.github.com>
@clairehalloran
clairehalloran merged commit 04768de into main Oct 9, 2026
10 checks passed
@clairehalloran
clairehalloran deleted the ch/update-maps branch October 9, 2026 21:11
ax=ax[coords[case]], column='GW', cmap=cmap, vmin=vmin, vmax=vmax,
legend=False,
)
reedsplots.label_region_value(dfplot, ax=ax[coords[case]], column="GW", fontsize=5)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Claire, thanks for this PR update - love the new colors!

Small correction - I believe the fontsize parameter was changed to a dictionary entry in the new text_kwargs parameter:

Suggested change
reedsplots.label_region_value(dfplot, ax=ax[coords[case]], column="GW", fontsize=5)
reedsplots.label_region_value(dfplot, ax=ax[coords[case]], column="GW", text_kwargs={'fontsize': 5})

This would also need to be fixed in the other call to reedsplots.label_region_value() below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants