Skip to content

Commit

Permalink
Merge branch 'develop' into airloop-hvac-unitary-sys-opmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-robertson committed Jul 12, 2023
2 parents 56a48d1 + 82304dc commit 880f7f1
Show file tree
Hide file tree
Showing 3,916 changed files with 21,432 additions and 101,854 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ e68712c411aed305d984fc20758eebd6c69b44ee
# chore: update copyrights to 2023 [Alex Swindler, 2023-04-07]
529c169a2327d59b201cf8f60be11e612b2a1a8f

# [chore] Update copyrights (maybe for the last time?) [Julien Marrec, 2023-06-06]
c12880d0ee6696d0270e4ea4de8c9d4ae76223fd
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
message(STATUS "Using CMake ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.19.0)
cmake_minimum_required(VERSION 3.20.0)
cmake_policy(SET CMP0048 NEW)

set(CMAKE_CXX_STANDARD 20)
Expand Down Expand Up @@ -206,7 +206,7 @@ set(ENERGYPLUS_REPO "NREL")
set(RADIANCE_VERSION "5.0.a.12")

# configure file with version information
configure_file(${PROJECT_SOURCE_DIR}/OpenStudio.in ${PROJECT_BINARY_DIR}/src/OpenStudio.hxx)
configure_file(${PROJECT_SOURCE_DIR}/OpenStudio.hxx.in ${PROJECT_BINARY_DIR}/src/OpenStudio.hxx)

# Deployment target
if(APPLE)
Expand Down
17 changes: 12 additions & 5 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
Expand All @@ -9,12 +9,19 @@ disclaimer.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided with the distribution.

(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
(3) Redistribution of this software, without modification, must refer to the software by the same designation.
Redistribution of a modified version of this software (i) may not refer to the modified version by the same designation,
or by any confusingly similar designation, and (ii) must refer to the underlying software originally provided by
Alliance as “OpenStudio(R)”. Except to comply with the foregoing, the term “OpenStudio(R)”, or any confusingly similar
designation may not be used to refer to any modified version of this software or any modified version of the underlying
software originally provided by Alliance without the prior written consent of Alliance.

Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
derived from this software without specific prior written permission from the respective party.

(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
written permission from Alliance for Sustainable Energy, LLC.
(4) The name of the copyright holder(s), any contributors, the United States Government, the United States Department
of Energy, or any of their employees may not be used to endorse or promote products derived from this software without
specific prior written permission from the respective party.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
95 changes: 95 additions & 0 deletions OpenStudio.hxx.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#ifndef OPENSTUDIO_HXX
#define OPENSTUDIO_HXX

#include <string>
#include <string_view>

// Support for Ninja on Windows (Ninja isn't multi-configuration while MSVC is)
#cmakedefine NINJA

// Return the version in MAJOR.MINOR.PATCH format (eg '3.0.0')
inline std::string openStudioVersion() {
return "${OPENSTUDIO_VERSION}";
}

// Includes prerelease tag if any, and build sha, eg: '3.0.0-rc1+baflkdhsia'
inline std::string openStudioLongVersion() {
return "${OPENSTUDIO_LONG_VERSION}";
}

inline std::string openStudioVersionMajor() {
return "${PROJECT_VERSION_MAJOR}";
}

inline std::string openStudioVersionMinor() {
return "${PROJECT_VERSION_MINOR}";
}

inline std::string openStudioVersionPatch() {
return "${PROJECT_VERSION_PATCH}";
}

inline std::string openStudioVersionPrerelease() {
return "${PROJECT_VERSION_PRERELEASE}";
}

inline std::string openStudioVersionBuildSHA() {
return "${PROJECT_VERSION_BUILD}";
}

inline int energyPlusVersionMajor() {
return ${ENERGYPLUS_VERSION_MAJOR};
}

inline int energyPlusVersionMinor() {
return ${ENERGYPLUS_VERSION_MINOR};
}

inline int energyPlusVersionPatch() {
return ${ENERGYPLUS_VERSION_PATCH};
}

inline std::string energyPlusVersion() {
return "${ENERGYPLUS_VERSION}";
}

inline std::string energyPlusBuildSHA() {
return "${ENERGYPLUS_BUILD_SHA}";
}

inline std::string rubyLibDir() {
return "${PROJECT_SOURCE_DIR}/ruby/";
}

inline std::string rubyOpenStudioDir() {
#ifdef WIN32
# ifdef NINJA
return "${PROJECT_BINARY_DIR}/ruby/";
# else
return "${PROJECT_BINARY_DIR}/ruby/" + std::string(CMAKE_INTDIR) + "/";
# endif
#else
return "${PROJECT_BINARY_DIR}/ruby/";
#endif
}

namespace openstudio {
namespace detail {

inline constexpr int cx_openStudioVersionMajor() {
return ${PROJECT_VERSION_MAJOR};
}
inline constexpr int cx_openStudioVersionMinor() {
return ${PROJECT_VERSION_MINOR};
}
inline constexpr int cx_openStudioVersionPatch() {
return ${PROJECT_VERSION_PATCH};
}
inline constexpr std::string_view cx_openStudioVersion() {
return "${OPENSTUDIO_VERSION}";
}

} // namespace detail
} // namespace openstudio

#endif // OPENSTUDIO_HXX
89 changes: 0 additions & 89 deletions OpenStudio.in

This file was deleted.

79 changes: 38 additions & 41 deletions ci/colorize_cppcheck_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@

def colorize(lines):
def bold(s):
return '\x1b[1m{}\x1b[0m'.format(s)
return "\x1b[1m{}\x1b[0m".format(s)

def red(s):
return '\x1b[31m{}\x1b[0m'.format(s)
return "\x1b[31m{}\x1b[0m".format(s)

def green(s):
return '\x1b[32m{}\x1b[0m'.format(s)
return "\x1b[32m{}\x1b[0m".format(s)

def yellow(s):
return '\x1b[33m{}\x1b[0m'.format(s)
return "\x1b[33m{}\x1b[0m".format(s)

def blue(s):
return '\x1b[34m{}\x1b[0m'.format(s)
return "\x1b[34m{}\x1b[0m".format(s)

def magenta(s): # purple
return '\x1b[35m{}\x1b[0m'.format(s)
return "\x1b[35m{}\x1b[0m".format(s)

def cyan(s):
return '\x1b[36m{}\x1b[0m'.format(s)
return "\x1b[36m{}\x1b[0m".format(s)

def format_severity(txt, severity):
"""
Expand All @@ -37,7 +37,7 @@ def format_severity(txt, severity):
return red(txt)
if severity == "warning":
return yellow(txt)
if severity == 'style':
if severity == "style":
return blue(txt)
if severity == "performance":
return cyan(txt)
Expand All @@ -50,9 +50,9 @@ def format_severity(txt, severity):

return txt

re_message = re.compile(r'\[(?P<file>.*):(?P<line>.*?)\]:'
r'\((?P<severity>.*?)\),\[(?P<id>.*?)\],'
r'(?P<message>.*)')
re_message = re.compile(
r"\[(?P<file>.*):(?P<line>.*?)\]:" r"\((?P<severity>.*?)\),\[(?P<id>.*?)\]," r"(?P<message>.*)"
)

colored_lines = []
matched_messages = []
Expand All @@ -68,10 +68,9 @@ def format_severity(txt, severity):
else:
colored_lines.append(red(line))

severity_order = ['error', 'warning', 'performance', 'portability',
'style', 'information', 'debug', 'none']
severity_order = ["error", "warning", "performance", "portability", "style", "information", "debug", "none"]

counter = Counter(d['severity'] for d in matched_messages)
counter = Counter(d["severity"] for d in matched_messages)
summary_line = "\n\n==========================================\n"
summary_line += " {}:\n".format(bold(red("CPPCHECK Summary")))
summary_line += "------------------------------------------"
Expand All @@ -88,61 +87,59 @@ def format_severity(txt, severity):

summary_line += "\n==========================================\n\n"

n_errors = counter['error']
n_errors = counter["error"]
# if n_errors:
# summary_line += red("{} Errors".format(n_errors))
# else:
# summary_line = green("No Errors")

n_warnings = counter['warning']
n_warnings = counter["warning"]
# if n_warnings:
# summary_line += yellow("{} Warnings".format(n_warnings))
# else:
# summary_line = green("No Warnings")

n_styles = counter['style']
n_performances = counter['performance']
n_portabilities = counter['portability']
n_styles = counter["style"]
n_performances = counter["performance"]
n_portabilities = counter["portability"]
# n_informations = counter['information']

# n_debugs = counter['debug']

# Start by sorting by filename
matched_messages.sort(key=lambda d: d['file'])
matched_messages.sort(key=lambda d: severity_order.index(d['severity']))
matched_messages.sort(key=lambda d: d["file"])
matched_messages.sort(key=lambda d: severity_order.index(d["severity"]))

# Now sort by the severity we cared about
for d in matched_messages:

f = d['file']
line = d['line']
severity = d['severity']
iid = d['id']
message = d['message']
f = d["file"]
line = d["line"]
severity = d["severity"]
iid = d["id"]
message = d["message"]

colored_lines.append(
"[{f}:{line}]:({severity}),[{i}],{message}"
.format(f=magenta(f), # format_severity(f, severity),
line=green(line),
severity=format_severity(severity, severity),
i=bold(iid),
message=message))
"[{f}:{line}]:({severity}),[{i}],{message}".format(
f=magenta(f), # format_severity(f, severity),
line=green(line),
severity=format_severity(severity, severity),
i=bold(iid),
message=message,
)
)

return (colored_lines, summary_line, n_errors, n_warnings,
n_performances, n_portabilities, n_styles)
return (colored_lines, summary_line, n_errors, n_warnings, n_performances, n_portabilities, n_styles)


if __name__ == '__main__':
with open('cppcheck.txt', 'r') as f:
if __name__ == "__main__":
with open("cppcheck.txt", "r") as f:
content = f.read()

lines = content.splitlines()
(colored_lines, summary_line, n_errors, n_warnings,
n_performances, n_portabilities, n_styles) = colorize(lines)
(colored_lines, summary_line, n_errors, n_warnings, n_performances, n_portabilities, n_styles) = colorize(lines)
print(summary_line)
# sys.stdout.writelines(colored_lines)
print("\n".join(colored_lines))
n_tot = (n_errors + n_warnings + n_performances
+ n_portabilities + n_styles)
n_tot = n_errors + n_warnings + n_performances + n_portabilities + n_styles
if n_tot > 0:
exit(1)
Loading

0 comments on commit 880f7f1

Please sign in to comment.