First time here? Check our help page!
4

no arguments found when trying to compute arguments though OpenStudio CLI

When executing the --compute_arguments option using the OpenStudio CLI per these instructions I get back an empty array for the arguements of a measure. For example, the ChangeBuildingLocation measure from BCL returns arguemets as expeceted but the CreateBarFromBuildingTypeRatios measure from BCL returns an empty array for the arguements. Both measures both have arguments so I can't find what the problem is.

Lincoln's avatar
1.5k
Lincoln
asked 2020-07-17 17:06:42 -0500, updated 2020-07-17 19:36:02 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

I downloaded these measures from the BCL and think this is probably happening because the CreateBarFromBuildingTypeRatios measure has spaces in the directory name, i.e. "Create Bar From Building Type Ratios"

So when you make the call to compute_arguments you need to add quotes around the directory name otherwise the CLI will think you are computing arguments for a measure in a directory named "Create".

C:\test>\openstudio-3.0.1\bin\openstudio.exe measure --compute_arguments untitled.osm "Create Bar From Building Type Ratios"
macumber's avatar
12k
macumber
answered 2020-07-18 19:00:56 -0500
edit flag offensive 0 remove flag delete link

Comments

I have it returning results for me but the arguments array in particular is empty. Can you confirm that you're getting back arguments if you do something like: JSON.parse(computed_measure_arguments) ["arguments"]? I successfully updated the README file for the measure using CLI and it also indicates that it isn't recognizing any argument information. The README says:

(Automatically generated argument information follows)

Arguments

This measure does not have any user arguments

Lincoln's avatar Lincoln (2020-07-19 10:54:27 -0500) edit

Yes, here is the output I get. I also posted the measure.xml so you can compare file checksums with yours. You have to pass an osm to the compute_arguments method. I used an empty model at version 3.0.1, I used the same CLI version.

macumber's avatar macumber (2020-07-19 11:05:51 -0500) edit

I found the culprit. The measure requires modules from the openstudio-extension-gem. If I instead save those modules locally to the resources directory of the measure and change the measure.rb file to load the modules locally it works.

Lincoln's avatar Lincoln (2020-07-19 12:18:15 -0500) edit

might have something to do with my installation. I always have to include my local gem path to openstudio-standards which isn't normal so it might have something to do with that.

Lincoln's avatar Lincoln (2020-07-19 14:02:00 -0500) edit
add a comment see more comments