Skip to content

Commit

Permalink
Fix unit test. Oh so many unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 8, 2023
2 parents 94ce83e + ffff616 commit 41678ea
Show file tree
Hide file tree
Showing 323 changed files with 17,600 additions and 24,240 deletions.
175 changes: 113 additions & 62 deletions doc/input-output-reference/src/input-for-output.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ \subsubsection{Inputs}

\paragraph{Field: Key Field}\label{field-key-field}

For this field there are two choices: \textbf{IDF} and \textbf{regular}. The regular option is the default and produces a listing that shows the type of variable: Zone or HVAC, Average or Sum. ``\textbf{Zone}'' variables are calculated and can be reported after each Zone/Heat Balance timestep (ref: Timesteps input object). ``\textbf{HVAC}'' variables are calculated and can be reported with each variable HVAC timestep. ``\textbf{Average}'' variables will be averaged over the time interval being reported whereas ``\textbf{Sum}'' variables are summed over that time interval. (Meter variables are always summed.) Units for the variable are shown in ``{[}\}''.
For this field there are two choices: \textbf{IDF} and \textbf{regular}. The regular option is the default and produces a listing that shows the type of variable: Zone or HVAC, Average or Sum. ``\textbf{Zone}'' variables are calculated and can be reported after each Zone/Heat Balance timestep (ref: Timesteps input object). ``\textbf{HVAC}'' variables are calculated and can be reported with each variable HVAC timestep. ``\textbf{Average}'' variables will be averaged over the time interval being reported whereas ``\textbf{Sum}'' variables are summed over that time interval. (Meter variables are always summed.) Units for the variable are shown in ``{[} {]}''.

\paragraph{Field: Sort Option}\label{field-sort-option}

Expand Down Expand Up @@ -474,51 +474,98 @@ \subsubsection{Field: Name}\label{field-name-1-036}

% table 38
\begin{longtable}[c]{@{}l@{}}
\caption{Table of Metered Resource Types \label{table:table-of-metered-resource-types}} \tabularnewline
\toprule
Utility/Fuel Types \tabularnewline
\midrule
\endfirsthead

\caption[]{Table of Metered Resource Types} \tabularnewline
\toprule
Utility/Fuel Types \tabularnewline
\midrule
\endhead

Electricity \tabularnewline
NaturalGas \tabularnewline
Gasoline \tabularnewline
Diesel \tabularnewline
Coal \tabularnewline
FuelOilNo1 \tabularnewline
FuelOilNo2 \tabularnewline
Propane \tabularnewline
OtherFuel1 \tabularnewline
OtherFuel2 \tabularnewline
Water \tabularnewline
DistrictCooling \tabularnewline
DistrictHeatingWater \tabularnewline
DistrictHeatingSteam \tabularnewline
ElectricityPurchased \tabularnewline
ElectricitySurplusSold \tabularnewline
ElectricityNet \tabularnewline
\bottomrule
\caption{Table of Metered Resource Types---Fuels \label{table:table-of-metered-resource-types}} \tabularnewline
\toprule
Utility/Fuel Resource Types \tabularnewline
\midrule
\endfirsthead

\caption[]{Table of Metered Resource Types---Fuels \label{table:table-of-metered-resource-types-Fuels}} \tabularnewline
\toprule
Utility/Fuel Resource Types \tabularnewline
\midrule
\endhead

Electricity \tabularnewline
NaturalGas \tabularnewline
Gasoline \tabularnewline
Diesel \tabularnewline
Coal \tabularnewline
FuelOilNo1 \tabularnewline
FuelOilNo2 \tabularnewline
Propane \tabularnewline
OtherFuel1 \tabularnewline
OtherFuel2 \tabularnewline
DistrictCooling \tabularnewline
DistrictHeatingWater \tabularnewline
DistrictHeatingSteam \tabularnewline
Water \tabularnewline
\bottomrule
\end{longtable}

\begin{longtable}[c]{@{}l@{}}
\toprule
Other Resource Types \tabularnewline
\midrule
\endfirsthead

\toprule
Other Resource Types \tabularnewline
\midrule
\endhead

EnergyTransfer \tabularnewline
\bottomrule
\caption{Table of Metered Resource Types---Pollutants \label{table:table-of-metered-resource-types-pollutants}} \tabularnewline
\toprule
Pollutant Resource Types \tabularnewline
\midrule
\endfirsthead

\caption[]{Table of Metered Resource Types---Pollutants} \tabularnewline
\toprule
Pollutant Resource Types \tabularnewline
\midrule
\endhead

SO2 \tabularnewline
NOx \tabularnewline
N2O \tabularnewline
PM \tabularnewline
PM2{\textunderscore}5 \tabularnewline
PM10 \tabularnewline
CO \tabularnewline
CO2 \tabularnewline
CH4 \tabularnewline
NH3 \tabularnewline
NMVOC \tabularnewline
Hg \tabularnewline
Pb \tabularnewline
NuclearHigh \tabularnewline
NuclearLow \tabularnewline
\bottomrule
\end{longtable}

\begin{longtable}[c]{@{}l@{}}
\caption{Table of Metered Resource Types---Others \label{table:table-of-metered-resource-types-others}} \tabularnewline
\toprule
Other Resource Types \tabularnewline
\midrule
\endfirsthead

\caption[]{Table of Metered Resource Types---Others} \tabularnewline
\toprule
Other Resource Types \tabularnewline
\midrule
\endhead

EnergyTransfer \tabularnewline
ElectricityProduced \tabularnewline
ElectricityPurchased \tabularnewline
ElectricitySurplusSold \tabularnewline
ElectricityNet \tabularnewline
SolarWater \tabularnewline
SolarAir \tabularnewline
CarbonEquivalent \tabularnewline
PlantLoopHeatingDemand \tabularnewline
PlantLoopCoolingDemand \tabularnewline
OnSiteWater \tabularnewline
MainsWater \tabularnewline
RainWater \tabularnewline
WellWater \tabularnewline
Condensate \tabularnewline
WaterEnvironmentalFactors \tabularnewline
Source \tabularnewline
Generic \tabularnewline
\bottomrule
\end{longtable}

The end use types are shown in the following table (note that certain end use types apply only to the EnergyTransfer resource):
Expand Down Expand Up @@ -612,7 +659,7 @@ \subsubsection{Field: Name}\label{field-name-1-036}
Building = \sum\limits_1^{NumberOfZones} {Zone} = \sum\limits_1^{NumberOfSpaceTypes} {SpaceType}
\end{equation}

There are also some special purpose meters used to describe electricity resource flows in greater detail.~ Electricity metering is tracked in more detail to accommodate the complexities of onsite electricity generation.~ There are three variations on the electricity resource type including:~ (1) ``ElectrictyPurchased'' which is the quantity of electricity purchased and is always positive, (2) ``ElectricitySold'' which is the quantity of electricity exported by the building, that which is typically ``sold'' back to the power company, and is always positive, and (3) ``ElectricityNet'' which is the net electricity demand considering all sources of onsite generation and demand and can be either positive or negative.
There are also some special purpose meters used to describe electricity resource flows in greater detail.~ Electricity metering is tracked in more detail to accommodate the complexities of onsite electricity generation.~ There are three variations on the electricity resource type including:~ (1) ``ElectrictyProduced'' which is the quantity of electricity generated onsite and is always non-negative (zero or positive), (2) ``ElectrictyPurchased'' which is the quantity of electricity purchased and is always non-negative (zero or positive), (3) ``ElectricitySold'' which is the quantity of electricity exported by the building, that which is typically ``sold'' back to the power company, and is always non-negative (zero or positive), and (4) ``ElectricityNet'' which is the net electricity demand considering all sources of onsite generation and demand and can be either positive or negative (or zero).

\subsubsection{Field: Reporting Frequency}\label{field-reporting-frequency-1}

Expand Down Expand Up @@ -654,24 +701,28 @@ \subsection{Output:EnvironmentalImpactFactors}\label{outputenvironmentalimpactfa
The energy is obtained internally from the following facility meters:

\begin{longtable}[c]{@{}ll@{}}
\toprule
%Electricity:Facility & Diesel:Facility \tabularnewline
%\midrule
%\endfirsthead
%
%\toprule
%Electricity:Facility & Diesel:Facility \tabularnewline
%\midrule
%\endhead
%
Electricity:Facility & Diesel:Facility \tabularnewline
DistrictCooling:Facility & DistrictHeatingWater:Facility \tabularnewline
NaturalGas:Facility & Gasoline:Facility \tabularnewline
Coal:Facility & FuelOilNo1:Facility \tabularnewline
FuelOilNo2:Facility & Propane:Facility \tabularnewline
ElectricityProduced:Facility & Steam:Facility \tabularnewline
OtherFuel1:Facility & OtherFuel2:Facility \tabularnewline
\bottomrule
\caption{Facility Meters \label{table:facility-meters}} \tabularnewline
\toprule
%Electricity:Facility & Diesel:Facility \tabularnewline
Facility Meters & \tabularnewline
\midrule
\endfirsthead

\caption[]{Facility Meters} \tabularnewline
\toprule
%Electricity:Facility & Diesel:Facility \tabularnewline
Facility Meters & \tabularnewline
\midrule
\endhead

Electricity:Facility & Diesel:Facility \tabularnewline
DistrictCooling:Facility & DistrictHeatingWater:Facility \tabularnewline
NaturalGas:Facility & Gasoline:Facility \tabularnewline
Coal:Facility & FuelOilNo1:Facility \tabularnewline
FuelOilNo2:Facility & Propane:Facility \tabularnewline
ElectricityProduced:Facility & DistrictHeatingSteam:Facility \tabularnewline
OtherFuel1:Facility & OtherFuel2:Facility \tabularnewline
\bottomrule
\end{longtable}

For the pollutant calculation only the total off-site or purchased electric energy is calculated using Electricity Factors. Off-Site Electricity = Electricity:Facility - ElectricityProduced:Facility, pollutants for the fuel type used by the on-site generator will be calculated, for example Diesel, in these cases.
Expand Down
6 changes: 5 additions & 1 deletion scripts/dev/check_for_malformed_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def process_enum_str(input_str: str, file_name: str, line_no: int, print_errors:
"CsvParser.hh:Token",
"IdfParser.hh:Token",
"OutputProcessor.hh:ReportingFrequency",
"OutputProcessor.hh:ReportFreqSOV",
"HVACInterfaceManager.cc:UpdateType",
"DataHeatBalance.hh:PERptVars",
]
Expand Down Expand Up @@ -149,7 +150,10 @@ def process_enum_str(input_str: str, file_name: str, line_no: int, print_errors:
# check for proper casing
if str(name[0]).islower():
# exceptions listed by <FILE>:<ENUM NAME>
exceptions = ["DataGlobalConstants.hh:eResource", "DataGlobalConstants.hh:eFuel", "DataGlobalConstants.hh:ePollutant"]
exceptions = [
"DataGlobalConstants.hh:eResource", "DataGlobalConstants.hh:eFuel",
"DataGlobalConstants.hh:ePollutant", "OutputProcessor.hh:eResourceSOV"
]
if f"{file_name}:{name}" not in exceptions:
error_str += "\tenum name must begin with upper case letter\n"

Expand Down
Loading

5 comments on commit 41678ea

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qsort (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qsort (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: Build Failed

Failures:\n

integration Test Summary

  • Passed: 2
  • Failed: 788

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qsort (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 790

regression Test Summary

  • Passed: 801
  • Failed: 5

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qsort (amirroth) - Win64-Windows-10-VisualStudio-16: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 787

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qsort (amirroth) - x86_64-MacOS-10.17-clang-14.0.0: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 787

regression Test Summary

  • Passed: 781
  • Failed: 5

Build Badge Test Badge

Please sign in to comment.