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

PAT Default Inputs "0" for Double Argument #191

Open
craigers290 opened this issue Sep 9, 2021 · 2 comments
Open

PAT Default Inputs "0" for Double Argument #191

craigers290 opened this issue Sep 9, 2021 · 2 comments
Assignees

Comments

@craigers290
Copy link

I am using a measure that includes a Double argument that has special behavior for a blank value. I've set the default within the measure to "" for a blank default.

arg.setDefaultValue("")

However, when it comes into PAT, it shows up as "inputs": { "default_value": 0}. The resulting behavior is that if I delete the "0" value and save in the PAT GUI, the pat.json reflects "inputs": { "default_value": null}. This will effectively pass a blank into the analysis. But, If you navigate away from the Analysis tab and come back PAT places a "0" back in that field and upon saving the default goes back to "0" from "null".

The best workaround is to set "inputs": { "default_value": ""} directly in the pat.json, but we would prefer the measure established default just carry properly into the PAT.

@shorowit
Copy link

When someone works on this, they should check other data types (boolean, integer) for similar behavior.

@labadger
Copy link

Confirmed that this is an issue with other data types inluding integer and boolean (with boolean PAT defaults to 'false' or unchecked, which is fine but not okay for numeric input types). We are working with the BuildResidentialHPXML measure from https://github.com/NREL/OpenStudio-HPXML

In previous versions of the measure, default arguments were set with an auto value. Now the default argument has been removed (see example screenshot comparison). When opened in PAT, the input value defaults to 0 for numeric data types. As noted in the original post, you can delete the zero, in which case the pat.json updates to 'null', but as soon as you navigate away and back again the input value reverts to 0. In this measure, there are many arguments that if left blank will initiate a default calculated value and where 0 would be inappropriate.

BuildResHPXML-default

@tijcolem tijcolem assigned kflemin and unassigned brianlball Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants