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

Create doe prototype building "SWIG director method error. IOError: not opened for reading" in OpenStudioApplication 1.8.0 #145

Closed
ainar opened this issue Sep 23, 2024 · 3 comments
Assignees

Comments

@ainar
Copy link

ainar commented Sep 23, 2024

Hello,

When trying to apply the measure "Create doe prototype building" in OpenStudio Application 1.8.0, I get the error "SWIG director method error. IOError: not opened for reading." (Trace below)
I experienced this error in Windows 11 and Ubuntu 24.04 for any building type.

Standard Output:
val=1 
[openstudio.measure.OSRunner] SWIG director method error. IOError: not opened for reading 

Traceback (most recent call last): 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `each' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `get_standards_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:238:in `climate_zone_representative_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/modify.rb:376:in `model_set_building_location' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model' 
C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb:173:in `run' 
[openstudio.workflow.OSWorkflow] Found error in state 'OpenStudioMeasures' with message: 'Runner error: Measure 'C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb' reported an error with [SWIG director method error. IOError: not opened for reading 

Traceback (most recent call last): 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `each' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `get_standards_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:238:in `climate_zone_representative_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/modify.rb:376:in `model_set_building_location' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model' 
C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb:173:in `run']' 

Standard Error:
Failed to run workflow. Last Error: 
Found error in state 'OpenStudioMeasures' with message: 'Runner error: Measure 'C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb' reported an error with [SWIG director method error. IOError: not opened for reading 

Traceback (most recent call last): 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `each' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `get_standards_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:238:in `climate_zone_representative_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/modify.rb:376:in `model_set_building_location' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model' 
C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb:173:in `run']' 

run.log:
[14:46:38.164692 WARN] [openstudio.workflow.OSWorkflow] No valid weather file defined in either the osm or osw. 
[14:46:48.076815 ERROR] [openstudio.measure.OSRunner] SWIG director method error. IOError: not opened for reading 

Traceback (most recent call last): 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `each' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `get_standards_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:238:in `climate_zone_representative_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/modify.rb:376:in `model_set_building_location' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model' 
C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb:173:in `run' 
[14:46:48.077817 ERROR] [openstudio.workflow.OSWorkflow] Found error in state 'OpenStudioMeasures' with message: 'Runner error: Measure 'C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb' reported an error with [SWIG director method error. IOError: not opened for reading 

Traceback (most recent call last): 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `each' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:198:in `get_standards_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/information.rb:238:in `climate_zone_representative_weather_file_path' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/weather/modify.rb:376:in `model_set_building_location' 
:/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model' 
C:/Users/Aina/BCL/be90fd0b-a651-467a-bc8d-29d310b0f937/d6078b4e-403e-4722-a7f2-1fe9c569cc1d/measure.rb:173:in `run']' 
@mdahlhausen
Copy link
Contributor

Testing a fix with NREL/openstudio-standards#1816

@DavidGoldwasser
Copy link
Collaborator

DavidGoldwasser commented Nov 8, 2024

With 3.9.0.rc2 two two measure tests for this pass on CI (Linux) and pass on my mac locally if I run ruby my_test.rb but then fail if I run openstudio my_rest.rb. Not sure now but I'll keep this open until I can figure it out.

  1) Error:
CreateDOEPrototypeBuildingTest#test_primary_school:
Errno::ENOENT: No such file or directory @ dir_s_mkdir - :/ruby/3.2.0/gems/openstudio-standards-0.7.0.rc1/lib/openstudio-standards/weather/extracted_files
    :/ruby/3.2.0/fileutils.rb:406:in `mkdir'
    :/ruby/3.2.0/fileutils.rb:406:in `fu_mkdir'
    :/ruby/3.2.0/fileutils.rb:384:in `block (2 levels) in mkdir_p'
    :/ruby/3.2.0/fileutils.rb:382:in `reverse_each'
    :/ruby/3.2.0/fileutils.rb:382:in `block in mkdir_p'
    :/ruby/3.2.0/fileutils.rb:374:in `each'
    :/ruby/3.2.0/fileutils.rb:374:in `mkdir_p'
    :/ruby/3.2.0/gems/openstudio-standards-0.7.0.rc1/lib/openstudio-standards/weather/information.rb:207:in `get_standards_weather_file_path'
    :/ruby/3.2.0/gems/openstudio-standards-0.7.0.rc1/lib/openstudio-standards/weather/information.rb:253:in `climate_zone_representative_weather_file_path'
    :/ruby/3.2.0/gems/openstudio-standards-0.7.0.rc1/lib/openstudio-standards/weather/modify.rb:382:in `model_set_building_location'
    :/ruby/3.2.0/gems/openstudio-standards-0.7.0.rc1/lib/openstudio-standards/prototypes/common/objects/Prototype.Model.rb:37:in `model_create_prototype_model'
    /Users/dgoldwas/Documents/github/nrel/openstudio-model-articulation-gem/lib/measures/create_DOE_prototype_building/measure.rb:173:in `run'

@mdahlhausen
Copy link
Contributor

mdahlhausen commented Nov 8, 2024

Almost certainly a path issue with the weather files. Perhaps hitting the windows path length limit. Can you retest with 0.7.0 and check if the weather file is there manually?

@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenStudio Measure Gems Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants