-
Notifications
You must be signed in to change notification settings - Fork 197
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
Round trip forward and reverse translation issue. #4096
Comments
I should point out when I used a different model in the measure test directory |
|
Ok I see what's going on:
We're getting a problem here because E+ decided to use a numeric field at the end of what looks like an extensible thing. At the time of writing the RT for ReverseTranslateZone.cpp, I suppose this wasn't an option, so no-one ever double checked that we wouldn't hit a problem with empty fields. Anyways, this is a problem of the using the right getString overload one that would return uninitializedEmpty. OpenStudio/src/energyplus/ReverseTranslator/ReverseTranslateZone.cpp Lines 237 to 263 in 4e5b621
|
There is a numeric field after the Groups 1-4, so handle blanks correctly.
@jmarrec that commit did the trick. I ran both the test code above and the full measure test. |
There is a numeric field after the Groups 1-4, so handle blanks correctly.
There is a numeric field after the Groups 1-4, so handle blanks correctly.
I took out could from this measure to isolate the issue. The example model used is
ExampleModel.osm
https://github.com/NREL/openstudio-common-measures-gem/tree/develop/lib/measures/view_data/tests
Note, the model in the repo is version 1.3, but I have used OS App to upgrade to 3.0.1 here.
https://drive.google.com/file/d/1BC11cHIJCtfC6K3jMmO45WoLwMcq9Omq/view?usp=sharing
I see the following possible casues.
The file is invalid and there is no bug (I would need to fix the test model so it isn't invalide)
Version translation from earlier version to 3.1.0 is broken
Forward translation to IDF is broken
Reverse translation back to OSM is broken.
`
require 'openstudio'
vt = OpenStudio::OSVersion::VersionTranslator.new
model = vt.loadModel('ExampleModel.osm')
model = model.get
forward translate OSM file to IDF file
ft = OpenStudio::EnergyPlus::ForwardTranslator.new
workspace = ft.translateModel(model)
workspace.save('my.idf', true)
reverse translate IDF file to OSM file
rt = OpenStudio::EnergyPlus::ReverseTranslator.new
model2 = rt.translateWorkspace(workspace)
model2.save('my.osm', true)
`
The error that shows up on the second to last line
rt.translateWorkspace(workspace)
isError: Unknown OpenStudio Enum Value '' in /Users/dgoldwas/Documents/GitHub/URBANopt/openstudio-common-measures-gem/lib/measures/view_data/tests/round_trip_check.rb:14:in
translateWorkspace'`The text was updated successfully, but these errors were encountered: