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

runner.getArgumentValues does not honor argument data type #5196

Closed
Tracked by #5102
shorowit opened this issue May 14, 2024 · 2 comments · Fixed by #5197
Closed
Tracked by #5102

runner.getArgumentValues does not honor argument data type #5196

shorowit opened this issue May 14, 2024 · 2 comments · Fixed by #5197

Comments

@shorowit
Copy link
Contributor

Issue overview

Very simple OSW to demonstrate the issue:
test.zip

Run it w/ OpenStudio 3.8 as follows:
openstudio run -m -w test.osw

image

It will print out {:double_value=>40} instead of {:double_value=>40.0}. This caused a bug in our software because we ended up doing integer division instead of float division. Since the argument is of type Double, runner.getArgumentValues should be able to return the value as a double, right?

(Also, I'm seeing that val=1 is being output when I use the run -m flag. Maybe some debug code in OS that wasn't removed?)

@joseph-robertson @jmarrec

@shorowit shorowit added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label May 14, 2024
@DavidGoldwasser DavidGoldwasser added this to the OpenStudio SDK 3.8.0 milestone May 14, 2024
@DavidGoldwasser
Copy link
Collaborator

I may be seeing that in one of the measures in NREL/openstudio-calibration-gem#66

So I guess a question is putting in 3.8.0. Is this low risk and easy enough to fix today to put in release package tomorrow, or if there is a work around to bypass the issue, do we wait.

@DavidGoldwasser DavidGoldwasser assigned jmarrec and unassigned jmarrec May 14, 2024
@DavidGoldwasser DavidGoldwasser added component - CLI severity - Major Bug and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels May 14, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented May 14, 2024

MCVE

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument("double", true)
arg.setValue(10.0)

arg.valueAsJSON
=> 10
arg.valueAsJSON.class
=> Integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants