Skip to content

Use default cache path for TMY data when output_dir is None#89

Merged
dan-mccabe merged 3 commits intomainfrom
copilot/fix-output-dir-error-for-tmy-data
Apr 24, 2026
Merged

Use default cache path for TMY data when output_dir is None#89
dan-mccabe merged 3 commits intomainfrom
copilot/fix-output-dir-error-for-tmy-data

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Running GTFSEnergyPredictor with add_hvac=True but without output_dir raised Exception: Must specify output_dir if downloading TMY data, making HVAC energy modeling impossible without specifying an output directory.

Changes

  • routee/transit/thermal_energy.py: Replace the exception in add_HVAC_energy with a default cache path of ~/.cache/routee-transit/TMY when output_dir=None. Directory creation is already handled by download_tmy_files.
  • tests/test_thermal_energy.py: Add test_add_HVAC_energy_no_output_dir to guard against regression; refactored shared setup into _make_mock_feed_and_trips() helper.
# Previously raised an exception — now works out of the box
predictor = GTFSEnergyPredictor(gtfs_path="data/gtfs")
results = predictor.run(add_hvac=True)

Copilot AI changed the title [WIP] Fix exception for missing output_dir when downloading TMY data Use default cache path for TMY data when output_dir is None Apr 17, 2026
Copilot AI requested a review from dan-mccabe April 17, 2026 22:42
@dan-mccabe dan-mccabe marked this pull request as ready for review April 24, 2026 19:57
@dan-mccabe dan-mccabe merged commit fc834ca into main Apr 24, 2026
4 checks passed
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.

Fix Exception: Must specify output_dir if downloading TMY data

2 participants