From 6032f7295ce1bb9898e04f8676620071c4fc9133 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 14:51:53 +0200 Subject: [PATCH 01/19] changed to ubuntu 24.04 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/check-code-quality.yml | 2 +- .github/workflows/citations.yml | 2 +- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/dco-merge-group.yml | 2 +- .github/workflows/main.yml | 12 ++++++------ .github/workflows/reuse-compliance.yml | 2 +- .github/workflows/sonar.yml | 2 +- .readthedocs.yaml | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index af2918650..df3249f5f 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -29,7 +29,7 @@ concurrency: jobs: check-code-quality: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout diff --git a/.github/workflows/citations.yml b/.github/workflows/citations.yml index ed4afb693..53bf58602 100644 --- a/.github/workflows/citations.yml +++ b/.github/workflows/citations.yml @@ -27,7 +27,7 @@ concurrency: jobs: validate-citations: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v4 diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index ce3506df2..649eb2975 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -44,7 +44,7 @@ concurrency: jobs: clang-tidy: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: build-option: [ debug, release ] diff --git a/.github/workflows/dco-merge-group.yml b/.github/workflows/dco-merge-group.yml index 6b4ab946d..434d7fd45 100644 --- a/.github/workflows/dco-merge-group.yml +++ b/.github/workflows/dco-merge-group.yml @@ -14,7 +14,7 @@ on: jobs: dco-merge-group: name: DCO - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: ${{ github.actor != 'dependabot[bot]' }} steps: - name: "Workaround for DCO on merge groups" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8eb508230..dad9d4c0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: acquire-python-version-build-sdist: name: Build sdist and set version - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -69,7 +69,7 @@ jobs: path: ./wheelhouse/*.tar.gz build-cpp-test-linux: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: build-option: [ debug, release ] @@ -185,10 +185,10 @@ jobs: platform: [ linux-x64, linux-aarch64, macos, windows ] include: - platform: linux-x64 - os: ubuntu-latest + os: ubuntu-24.04 cibw_build: "*_x86_64" - platform: linux-aarch64 - os: ubuntu-latest + os: ubuntu-24.04 cibw_build: "*_aarch64" - platform: macos os: macos-14 @@ -209,7 +209,7 @@ jobs: path: . - name: Set up QEMU - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-24.04' uses: docker/setup-qemu-action@v3 - name: Set up XCode @@ -268,7 +268,7 @@ jobs: needs: [build-cpp-test-linux, build-cpp-test-windows, build-cpp-test-macos, build-and-test-python, build-and-test-conda] # always run publish job but fail at the first step if previous jobs have been failed if: always() - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: write env: diff --git a/.github/workflows/reuse-compliance.yml b/.github/workflows/reuse-compliance.yml index a2830340a..8b88c80da 100644 --- a/.github/workflows/reuse-compliance.yml +++ b/.github/workflows/reuse-compliance.yml @@ -24,7 +24,7 @@ concurrency: jobs: reuse-compliance-check: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 146fd86df..a114ae98a 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -22,7 +22,7 @@ jobs: sonar-cloud: if: (github.event_name == 'push') || (!startsWith(github.head_ref, 'release')) name: SonarCloud - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2b233696d..d24415410 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ sphinx: configuration: docs/conf.py build: - os: "ubuntu-22.04" + os: "ubuntu-24.04" tools: python: "3.11" jobs: From 37bad1f775013d63285ad2328f5bce6b1c125738 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 15:21:30 +0200 Subject: [PATCH 02/19] clang 18 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/check-code-quality.yml | 4 ++-- .github/workflows/clang-tidy.yml | 8 ++++---- .github/workflows/main.yml | 6 +++--- .github/workflows/sonar.yml | 6 +++--- .pre-commit-config.yaml | 2 +- docs/advanced_documentation/build-guide.md | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index df3249f5f..48f38f90b 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -66,8 +66,8 @@ jobs: - name: Install and run clang-format run: | - sudo apt-get update && sudo apt-get install -y clang-format-15 - find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-15 -style=file -i {} \; + sudo apt-get update && sudo apt-get install -y clang-format-18 + find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-18 -style=file -i {} \; - name: If needed raise error run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 649eb2975..91a85d3bf 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -60,10 +60,10 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-15 clang-tidy-15 - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ - sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy + sudo apt-get install -y ninja-build clang-18 clang-tidy-18 + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy - name: Enable brew run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dad9d4c0e..7647f4fad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,9 +87,9 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-12 g++-12 clang-15 - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index a114ae98a..9ef830f2d 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -34,9 +34,9 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-15 lcov gcovr - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo apt-get install -y ninja-build clang-18 lcov gcovr + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - name: Enable brew run: | echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eef0d09da..d512e5c18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: pass_filenames: false always_run: true - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v15.0.7 + rev: v18.1.3 hooks: - id: clang-format types_or: [ c++, c ] diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index b4d0958d3..88d1e36e6 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -207,11 +207,11 @@ WSL), or in a physical/virtual machine. Append the following lines into the file `${HOME}/.bashrc`. ```shell -export CXX=clang++-15 # or g++-13 -export CC=clang-15 # gcc-13 +export CXX=clang++-18 # or g++-13 +export CC=clang-18 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew export LLVM_COV=llvm-cov-15 -export CLANG_TIDY=clang-tidy-15 # only if you want to use one of the clang-tidy presets +export CLANG_TIDY=clang-tidy-18 # only if you want to use one of the clang-tidy presets ``` ### Ubuntu Software Packages @@ -220,7 +220,7 @@ Install the following packages from Ubuntu. ```shell sudo apt update && sudo apt -y upgrade -sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-15 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip +sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-18 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip ``` ### C++ packages From 07a54a603f26ea0d77646a313a306a110cf3c2ad Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 15:28:32 +0200 Subject: [PATCH 03/19] gcc/g++ 13 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7647f4fad..1d3acb040 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,11 +87,11 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 + sudo apt-get install -y ninja-build gcc-13 g++-13 clang-18 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc - sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ + sudo ln -s /usr/bin/gcc-13 /usr/local/bin/gcc + sudo ln -s /usr/bin/g++-13 /usr/local/bin/g++ - name: Enable brew run: | From 6b70c04af5ae8f1ef3f9fa213b60c3e3576befff Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 15:33:49 +0200 Subject: [PATCH 04/19] python 3.12 and llvm 18 Signed-off-by: Santiago Figueroa Manrique --- .github/conda_pgm_env.yml | 2 +- .github/workflows/check-code-quality.yml | 2 +- .github/workflows/main.yml | 4 ++-- .github/workflows/sonar.yml | 4 ++-- .readthedocs.yaml | 2 +- docs/advanced_documentation/build-guide.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/conda_pgm_env.yml b/.github/conda_pgm_env.yml index 4520cd90a..652a7b3b5 100644 --- a/.github/conda_pgm_env.yml +++ b/.github/conda_pgm_env.yml @@ -5,7 +5,7 @@ name: conda-pgm-env dependencies: # build env - - python=3.11 + - python=3.12 - pip - wheel - setuptools diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index 48f38f90b..152bb0ff4 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -38,7 +38,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Upgrade pip run: pip install --upgrade pip diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d3acb040..d736c4885 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Set PyPI Version run: | @@ -287,7 +287,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' architecture: x64 - uses: actions/download-artifact@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 9ef830f2d..25c3f46cd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,7 +26,7 @@ jobs: env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew - LLVM_COV: llvm-cov-15 + LLVM_COV: llvm-cov-18 steps: - uses: actions/checkout@v4 with: @@ -46,7 +46,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d24415410..72c051c36 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,7 +11,7 @@ sphinx: build: os: "ubuntu-24.04" tools: - python: "3.11" + python: "3.12" jobs: post_install: # Build package with doc requirements from pyproject.optional-dependencies diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index 88d1e36e6..44f330872 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -210,7 +210,7 @@ Append the following lines into the file `${HOME}/.bashrc`. export CXX=clang++-18 # or g++-13 export CC=clang-18 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew -export LLVM_COV=llvm-cov-15 +export LLVM_COV=llvm-cov-18 export CLANG_TIDY=clang-tidy-18 # only if you want to use one of the clang-tidy presets ``` From 3b9cd723b8d995f35652999050e7d8fef29fd36e Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 16:53:08 +0200 Subject: [PATCH 05/19] Revert "python 3.12 and llvm 18" This reverts commit 6b70c04af5ae8f1ef3f9fa213b60c3e3576befff. Signed-off-by: Santiago Figueroa Manrique --- .github/conda_pgm_env.yml | 2 +- .github/workflows/check-code-quality.yml | 2 +- .github/workflows/main.yml | 4 ++-- .github/workflows/sonar.yml | 4 ++-- .readthedocs.yaml | 2 +- docs/advanced_documentation/build-guide.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/conda_pgm_env.yml b/.github/conda_pgm_env.yml index 652a7b3b5..4520cd90a 100644 --- a/.github/conda_pgm_env.yml +++ b/.github/conda_pgm_env.yml @@ -5,7 +5,7 @@ name: conda-pgm-env dependencies: # build env - - python=3.12 + - python=3.11 - pip - wheel - setuptools diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index 152bb0ff4..48f38f90b 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -38,7 +38,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.10' - name: Upgrade pip run: pip install --upgrade pip diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d736c4885..1d3acb040 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.11" - name: Set PyPI Version run: | @@ -287,7 +287,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: '3.10' architecture: x64 - uses: actions/download-artifact@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 25c3f46cd..9ef830f2d 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,7 +26,7 @@ jobs: env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew - LLVM_COV: llvm-cov-18 + LLVM_COV: llvm-cov-15 steps: - uses: actions/checkout@v4 with: @@ -46,7 +46,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.10" - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 72c051c36..d24415410 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,7 +11,7 @@ sphinx: build: os: "ubuntu-24.04" tools: - python: "3.12" + python: "3.11" jobs: post_install: # Build package with doc requirements from pyproject.optional-dependencies diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index 44f330872..88d1e36e6 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -210,7 +210,7 @@ Append the following lines into the file `${HOME}/.bashrc`. export CXX=clang++-18 # or g++-13 export CC=clang-18 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew -export LLVM_COV=llvm-cov-18 +export LLVM_COV=llvm-cov-15 export CLANG_TIDY=clang-tidy-18 # only if you want to use one of the clang-tidy presets ``` From 669ad2f1f3f6ab62396b2354761d9ac304727213 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 16:53:44 +0200 Subject: [PATCH 06/19] Revert "gcc/g++ 13" This reverts commit 07a54a603f26ea0d77646a313a306a110cf3c2ad. Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d3acb040..7647f4fad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,11 +87,11 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-13 g++-13 clang-18 + sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - sudo ln -s /usr/bin/gcc-13 /usr/local/bin/gcc - sudo ln -s /usr/bin/g++-13 /usr/local/bin/g++ + sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc + sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ - name: Enable brew run: | From ca332032610db2d0a16094e40821d09b8e9520da Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Oct 2024 16:53:55 +0200 Subject: [PATCH 07/19] Revert "clang 18" This reverts commit 37bad1f775013d63285ad2328f5bce6b1c125738. Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/check-code-quality.yml | 4 ++-- .github/workflows/clang-tidy.yml | 8 ++++---- .github/workflows/main.yml | 6 +++--- .github/workflows/sonar.yml | 6 +++--- .pre-commit-config.yaml | 2 +- docs/advanced_documentation/build-guide.md | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index 48f38f90b..df3249f5f 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -66,8 +66,8 @@ jobs: - name: Install and run clang-format run: | - sudo apt-get update && sudo apt-get install -y clang-format-18 - find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-18 -style=file -i {} \; + sudo apt-get update && sudo apt-get install -y clang-format-15 + find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-15 -style=file -i {} \; - name: If needed raise error run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 91a85d3bf..649eb2975 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -60,10 +60,10 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-18 clang-tidy-18 - sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - sudo ln -s /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy + sudo apt-get install -y ninja-build clang-15 clang-tidy-15 + sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy - name: Enable brew run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7647f4fad..dad9d4c0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,9 +87,9 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 - sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ + sudo apt-get install -y ninja-build gcc-12 g++-12 clang-15 + sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 9ef830f2d..a114ae98a 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -34,9 +34,9 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-18 lcov gcovr - sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ + sudo apt-get install -y ninja-build clang-15 lcov gcovr + sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ - name: Enable brew run: | echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d512e5c18..eef0d09da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: pass_filenames: false always_run: true - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.3 + rev: v15.0.7 hooks: - id: clang-format types_or: [ c++, c ] diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index 88d1e36e6..b4d0958d3 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -207,11 +207,11 @@ WSL), or in a physical/virtual machine. Append the following lines into the file `${HOME}/.bashrc`. ```shell -export CXX=clang++-18 # or g++-13 -export CC=clang-18 # gcc-13 +export CXX=clang++-15 # or g++-13 +export CC=clang-15 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew export LLVM_COV=llvm-cov-15 -export CLANG_TIDY=clang-tidy-18 # only if you want to use one of the clang-tidy presets +export CLANG_TIDY=clang-tidy-15 # only if you want to use one of the clang-tidy presets ``` ### Ubuntu Software Packages @@ -220,7 +220,7 @@ Install the following packages from Ubuntu. ```shell sudo apt update && sudo apt -y upgrade -sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-18 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip +sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-15 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip ``` ### C++ packages From c6ad3e055767553e3d27198bb8e64c3d6c7a14bf Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 09:49:53 +0200 Subject: [PATCH 08/19] Fixed ubuntu version Signed-off-by: Santiago Figueroa Manrique --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d24415410..2b233696d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ sphinx: configuration: docs/conf.py build: - os: "ubuntu-24.04" + os: "ubuntu-22.04" tools: python: "3.11" jobs: From ee5afd14d0aa55c4cf2582004ce72cfcdaa3466e Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 09:57:53 +0200 Subject: [PATCH 09/19] added clang 18 only Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/clang-tidy.yml | 4 ++-- .github/workflows/main.yml | 4 ++-- .github/workflows/sonar.yml | 4 ++-- docs/advanced_documentation/build-guide.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 649eb2975..f61631194 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -60,8 +60,8 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-15 clang-tidy-15 - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo apt-get install -y ninja-build clang-18 clang-tidy-15 + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dad9d4c0e..cf94ad56d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,8 +87,8 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-12 g++-12 clang-15 - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index a114ae98a..6bede2b82 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -34,8 +34,8 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-15 lcov gcovr - sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo apt-get install -y ninja-build clang-18 lcov gcovr + sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ - name: Enable brew run: | diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index b4d0958d3..cdcfa04fd 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -207,8 +207,8 @@ WSL), or in a physical/virtual machine. Append the following lines into the file `${HOME}/.bashrc`. ```shell -export CXX=clang++-15 # or g++-13 -export CC=clang-15 # gcc-13 +export CXX=clang++-18 # or g++-13 +export CC=clang-18 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew export LLVM_COV=llvm-cov-15 export CLANG_TIDY=clang-tidy-15 # only if you want to use one of the clang-tidy presets @@ -220,7 +220,7 @@ Install the following packages from Ubuntu. ```shell sudo apt update && sudo apt -y upgrade -sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-15 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip +sudo apt install -y wget curl zip unzip tar git build-essential gcovr lcov gcc g++ clang-18 make gdb ninja-build pkg-config python3.10 python3.10-dev python3.10-venv python3-pip ``` ### C++ packages From 6f6b03b028f74f0e3187360fd63217c774ce9a09 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 10:00:26 +0200 Subject: [PATCH 10/19] llvm 18 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/sonar.yml | 2 +- docs/advanced_documentation/build-guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 6bede2b82..857b8d1bb 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -26,7 +26,7 @@ jobs: env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew - LLVM_COV: llvm-cov-15 + LLVM_COV: llvm-cov-18 steps: - uses: actions/checkout@v4 with: diff --git a/docs/advanced_documentation/build-guide.md b/docs/advanced_documentation/build-guide.md index cdcfa04fd..9b3db6a25 100644 --- a/docs/advanced_documentation/build-guide.md +++ b/docs/advanced_documentation/build-guide.md @@ -210,7 +210,7 @@ Append the following lines into the file `${HOME}/.bashrc`. export CXX=clang++-18 # or g++-13 export CC=clang-18 # gcc-13 export CMAKE_PREFIX_PATH=/home/linuxbrew/.linuxbrew -export LLVM_COV=llvm-cov-15 +export LLVM_COV=llvm-cov-18 export CLANG_TIDY=clang-tidy-15 # only if you want to use one of the clang-tidy presets ``` From 63b0b5c6c1f04752630a0565199ad87488b2dbc5 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 10:02:50 +0200 Subject: [PATCH 11/19] gcc 13 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf94ad56d..cdf1f68dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,11 +87,11 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build gcc-12 g++-12 clang-18 + sudo apt-get install -y ninja-build gcc-13 g++-13 clang-18 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ - sudo ln -s /usr/bin/gcc-12 /usr/local/bin/gcc - sudo ln -s /usr/bin/g++-12 /usr/local/bin/g++ + sudo ln -s /usr/bin/gcc-13 /usr/local/bin/gcc + sudo ln -s /usr/bin/g++-13 /usr/local/bin/g++ - name: Enable brew run: | From 447a8c1a7caf250f762c57515be09b5c4333e20b Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 10:05:38 +0200 Subject: [PATCH 12/19] python 3.12 Signed-off-by: Santiago Figueroa Manrique --- .github/conda_pgm_env.yml | 2 +- .github/workflows/check-code-quality.yml | 2 +- .github/workflows/main.yml | 4 ++-- .github/workflows/sonar.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/conda_pgm_env.yml b/.github/conda_pgm_env.yml index 4520cd90a..652a7b3b5 100644 --- a/.github/conda_pgm_env.yml +++ b/.github/conda_pgm_env.yml @@ -5,7 +5,7 @@ name: conda-pgm-env dependencies: # build env - - python=3.11 + - python=3.12 - pip - wheel - setuptools diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index df3249f5f..014058f14 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -38,7 +38,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Upgrade pip run: pip install --upgrade pip diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cdf1f68dd..58b177148 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" - name: Set PyPI Version run: | @@ -287,7 +287,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' architecture: x64 - uses: actions/download-artifact@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 857b8d1bb..60aef8bdd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -46,7 +46,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 From 3c297e17e00ecf2c83bb5193143386ccdd93348d Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 10:15:37 +0200 Subject: [PATCH 13/19] clang++18 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/sonar.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index f61631194..cba054fc5 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -62,7 +62,7 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build clang-18 clang-tidy-15 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy - name: Enable brew diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58b177148..d736c4885 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build gcc-13 g++-13 clang-18 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ sudo ln -s /usr/bin/gcc-13 /usr/local/bin/gcc sudo ln -s /usr/bin/g++-13 /usr/local/bin/g++ diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 60aef8bdd..25c3f46cd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -36,7 +36,7 @@ jobs: sudo apt-get update sudo apt-get install -y ninja-build clang-18 lcov gcovr sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - name: Enable brew run: | echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH From 7f8ee76382f4335f8cfe4366e42a937f1c569f9b Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 10:30:11 +0200 Subject: [PATCH 14/19] attempt to fix citations Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/citations.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/citations.yml b/.github/workflows/citations.yml index 53bf58602..05aee1ffb 100644 --- a/.github/workflows/citations.yml +++ b/.github/workflows/citations.yml @@ -31,5 +31,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: Install R + run: | + sudo apt-get update && sudo apt-get install -y r-base - name: Validate CITATION.cff uses: dieghernan/cff-validator@v3 From b6c9eda2436c96b77600a6bc3929e04242bd1093 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Wed, 9 Oct 2024 11:00:08 +0200 Subject: [PATCH 15/19] clang-tidy 18 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/clang-tidy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index cba054fc5..91a85d3bf 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -60,10 +60,10 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-18 clang-tidy-15 + sudo apt-get install -y ninja-build clang-18 clang-tidy-18 sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy + sudo ln -s /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy - name: Enable brew run: | From d0686538d92ca4d93a52db000d425c93264acf97 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Thu, 10 Oct 2024 13:18:43 +0200 Subject: [PATCH 16/19] clang-format 18 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/check-code-quality.yml | 4 ++-- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index 014058f14..152bb0ff4 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -66,8 +66,8 @@ jobs: - name: Install and run clang-format run: | - sudo apt-get update && sudo apt-get install -y clang-format-15 - find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-15 -style=file -i {} \; + sudo apt-get update && sudo apt-get install -y clang-format-18 + find . -regex '.*\.\(h\|c\|cpp\|hpp\|cc\|cxx\)' -exec clang-format-18 -style=file -i {} \; - name: If needed raise error run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eef0d09da..d512e5c18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: pass_filenames: false always_run: true - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v15.0.7 + rev: v18.1.3 hooks: - id: clang-format types_or: [ c++, c ] From 83bea1cfaa9caae6f64ce466f0e709293513a6af Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Thu, 10 Oct 2024 13:26:49 +0200 Subject: [PATCH 17/19] clang-tidy 15 on ubuntu 22.04 Signed-off-by: Santiago Figueroa Manrique --- .github/workflows/clang-tidy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 91a85d3bf..66f53e875 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -44,7 +44,7 @@ concurrency: jobs: clang-tidy: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 strategy: matrix: build-option: [ debug, release ] @@ -60,10 +60,10 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y ninja-build clang-18 clang-tidy-18 - sudo ln -s /usr/bin/clang-18 /usr/local/bin/clang - sudo ln -s /usr/bin/clang++-18 /usr/local/bin/clang++ - sudo ln -s /usr/bin/clang-tidy-18 /usr/local/bin/clang-tidy + sudo apt-get install -y ninja-build clang-15 clang-tidy-15 + sudo ln -s /usr/bin/clang-15 /usr/local/bin/clang + sudo ln -s /usr/bin/clang++-15 /usr/local/bin/clang++ + sudo ln -s /usr/bin/clang-tidy-15 /usr/local/bin/clang-tidy - name: Enable brew run: | From 4c2fbaa5f7854a1d765c8ef7c12395675629b532 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Thu, 10 Oct 2024 13:56:47 +0200 Subject: [PATCH 18/19] fix format Signed-off-by: Santiago Figueroa Manrique --- .../power_grid_model/auxiliary/meta_data.hpp | 4 +- .../auxiliary/serialization/common.hpp | 4 +- .../common/grouped_index_vector.hpp | 18 ++++---- .../common/iterator_like_concepts.hpp | 41 +++++++++---------- .../common/three_phase_tensor.hpp | 4 +- .../power_grid_model/component/component.hpp | 16 ++++---- .../power_grid_model/component/shunt.hpp | 4 +- .../component/transformer_utils.hpp | 18 ++++---- .../power_grid_model/index_mapping.hpp | 9 ++-- .../power_grid_model/main_core/math_state.hpp | 6 +-- .../power_grid_model/main_core/output.hpp | 10 ++--- .../power_grid_model/main_core/state.hpp | 18 +++----- .../power_grid_model/main_model_impl.hpp | 16 ++++---- .../iterative_linear_se_solver.hpp | 3 +- .../math_solver/sparse_lu_solver.hpp | 6 +-- .../optimizer/base_optimizer.hpp | 4 +- .../optimizer/tap_position_optimizer.hpp | 6 +-- .../include/power_grid_model/topology.hpp | 20 ++++----- .../power_grid_model_c/src/handle.hpp | 4 +- .../power_grid_model_c/src/model.cpp | 7 +--- .../power_grid_model_c/src/serialization.cpp | 3 +- tests/cpp_unit_tests/test_all_components.cpp | 6 +-- tests/cpp_unit_tests/test_optimizer.hpp | 4 +- 23 files changed, 106 insertions(+), 125 deletions(-) diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_data.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_data.hpp index 1e7f0c62b..2d30befe2 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_data.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_data.hpp @@ -74,8 +74,8 @@ constexpr void set_nan(Enum& x) { } template requires requires(T t) { - { set_nan(t) }; - } + { set_nan(t) }; + } inline T const nan_value = [] { T v{}; set_nan(v); diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/serialization/common.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/serialization/common.hpp index ae848d2a7..6910d818f 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/serialization/common.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/serialization/common.hpp @@ -30,8 +30,8 @@ template constexpr bool is_columnar_v = std::derived // The attribute buffers are copies of the associated attribute buffers, when provided, and otherwise empty. template requires requires(BufferType const& b) { - { b.attributes } -> std::convertible_to>>; - } + { b.attributes } -> std::convertible_to>>; + } std::vector> reordered_attribute_buffers(BufferType& buffer, std::span attribute_order) { using Data = typename BufferType::Data; diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/common/grouped_index_vector.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/common/grouped_index_vector.hpp index 054ec3bee..9d57af445 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/common/grouped_index_vector.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/common/grouped_index_vector.hpp @@ -61,19 +61,17 @@ inline auto sparse_decode(IdxVector const& indptr) { template concept grouped_index_vector_type = std::default_initializable && requires(T const t, Idx const idx) { - typename T::iterator; + typename T::iterator; - { t.size() } -> std::same_as; + { t.size() } -> std::same_as; - { t.begin() } -> index_range_iterator; - { t.end() } -> index_range_iterator; - { - t.get_element_range(idx) - } -> random_access_iterable_like; + { t.begin() } -> index_range_iterator; + { t.end() } -> index_range_iterator; + { t.get_element_range(idx) } -> random_access_iterable_like; - { t.element_size() } -> std::same_as; - { t.get_group(idx) } -> std::same_as; - }; + { t.element_size() } -> std::same_as; + { t.get_group(idx) } -> std::same_as; +}; } // namespace detail template diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/common/iterator_like_concepts.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/common/iterator_like_concepts.hpp index b347c4487..8732f9390 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/common/iterator_like_concepts.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/common/iterator_like_concepts.hpp @@ -11,41 +11,40 @@ namespace power_grid_model { template concept iterator_like = requires(T const t) { - { *t } -> std::convertible_to const&>; - }; + { *t } -> std::convertible_to const&>; +}; template concept forward_iterator_like = std::regular && iterator_like && requires(T t) { - { t++ } -> std::same_as; - { ++t } -> std::same_as; - }; + { t++ } -> std::same_as; + { ++t } -> std::same_as; +}; template concept bidirectional_iterator_like = forward_iterator_like && requires(T t) { - { t-- } -> std::same_as; - { --t } -> std::same_as; - }; + { t-- } -> std::same_as; + { --t } -> std::same_as; +}; template concept random_access_iterator_like = bidirectional_iterator_like && std::totally_ordered && requires(T t, Idx n) { - { t + n } -> std::same_as; - { t - n } -> std::same_as; - { t += n } -> std::same_as; - { t -= n } -> std::same_as; - }; + { t + n } -> std::same_as; + { t - n } -> std::same_as; + { t += n } -> std::same_as; + { t -= n } -> std::same_as; + }; template concept random_access_iterable_like = requires(T const t) { - { t.begin() } -> random_access_iterator_like; - { t.end() } -> random_access_iterator_like; - }; + { t.begin() } -> random_access_iterator_like; + { t.end() } -> random_access_iterator_like; +}; template -concept index_range_iterator = - random_access_iterator_like && requires(T const t) { - typename T::iterator; - { *t } -> random_access_iterable_like; - }; +concept index_range_iterator = random_access_iterator_like && requires(T const t) { + typename T::iterator; + { *t } -> random_access_iterable_like; +}; } // namespace power_grid_model diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp index 6b2144b2b..17846e1d3 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp @@ -125,8 +125,8 @@ static_assert(std::is_trivially_destructible_v>); template concept column_vector = (T::ColsAtCompileTime == 1); template -concept rk2_tensor = (static_cast(T::RowsAtCompileTime) == - static_cast(T::ColsAtCompileTime)); // rank 2 tensor +concept rk2_tensor = + (static_cast(T::RowsAtCompileTime) == static_cast(T::ColsAtCompileTime)); // rank 2 tensor template concept column_vector_or_tensor = column_vector || rk2_tensor; diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/component/component.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/component/component.hpp index a07f63524..8bff282b2 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/component/component.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/component/component.hpp @@ -24,16 +24,16 @@ struct UpdateChange { template concept component_c = requires(T t, T const& ct, typename T::UpdateType u, typename T::UpdateType const& cu) { - typename T::InputType; - typename T::UpdateType; + typename T::InputType; + typename T::UpdateType; - { T::name } -> std::convertible_to; - { ct.math_model_type() } -> std::convertible_to; + { T::name } -> std::convertible_to; + { ct.math_model_type() } -> std::convertible_to; - { ct.id() } -> std::same_as; + { ct.id() } -> std::same_as; - { t.update(cu) } -> std::same_as; - { ct.inverse(u) } -> std::same_as; - }; + { t.update(cu) } -> std::same_as; + { ct.inverse(u) } -> std::same_as; +}; } // namespace power_grid_model diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/component/shunt.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/component/shunt.hpp index adff6cd06..08a369d67 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/component/shunt.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/component/shunt.hpp @@ -77,8 +77,8 @@ class Shunt : public Appliance { DoubleComplex y0_{nan}; template - requires std::same_as || std::same_as bool - update_params(T shunt_params) { + requires std::same_as || std::same_as + bool update_params(T shunt_params) { bool changed = update_param(shunt_params.g1, g1_); changed = update_param(shunt_params.b1, b1_) || changed; changed = update_param(shunt_params.g0, g0_) || changed; diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer_utils.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer_utils.hpp index 491bd4fe7..d7f1a3d86 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer_utils.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer_utils.hpp @@ -16,15 +16,15 @@ concept enum_c = std::is_enum_v; template concept transformer_c = component_c && requires(T const& t, typename T::UpdateType u, typename T::SideType s) { - { t.node(s) } -> std::same_as; - { t.status(s) } -> std::convertible_to; - - { t.tap_side() } -> std::same_as; - { t.tap_pos() } -> std::convertible_to; - { t.tap_min() } -> std::convertible_to; - { t.tap_max() } -> std::convertible_to; - { t.tap_nom() } -> std::convertible_to; - }; + { t.node(s) } -> std::same_as; + { t.status(s) } -> std::convertible_to; + + { t.tap_side() } -> std::same_as; + { t.tap_pos() } -> std::convertible_to; + { t.tap_min() } -> std::convertible_to; + { t.tap_max() } -> std::convertible_to; + { t.tap_nom() } -> std::convertible_to; +}; constexpr double tap_adjust_impedance(double tap_pos, double tap_min, double tap_max, double tap_nom, double xk, double xk_min, double xk_max) { diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/index_mapping.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/index_mapping.hpp index 16f336173..5d5488a69 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/index_mapping.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/index_mapping.hpp @@ -58,9 +58,7 @@ inline SparseIndexMapping build_sparse_mapping(IdxVector const& idx_B_in_A, Idx std::vector entries(n_A); std::ranges::transform(idx_B_in_A, boost::counting_range(Idx{0}, static_cast(idx_B_in_A.size())), - entries.begin(), [](Idx j_B, Idx i_A) { - return SparseEntry{i_A, j_B}; - }); + entries.begin(), [](Idx j_B, Idx i_A) { return SparseEntry{i_A, j_B}; }); SparseIndexMapping sparse_mapping; sparse_mapping.indptr.resize(n_B + 1); @@ -97,9 +95,8 @@ inline auto build_dense_mapping_comparison_sort(IdxVector const& idx_B_in_A, Idx std::vector mapping_to_from; mapping_to_from.reserve(idx_B_in_A.size()); std::ranges::transform(idx_B_in_A, boost::counting_range(Idx{0}, static_cast(idx_B_in_A.size())), - std::back_inserter(mapping_to_from), [](Idx value, Idx orig_idx) { - return std::pair{value, orig_idx}; - }); + std::back_inserter(mapping_to_from), + [](Idx value, Idx orig_idx) { return std::pair{value, orig_idx}; }); std::ranges::sort(mapping_to_from); diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/math_state.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/math_state.hpp index 6d45f4d17..de0419cce 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/math_state.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/math_state.hpp @@ -30,8 +30,7 @@ inline void update_y_bus(MathState& math_state, std::vector> } else { return math_state.y_bus_vec_asym; } - } - (); + }(); assert(y_bus_vec.size() == math_model_params.size()); @@ -49,8 +48,7 @@ inline void update_y_bus(MathState& math_state, std::vector> } else { return math_state.y_bus_vec_asym; } - } - (); + }(); assert(y_bus_vec.size() == math_model_params.size()); diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp index 8b8766732..1f76b8eb5 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp @@ -366,7 +366,7 @@ template Component, class ComponentContainer, solver_ou requires(Component const& component, std::vector const& solver_output, Idx2D math_id) { { output_result(component, solver_output, math_id) - } -> detail::assignable_to>>; + } -> detail::assignable_to>>; } constexpr ResIt output_result(MainModelState const& state, MathOutput> const& math_output, ResIt res_it) { @@ -382,7 +382,7 @@ template Component, class ComponentContainer, solver_ou std::vector const& solver_output, Idx2D math_id) { { output_result(component, state, solver_output, math_id) - } -> detail::assignable_to>>; + } -> detail::assignable_to>>; } constexpr ResIt output_result(MainModelState const& state, MathOutput> const& math_output, ResIt res_it) { @@ -398,7 +398,7 @@ template Component, class ComponentContainer, solver_ou std::vector const& solver_output, Idx obj_seq) { { output_result(component, state, solver_output, obj_seq) - } -> detail::assignable_to>>; + } -> detail::assignable_to>>; } constexpr ResIt output_result(MainModelState const& state, MathOutput> const& math_output, ResIt res_it) { @@ -414,7 +414,7 @@ template Component, class ComponentContainer, solver_ou Idx2DBranch3 const& math_id) { { output_result(component, solver_output, math_id) - } -> detail::assignable_to>>; + } -> detail::assignable_to>>; } constexpr ResIt output_result(MainModelState const& state, MathOutput> const& math_output, ResIt res_it) { @@ -429,7 +429,7 @@ template Component, class ComponentContainer, typename MathOutput const& math_output, Idx const obj_seq) { { output_result(component, state, math_output, obj_seq) - } -> detail::assignable_to>>; + } -> detail::assignable_to>>; } constexpr ResIt output_result(MainModelState const& state, MathOutput const& math_output, ResIt res_it) { diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/state.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/state.hpp index e02b564e8..94062f430 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/state.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/state.hpp @@ -30,18 +30,12 @@ concept main_model_state_c = std::same_as concept component_container_c = requires(ContainerType const& c, ID id) { - { c.template citer().begin() } -> std::forward_iterator; - { c.template citer().end() } -> std::forward_iterator; - { - *(c.template citer().begin()) - } -> std::same_as; - { - *(c.template citer().end()) - } -> std::same_as; - { - c.template get_item(id) - } -> std::convertible_to; - }; + { c.template citer().begin() } -> std::forward_iterator; + { c.template citer().end() } -> std::forward_iterator; + { *(c.template citer().begin()) } -> std::same_as; + { *(c.template citer().end()) } -> std::same_as; + { c.template get_item(id) } -> std::convertible_to; +}; template