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
484 stars 185 forks source link

`openstudio classic measure -s` is broken (measure manager using classic CLI) in 3.8.0 #5212

Open jmarrec opened 1 month ago

jmarrec commented 1 month ago

Issue overview

The measure manager in the classic CLI is broken in 3.8.0

Current Behavior

$ openstudio --version
3.8.0+f953b6fcaf
$ openstudio classic measure -s 8091
┌────────────────────────────────────────────────────────────────────────────────┐
│  The `classic` command is deprecated and will be removed in a future release   │
└────────────────────────────────────────────────────────────────────────────────┘
Error executing argv: ["measure", "-s", "8091"]
Error: cannot load such file -- webrick in eval:182:in `require'

Expected Behavior

It should work.

Possible Solution

webrick gem was removed from the standard library in Ruby 3. So it should be part of the openstudio-gems Gemfile. Or the classic subcommand should be removed.

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

The following libraries are no longer bundled gems or standard libraries. Install the corresponding gems to use these features. sdbm, webrick, net-telnet, xmlrpc

Details

Environment

Some additional details about your environment for this issue (if relevant):

Context

Found in OpenStudioApplication at https://github.com/openstudiocoalition/OpenStudioApplication/pull/714#issuecomment-2132780927

macumber commented 1 month ago

I think even the non-classic CLI has some issues in 3.8.0, it fails to infer measure name for the OpenStudio Results measure.

jmarrec commented 1 month ago

@macumber No, that's a combination of:

  1. The openstudio-extension gem was gutted down after we moved stuff to the C++ side
  2. The OpenStudioApp is using an outdated measure (but I haven't checked if @DavidGoldwasser released an updated one)

The actual error:

$ cd OpenStudioApplication/src/openstudio_app/Resources/openstudio_results
$ openstudio measure -u .

Failed to infer measure name from /Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/./measure.rb: LoadError: cannot load such file -- openstudio/extension/core/os_lib_schedules
location=["eval:182:in `require'", "eval:182:in `require'", "<internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/measure.rb:11:in `<top (required)>'", "eval:8:in `load'", "eval:8:in `<main>'"]

Traceback:
eval:182:in `require'
eval:182:in `require'
<internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/measure.rb:11:in `<top (required)>'
eval:8:in `load'
eval:8:in `<main>'
className=
Failed to infer measure name from '/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/./measure.rb'
jmarrec commented 1 month ago

Apparently not yet;: https://github.com/NREL/openstudio-common-measures-gem/blob/473f9e7df50014262f21231e524f1510bcfae985/lib/measures/openstudio_results/measure.rb#L11

But should soon, this PR seem to have it: https://github.com/NREL/openstudio-common-measures-gem/pull/169/files#diff-f17e661c254a9015bada9e2f41b56572513c4d93ba52eebbe12c9c4a46247f93L9

DavidGoldwasser commented 1 month ago

I'll try to get all the measures up to ruby.gems and BCL by the end of the week. My attempt to be productive while at SimBuild last week didn't work.

jmarrec commented 3 weeks ago

@DavidGoldwasser Are you still working on https://github.com/NREL/openstudio-common-measures-gem/pull/169 ?

We'd like for openstudio-results at least to be updated, since the OSApp ships it by default and it breaks users that chose to enable the "classic" CLI.

macumber commented 1 day ago

These gbxml measures seem to be affected too: https://github.com/NREL/gbxml-to-openstudio

MatthewSteen commented 12 hours ago

Apparently not yet;: https://github.com/NREL/openstudio-common-measures-gem/blob/473f9e7df50014262f21231e524f1510bcfae985/lib/measures/openstudio_results/measure.rb#L11

But should soon, this PR seem to have it: https://github.com/NREL/openstudio-common-measures-gem/pull/169/files#diff-f17e661c254a9015bada9e2f41b56572513c4d93ba52eebbe12c9c4a46247f93L9

These gbxml measures seem to be affected too: https://github.com/NREL/gbxml-to-openstudio


These changes were included in https://github.com/NREL/gbxml-to-openstudio/releases/tag/v1.2.0, which was tested and works. We (and Autodesk) don't use the classic or measure -s args, just openstudio run -w.