Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into Add…
Browse files Browse the repository at this point in the history
…ThreeSteamModulesWithNTUMethod
  • Loading branch information
dareumnam committed Jul 21, 2023
2 parents 8dce206 + b7a30cf commit c592653
Show file tree
Hide file tree
Showing 240 changed files with 18,126 additions and 11,411 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/epjson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: epJSON dependency

on:
push

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_TYPE: Release

jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Setup
shell: bash
run: |
cmake -E make_directory ./build/
if [ "$RUNNER_OS" == "Windows" ]; then
echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 17 2022\" -A x64'"
echo CMAKE_GENERATOR='Visual Studio 17 2022' >> $GITHUB_ENV
echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV
choco install ninja
fi;
- name: Configure CMake
working-directory: ./build
run: |
cmake ../
- name: Test epjson
shell: python
run: |
from pathlib import Path
import subprocess
EP_ROOT = Path(".").resolve()
EP_BUILD_DIR = Path('./build').resolve()
EXPECTED_MSGS = ["Generating the epJSON schema!", "Generating the **embedded** epJSON schema"]
def build():
lines = subprocess.check_output(
[
"cmake",
"--build",
str(EP_BUILD_DIR),
"--config",
"Release",
"--target",
"embedded_epjson_source",
],
encoding="utf-8",
stderr=subprocess.STDOUT,
).splitlines()
return lines
IDD_IN = EP_ROOT / "idd/Energy+.idd.in"
assert IDD_IN.exists()
def ensure_target_built(lines, msg):
breakpoint
lines = [x.strip() for x in lines if "epJSON schema" in x]
errors = []
for expected_msg in EXPECTED_MSGS:
n = lines.count(expected_msg)
if n != 1:
errors.append(f"Expected 1 occurrence of '{expected_msg}', got {n}")
assert not errors, "\n -" + "\n -".join(errors)
# Build: first time: we get both
lines = build()
ensure_target_built(lines, "Failed on first build")
# Insert a fake IDD change, we should also get both
with open(IDD_IN, "r") as f:
lines = f.read().splitlines()
ori_lines = lines.copy()
for i, line in enumerate(lines):
if line.startswith(r"\group"):
lines.insert(i + 1, "")
lines.insert(i + 2, "FakeObject,")
lines.insert(i + 3, r" A1; \field Name")
break
with open(IDD_IN, "w") as f:
f.write("\n".join(lines) + "\n")
lines = build()
ensure_target_built(lines, "Failed after IDD change")
with open(IDD_IN, "w") as f:
f.write("\n".join(ori_lines) + "\n")
lines = build()
ensure_target_built(lines, "Failed after IDD change revert")
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 3.17)

# Use ccache if available, has to be before "project()"
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
Expand All @@ -9,8 +11,6 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables

project(EnergyPlus)

cmake_minimum_required(VERSION 3.17)

if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
cmake_policy(SET CMP0054 NEW) # CMake 3.1 added this policy
endif()
Expand Down Expand Up @@ -283,9 +283,6 @@ target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third
target_include_directories(project_options INTERFACE "${kiva_BINARY_DIR}/src/libkiva")
target_include_directories(project_options SYSTEM INTERFACE "${kiva_SOURCE_DIR}/vendor/boost-1.61.0/")

add_subdirectory(scripts/dev/generate_embeddable_epJSON_schema)
set_target_properties(generate_embeddable_epJSON_schema PROPERTIES FOLDER "Internal")

target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP)
target_include_directories(project_options INTERFACE ${PROJECT_SOURCE_DIR}/third_party/cpgfunctionEP/include)

Expand Down Expand Up @@ -361,9 +358,9 @@ if(BUILD_FORTRAN)
PROJECT Transition
CMAKE_COMMAND_LINE ${TRANSITION_EXTRA_FLAGS}
NO_EXTERNAL_INSTALL)
file(COPY "idd/V23-1-0-Energy+.idd" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V23-2-0-Energy+.idd")
file(COPY "src/Transition/SupportFiles/Report Variables 23-1-0 to 23-2-0.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
file(COPY "${PREVIOUS_IDD}" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
configure_file(idd/Energy+.idd.in "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")
file(COPY "src/Transition/SupportFiles/Report Variables ${PREV_RELEASE_MAJOR}-${PREV_RELEASE_MINOR}-${PREV_RELEASE_PATCH} to ${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}.csv" DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
cmake_add_fortran_subdirectory(
src/Basement
PROJECT Basement
Expand Down
3 changes: 1 addition & 2 deletions cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ set(CPACK_RESOURCE_FILE_README "${PROJECT_BINARY_DIR}/release/readme.html")

install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/IceStorageCurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/bin/CurveFitTools/CurveFitTool.xlsm" DESTINATION "PreProcess/HVACCurveFitTool/")
install(FILES "${PROJECT_SOURCE_DIR}/idd/V23-1-0-Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V23-2-0-Energy+.idd")
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Energy+.idd" DESTINATION "PreProcess/IDFVersionUpdater/" RENAME "V${CMAKE_VERSION_MAJOR}-${CMAKE_VERSION_MINOR}-${CMAKE_VERSION_PATCH}-Energy+.idd")

# Workflow stuff, takes about 40KB, so not worth it proposing to not install it
install(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/workflows/app_g_postprocess.py" DESTINATION "workflows/") # COMPONENT Workflows)
Expand Down
Loading

5 comments on commit c592653

@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.

AddThreeSteamModulesWithNTUMethod (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

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.

AddThreeSteamModulesWithNTUMethod (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: Build Failed

Failures:\n

integration Test Summary

  • Passed: 2
  • Failed: 778

Build Badge Test Badge Coverage 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.

AddThreeSteamModulesWithNTUMethod (dareumnam) - Win64-Windows-10-VisualStudio-16: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 777

Build Badge Test 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.

AddThreeSteamModulesWithNTUMethod (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 780

regression Test Summary

  • Passed: 792
  • Failed: 4

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.

AddThreeSteamModulesWithNTUMethod (dareumnam) - x86_64-MacOS-10.17-clang-13.0.0: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 777

regression Test Summary

  • Passed: 772
  • Failed: 4

Build Badge Test Badge

Please sign in to comment.