NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
509 stars 193 forks source link

uninitialized constant OpenStudio::PathWatcher #3791

Closed DavidGoldwasser closed 4 years ago

DavidGoldwasser commented 5 years ago

The test below runs successfully in 2.9, but not in 3.0. In both cases I'm running the script by calling openstudio PathWatcher_Test.rb and using the ruby that comes with the CLI.

https://github.com/NREL/OpenStudio/blob/develop3/ruby/test/PathWatcher_Test.rb#L34

Here is the log from OpenStudio-3.0.0-rc1

Error: uninitialized constant OpenStudio::PathWatcher in eval:300:in `const_missing'
/Users/dgoldwas/Documents/GitHub/NREL/OpenStudio/ruby/test/PathWatcher_Test.rb:34:in `<top (required)>'

Here is the successful run from 2.9

MiniTest::Unit::TestCase is now Minitest::Test. From /Users/dgoldwas/Documents/GitHub/NREL/OpenStudio/ruby/test/PathWatcher_Test.rb:57:in `<top (required)>'
Run options: --seed 63047

# Running:

[openstudio.PathWatcher] <2> Directory './I do not exist/' does not exist, cannot be watched
..

Finished in 40.017361s, 0.0500 runs/s, 0.3998 assertions/s.

2 runs, 16 assertions, 0 failures, 0 errors, 0 skips
ssl-vpn-10-10-139-13:~ dgoldwas$

I didn't identify this through the test, but rather through trying to setup the stand alone SketchUp plugin for 3.0.0-rc1. For reference I can load OpenStudio in SketchUp's ruby, and access and use model methods, so I feel confident should be able to get the plugin working.

DavidGoldwasser commented 5 years ago

Here is console log from SketchUp. I manually made some model objects after making a new model to confirm openstudio loaded correctly, then tried to use PathWatcher

OS:Version,
  {13227370-f2d2-4f6d-8b16-50846f1b0725}, !- Handle
  3.0.0-rc1;                              !- Version Identifier
OS:Building,
  {808cf52c-483d-47a0-ba08-6994ddce4f3e}, !- Handle
  This is a test,                         !- Name
  ,                                       !- Building Sector Type
  ,                                       !- North Axis {deg}
  ,                                       !- Nominal Floor to Floor Height {m}
  ,                                       !- Space Type Name
  ,                                       !- Default Construction Set Name
  ;                                       !- Default Schedule Set Name
OS:Site,
  {48e1a3ec-a9c6-4ffb-83bb-aa176151a2d0}, !- Handle
  Site 1,                                 !- Name
  ,                                       !- Latitude {deg}
  ,                                       !- Longitude {deg}
  ,                                       !- Time Zone {hr}
  ,                                       !- Elevation {m}
  ;                                       !- Terrain
OS:Space,
  {fa805f67-ee31-4825-bfca-a6dd9c49650e}, !- Handle
  Space 1;                                !- Name
> puts OpenStudio::Model::Model
OpenStudio::Model::Model
> puts OpenStudio::Model
OpenStudio::Model
> puts OpenStudio::PathWatcher
Error: #<NameError: uninitialized constant OpenStudio::PathWatcher>
<main>:in `<main>'
SketchUp:1:in `eval'
> puts OpenStudio::Modeleditor
Error: #<NameError: uninitialized constant OpenStudio::Modeleditor>
<main>:in `<main>'
SketchUp:1:in `eval'
jmarrec commented 5 years ago

@DavidGoldwasser is that with Openstudio installer or with OpenStudioApplication installer?

DavidGoldwasser commented 5 years ago

@jmarrec I was able to reproduce the error with the CLI in both installers.

jmarrec commented 5 years ago

I see the problem. model_editor was moved to the OpenStudioApplication project, and it's probably not linking correctly to the openstudio.so (generated from this OpenStudio project) so it's not available...

jmarrec commented 5 years ago

Seems like @macumber has been working on something similar https://github.com/NREL/OpenStudioApplication/pull/50

macumber commented 5 years ago

Those path watcher tests should be moved out of the open studio repository, they depend on a Qt functionality so are only available in the os app repo. You would have to require openstudio_modeleditor.rb to get them to work.

DavidGoldwasser commented 5 years ago

@macumber that is good to know. So someone can't just install SketchUp plugin and point it to core OpenStudio, then need to have the OpenStudio application installed. In some ways the Plugin then is kind of a sub-application to the OpenStudio Application.

jmarrec commented 5 years ago

https://unmethours.com/question/41430/openstudio-100-pre-1-installation-problem/

jmarrec commented 4 years ago

Moved to NREL/OpenStudioApplication via https://github.com/NREL/OpenStudio/pull/3808