Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ghe-borehole-top-d…
Browse files Browse the repository at this point in the history
…epth and resolve conflicts
  • Loading branch information
jmarrec committed Dec 23, 2024
2 parents 9d64254 + 6f293ed commit b3d1330
Show file tree
Hide file tree
Showing 109 changed files with 2,037 additions and 581 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,9 @@ e68712c411aed305d984fc20758eebd6c69b44ee

# [chore] Update copyrights (maybe for the last time?) [Julien Marrec, 2023-06-06]
c12880d0ee6696d0270e4ea4de8c9d4ae76223fd

# [chore] Commit clang-format autocorrects [github-lint-actions[bot], 2024-12-19]
b3d2e94e3ae1160f447af2035a1ffabaec4b3423

# [chore] Commit clang-format autocorrects [github-lint-actions[bot], 2024-12-19]
77309e0db461ce64a0cca1e1a0f2bbda29ff7a66
45 changes: 45 additions & 0 deletions .github/workflows/clangformat.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,71 @@
name: Clang Format

on:
push:
branches: [ master, develop, clang-format ]
pull_request:
branches: [ master, develop ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Needed to push a commit

steps:
- uses: actions/checkout@v4

- name: Run clang-format against C++ files touched by the PR
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
echo "GITHUB_REF=$GITHUB_REF GITHUB_BASE_REF=$GITHUB_BASE_REF GITHUB_HEAD_REF=$GITHUB_HEAD_REF"
git fetch --all
clang-format --version
./ci/clang-format.sh remotes/origin/$GITHUB_HEAD_REF remotes/origin/$GITHUB_BASE_REF
- name: Run clang-format for entire codebase
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
clang-format --version
find . \( -name "*.hpp" -o -name "*.h" -o -name "*.hh" -o -name "*.cc" -o -name "*.cpp" -o -name "*.c" \) | xargs -P $(nproc) -I '{}' clang-format -style=file -i -fallback-style=none "{}"
# clang-format will auto correct files so prepare the diff and use this as artifact
git diff > clang_format.patch
# Delete if nothing otherwise exit 1 to indicate a failed job
if [ ! -s clang_format.patch ]; then
rm clang_format.patch
exit 0
else
echo "clang-format auto corrected files:"
git diff --name-only
echo -e "\nPlease correct these files. You can run ci/clang-format.sh locally and commit changes"
exit 1
fi
- name: Upload clang-format patch as artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: OpenStudio-${{ github.sha }}-clang_format.patch
path: clang_format.patch

- name: Commit Auto-corrections
shell: bash
if: ${{ always() && github.event_name == 'push' }}
run: |
git add -u
if [[ $(git diff --cached --exit-code) ]]; then
echo "Commiting Lint Autocorrects"
git config --global user.email 'github-lint-actions[bot]@users.noreply.github.com'
git config --global user.name 'github-lint-actions[bot]'
git commit -m "[chore] Commit clang-format autocorrects"
echo '' >> .git-blame-ignore-revs
git log -n1 --pretty='format:# %C(auto)%s [%an, %as]%n%H%n' >> .git-blame-ignore-revs
git add .git-blame-ignore-revs
git commit -m "Add clang-format autocorrects to git-blame-ignore-revs"
git push
else
echo "No Autocorrect needed"
fi
2 changes: 1 addition & 1 deletion python/engine/PythonEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int PythonEngine::numberOfArguments(ScriptObject& methodObject, std::string_view
}
} else if (PyFunction_Check(method)) {
// Shouldn't enter this block here
if (auto * code = PyFunction_GetCode(method)) {
if (auto* code = PyFunction_GetCode(method)) {
// cppcheck-suppress cstyleCast
const auto* co = (PyCodeObject*)code;
numberOfArguments = co->co_argcount;
Expand Down
58 changes: 57 additions & 1 deletion resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -31706,7 +31706,16 @@ OS:WaterHeater:HeatPump,
\note A schedule value of 1 denotes inlet air is drawn only from outdoors.
\note Schedule values between 0 and 1 denote a mixture of zone and outdoor air
\note proportional to the schedule value.
A19; \field Control Sensor Location In Stratified Tank
A19, \field Tank Element Control Logic
\type choice
\key MutuallyExclusive
\key Simultaneous
\required-field
\note MutuallyExclusive means that once the tank heating element is active the
\note heat pump is shut down until setpoint is reached.
\note Simultaneous (default) means that both the tank heating element and
\note heat pump are used at the same time recover the tank temperature.
A20; \field Control Sensor Location In Stratified Tank
\note Used to indicate height of control sensor if Tank Object Type is WaterHeater:Stratified
\type choice
\key Heater1
Expand Down Expand Up @@ -38665,6 +38674,53 @@ OS:EnergyManagementSystem:ConstructionIndexVariable,

\group Python Plugin System

OS:PythonPlugin:SearchPaths,
\memo Add directories to the search path for Python plugin modules
\memo The directory containing the EnergyPlus executable file is
\memo automatically added so that the Python interpreter can find the
\memo packaged up pyenergyplus Python package.
\memo By default, the current working directory and input file directory
\memo are also added to the search path. However, this object allows
\memo modifying this behavior. With this object, searching these directories
\memo can be disabled, and users can add supplemental search paths
\memo that point to libraries of plugin scripts.
\unique-object
\min-fields 3
\extensible:1
A1, \field Handle
\type handle
\required-field
A2, \field Add Current Working Directory to Search Path
\note Adding the current working directory allows Python to find
\note plugin scripts in the current directory.
\note required-field disabled as it has a default
\type choice
\key Yes
\key No
\required-field
A3, \field Add Input File Directory to Search Path
\note Enabling this will allow Python to find plugin scripts in the
\note same directory as the running input file, even if that is not
\note the current working directory.
\note required-field disabled as it has a default
\type choice
\key Yes
\key No
\required-field
A4, \field Add epin Environment Variable to Search Path
\note The "epin" environment variable is set by some EnergyPlus interfaces
\note in order to let EnergyPlus find external files in special locations.
\note If this is enabled, and that variable is set, the value of the variable
\note will be added to the Python search path.
\type choice
\key Yes
\key No
\required-field
A5; \field Search Path 1
\type alpha
\begin-extensible
\retaincase

OS:PythonPlugin:Instance,
\memo A single plugin to be executed during the simulation, which can contain multiple calling points
\memo for the same class instance by overriding multiple calling point methods.
Expand Down
Loading

0 comments on commit b3d1330

Please sign in to comment.