Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible simulation error related to EPW path. #1500

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Conversation

shorowit
Copy link
Contributor

@shorowit shorowit commented Oct 3, 2023

Pull Request Description

Closes #1497.

Checklist

PR Author: Check these when they're done. Not all may apply. strikethrough and check any that do not apply.

PR Reviewer: Verify each has been completed.

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (via tasks.rb)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests and/or workflow/tests/hpxml_translator_test.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

Comment on lines -85 to +86
epw_path = hpxml.climate_and_risk_zones.weather_station_epw_filepath
epw_filepath = hpxml.climate_and_risk_zones.weather_station_epw_filepath
abs_epw_path = File.absolute_path(epw_filepath)
Copy link
Contributor Author

@shorowit shorowit Oct 3, 2023

Choose a reason for hiding this comment

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

This is the bugfix, the rest is cleanup. If the HPXML file is in your current working directory and the EPW path in the HPXML file is a relative path, epw_path will also end up as a relative path and get written to the OSM as a relative path. This causes downstream problems since the OSM ends up in a different directory, so the weather file is no longer relative to it. So the bugfix is to make sure we always convert the epw_path to an absolute path for the OSM.

Copy link
Contributor Author

@shorowit shorowit Oct 3, 2023

Choose a reason for hiding this comment

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

Note that in most situations, the relative path was correctly ending up as an absolute path in the OSM. But in this one particular situation, it wasn't.

@shorowit shorowit merged commit 055b52a into master Oct 3, 2023
@shorowit shorowit deleted the epw_path_bugfix branch October 3, 2023 23:40
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.

Sim error if EPW next to HPXML and relative path used
1 participant