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
495 stars 190 forks source link

Calibration Report Does Not Show Up #778

Closed asparke2 closed 10 years ago

asparke2 commented 10 years ago

When there is a zero in one of the energy consumption or energy demands fields in a utility bill in a project, the NMBE is calculated as "Inf" (0/X) which is not valid Javascript (I believe the correct notation is "Infinity." The browser throws a javascript error when "Inf" is encountered and cannot render any of the bar charts.

In the app, this means you are unable to do calibration.

Here is the offending section of the report that does not validate:

        "Electricity Demand Consumption":{
        "units":"kWh",
        "cvrsme":"94.01",
        "nmbe":"89.99",
            "data":{
                "Start":["1/1","2/1","3/1","4/1","5/1","6/1","7/1","8/1","10/1","11/1","12/1"],
                "End":["1/31","2/28","3/31","4/30","5/31","6/30","7/31","8/31","10/31","11/30","12/31"],
                "Actual":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
                "Model":[6,6,6,6,6,6,6,6,6,6,6],
                "NMBE":[Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf,Inf]
        }
    },

I have an example report.xml that you can look at to debug.

asparke2 commented 10 years ago

@evanweaver Just going through the P1 bugs and checking validity. It appears that a fix may have been put in for Electricity and Gas Consumption, but still exists for Electricity Demand.

"Electricity Demand":{
"units":"kW",
"cvrsme":"139.11",
"nmbe":"-116.17",
"data":{
"Start":["1/1","2/1","3/1","4/1","5/1","6/1","7/1","8/1","9/1","10/1","11/1","12/1"],
"End":["1/31","2/28","3/31","4/30","5/31","6/30","7/31","8/31","9/30","10/31","11/30","12/31"],
"Actual":[0.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,1.0],
"Model":[183.8,185.9,122.1,123.0,130.5,129.8,142.4,138.4,135.1,136.4,129.5,170.6],
"NMBE":[Inf,0,Inf,0,0,12877.33,14135.72,0,0,13536.91,Inf,16955.24]
} 

To reproduce:

  1. Make a model with an Electric Utility Bill
  2. Add some billing periods
  3. Put zeros in the Peak fields
evanweaver commented 10 years ago

The following pull request will fix this issue: https://github.com/NREL/OpenStudio-measures/pull/45

evanweaver commented 10 years ago

@asparke2 would you mind closing this? It was fixed by the above pull request which Dan accepted.