Skip to content

Commit 4efc595

Browse files
Merge branch 'main' into feature/documentation-on-functionality
2 parents 5bd52d7 + 9f0aa7b commit 4efc595

File tree

8 files changed

+60
-15
lines changed

8 files changed

+60
-15
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ jobs:
7676
cmake .. `
7777
-G "Ninja" `
7878
-DCMAKE_BUILD_TYPE=${{ matrix.build-option }} `
79-
-DCMAKE_PREFIX_PATH=C:\conda_envs\cpp_pkgs\Library `
80-
-DPOWER_GRID_MODEL_BUILD_BENCHMARK=1
79+
-DCMAKE_PREFIX_PATH=C:\conda_envs\cpp_pkgs\Library
8180
# build
8281
cmake --build . --verbose -j 1
8382
# test
@@ -128,7 +127,7 @@ jobs:
128127
uses: docker/setup-qemu-action@v2
129128

130129
- name: Build wheels
131-
uses: pypa/[email protected].2
130+
uses: pypa/[email protected].3
132131
# GitHub Actions specific build parameters
133132
env:
134133
# pass GitHub runner info into Linux container

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ dmypy.json
486486
.pyre/
487487

488488
# build
489-
.vscode/
490489
src/power_grid_model/**/*.cpp
491490
cpp_build*/
492491

@@ -509,4 +508,11 @@ PYPI_VERSION
509508

510509
# docs builds
511510
docs/make.bat
512-
docs/Makefile
511+
docs/Makefile
512+
513+
# VSCode configurations
514+
# it is ignored by default so the user does not accidentally change the configuration
515+
# if you want to changes the JSON file in .vscode folder
516+
# please type
517+
# git add .vscode/ --force
518+
.vscode/

.vscode/extensions.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
2+
//
3+
// SPDX-License-Identifier: MPL-2.0
4+
{
5+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
6+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
7+
// List of extensions which should be recommended for users of this workspace.
8+
"recommendations": [
9+
"bungcip.better-toml",
10+
"ms-python.black-formatter",
11+
"ms-python.isort",
12+
"ms-python.python",
13+
"ms-python.vscode-pylance",
14+
"ms-toolsai.jupyter",
15+
"ms-toolsai.jupyter-keymap",
16+
"ms-toolsai.jupyter-renderers",
17+
"ms-toolsai.vscode-jupyter-cell-tags",
18+
"ms-toolsai.vscode-jupyter-slideshow",
19+
"ms-vscode.cmake-tools",
20+
"ms-vscode.cpptools",
21+
"ms-vscode.cpptools-extension-pack",
22+
"ms-vscode.cpptools-themes",
23+
"ms-vscode.test-adapter-converter",
24+
"njpwerner.autodocstring",
25+
"jeff-hykin.better-cpp-syntax",
26+
"twxs.cmake",
27+
"matepek.vscode-catch2-test-adapter"
28+
]
29+
}

.vscode/settings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
2+
//
3+
// SPDX-License-Identifier: MPL-2.0
4+
{
5+
"cmake.buildDirectory": "${workspaceFolder}/cpp_build_${buildType}",
6+
"C_Cpp.autoAddFileAssociations": false,
7+
"cmake.configureOnOpen": true,
8+
"testMate.cpp.test.executables": "cpp_build_${command:cmake.buildType}/tests/cpp_unit_tests/power_grid_model_unit_tests",
9+
"python.testing.pytestArgs": [
10+
"tests",
11+
"--no-cov"
12+
],
13+
"python.testing.unittestEnabled": false,
14+
"python.testing.pytestEnabled": true,
15+
}

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,4 @@ endif()
5353
add_subdirectory(tests/cpp_unit_tests)
5454

5555
# get benchmark
56-
if(DEFINED POWER_GRID_MODEL_BUILD_BENCHMARK AND POWER_GRID_MODEL_BUILD_BENCHMARK EQUAL 1)
57-
add_subdirectory(tests/benchmark_cpp)
58-
endif()
59-
60-
56+
add_subdirectory(tests/benchmark_cpp)

CMakeSettings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"inheritEnvironments": [ "msvc_x64_x64" ],
88
"buildRoot": "${projectDir}\\cpp_build\\${name}",
99
"installRoot": "${projectDir}\\install\\${name}",
10-
"cmakeCommandArgs": "-DPOWER_GRID_MODEL_BUILD_BENCHMARK=1",
1110
"buildCommandArgs": "-v",
1211
"ctestCommandArgs": ""
1312
},
@@ -17,7 +16,6 @@
1716
"configurationType": "RelWithDebInfo",
1817
"buildRoot": "${projectDir}\\cpp_build\\${name}",
1918
"installRoot": "${projectDir}\\install\\${name}",
20-
"cmakeCommandArgs": "-DPOWER_GRID_MODEL_BUILD_BENCHMARK=1",
2119
"buildCommandArgs": "-v",
2220
"ctestCommandArgs": "",
2321
"inheritEnvironments": [ "msvc_x64_x64" ]

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ cd ${BUILD_DIR}
3232
cmake .. -GNinja \
3333
-DCMAKE_BUILD_TYPE=$1 \
3434
${PATH_FOR_CMAKE} \
35-
-DPOWER_GRID_MODEL_BUILD_BENCHMARK=1 \
3635
${BUILD_COVERAGE}
3736
# build
3837
VERBOSE=1 cmake --build .

docs/advanced_documentation/build-guide.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ library `power_grid_model`. There are two sub-projects defined in the root cmake
108108

109109
In principle, you can use any C++ IDE with cmake and ninja support to develop the C++ project. When you
110110
use `cmake build` for the root cmake file, the following additional options are available besides the standard cmake
111-
option. If no option is defined, the cmake project will build the unit tests.
111+
option.
112112

113113
| Option | Description |
114114
|------------------------------------|-------------------------------------------------------------------------------------------------------------|
115-
| `POWER_GRID_MODEL_BUILD_BENCHMARK` | When set to `1`, build the both sub-projects: unit test and benchmarks. Otherwise only build the unit test. |
116115
| `POWER_GRID_MODEL_COVERAGE` | When set to `1`, build with test coverage. This is only applicable for Linux. |
117116

117+
## Visual Studio Code Support
118+
119+
You can use any IDE to develop this project. As a popular cross-platform IDE, the settings for Visual Studio Code is preconfigured in the folder `.vscode`. You can open the repository folder with VSCode and the configuration will be loaded automatically.
120+
118121
## Example Setup for Ubuntu 22.04 (in WSL or physical/virtual machine)
119122

120123
In this section an example is given for setup in Ubuntu 22.04. You can use this example in Windows Subsystem for Linux (

0 commit comments

Comments
 (0)