Skip to content

Commit 17888f8

Browse files
authored
Merge branch 'main' into sc/add-dependabot
2 parents dccd511 + ea6f46e commit 17888f8

File tree

10 files changed

+45
-44
lines changed

10 files changed

+45
-44
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,31 @@ name: Build and test
88
# time we only run the full system tests on Ubuntu (although this can easily be
99
# changed).
1010

11-
1211
on:
1312
push:
1413
branches: ["main"]
1514
pull_request:
1615
merge_group:
16+
schedule:
17+
- cron: "0 9 15 * *"
1718
workflow_dispatch:
1819

19-
2020
concurrency:
2121
# Skip intermediate builds: always.
2222
# Cancel intermediate builds: always.
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: true
2525

26-
2726
jobs:
2827
linting:
2928
name: Linting checks with pre-commit
3029
runs-on: ubuntu-latest
3130
steps:
32-
- uses: ucl/composite-actions/pre-commit@v1
31+
- uses: actions/checkout@v4
32+
- uses: actions/setup-python@v4
33+
- name: Check clang-format version
34+
run: clang-format --version
35+
- uses: pre-commit/action@v3.0.1
3336

3437
build:
3538
name: ${{ matrix.build_type }} build on ${{ matrix.os }} with build testing ${{ matrix.build_testing }}
@@ -38,7 +41,7 @@ jobs:
3841
strategy:
3942
fail-fast: false
4043
matrix:
41-
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest]
44+
os: [ubuntu-latest, windows-latest, macos-latest]
4245
build_type: [Debug, Release]
4346
build_testing: [ON, OFF]
4447
exclude:
@@ -49,15 +52,15 @@ jobs:
4952

5053
steps:
5154
- name: Check out repository
52-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
5356

5457
- name: Set up MATLAB
55-
uses: matlab-actions/setup-matlab@v1.2.3
58+
uses: matlab-actions/setup-matlab@v2.5.0
5659

5760
- name: Setup Python
5861
uses: actions/setup-python@v4
5962
with:
60-
python-version: '3.9'
63+
python-version: "3.9"
6164

6265
# -------------------------------------------------------------------------------
6366
# Ubuntu
@@ -89,7 +92,7 @@ jobs:
8992
# MacOS
9093
- name: Install dependencies for MacOS
9194
if: ${{ contains(matrix.os, 'macos') }}
92-
run: brew install fftw hdf5
95+
run: brew install fftw hdf5 libomp
9396

9497
- name: Fix omp headers not linked on MacOS
9598
if: ${{ contains(matrix.os, 'macos') }}
@@ -148,7 +151,7 @@ jobs:
148151
# Unit tests
149152
- name: Produce MATLAB unit test data
150153
if: matrix.build_testing == 'ON'
151-
uses: matlab-actions/run-command@v1
154+
uses: matlab-actions/run-command@v2
152155
with:
153156
command: cd('tdms/tests/unit/benchmark_scripts/'), setup_unit_tests
154157

@@ -175,8 +178,8 @@ jobs:
175178
lcov --capture --directory ${{ runner.workspace }}/build/CMakeFiles/tdms_tests.dir/src --output-file coverage.info
176179
lcov --remove coverage.info '/usr/*' --output-file coverage.info
177180
lcov --remove coverage.info '*/_deps/*' --output-file coverage.info
178-
lcov --remove coverage.info '/Library/*' --output-file coverage.info
179-
lcov --remove coverage.info '/Applications/*' --output-file coverage.info
181+
lcov --ignore-errors unused --remove coverage.info '/Library/*' --output-file coverage.info
182+
lcov --ignore-errors unused --remove coverage.info '/Applications/*' --output-file coverage.info
180183
lcov --list coverage.info
181184
182185
- name: Upload coverage reports to Codecov
@@ -196,7 +199,7 @@ jobs:
196199
if: matrix.build_testing == 'OFF' && matrix.build_type == 'Debug'
197200
# If we use the build with testing ON, we'd also need to copy over (and
198201
# install) the libtdms.so so use the OFF build for simplicity.
199-
uses: actions/upload-artifact@v3
202+
uses: actions/upload-artifact@v4
200203
with:
201204
name: tdms_build_${{ matrix.os }}
202205
path: ${{ runner.workspace }}/build/tdms_build.tar
@@ -218,7 +221,7 @@ jobs:
218221
uses: actions/checkout@v3
219222

220223
- name: Set up MATLAB
221-
uses: matlab-actions/setup-matlab@v1.2.3
224+
uses: matlab-actions/setup-matlab@v2.5.0
222225

223226
- name: Install HDF5 libraries for Ubuntu
224227
if: ${{ contains(matrix.os, 'ubuntu') }}
@@ -232,7 +235,7 @@ jobs:
232235
python3 -m pip install -r ${GITHUB_WORKSPACE}/tdms/tests/requirements.txt
233236
234237
- name: Download build result
235-
uses: actions/download-artifact@v3
238+
uses: actions/download-artifact@v4
236239
with:
237240
name: tdms_build_${{ matrix.os }}
238241
path: ${{ runner.workspace }}
@@ -244,7 +247,7 @@ jobs:
244247
245248
- name: Setup cache of test data
246249
id: cache-test-data
247-
uses: actions/cache@v3
250+
uses: actions/cache@v4
248251
with:
249252
path: ${{ github.workspace }}/tdms/tests/system/data
250253
key: test_data

.github/workflows/doxygen-gh-pages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121

2222
- name: Checkout repository
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
submodules: "true"
2626

@@ -45,7 +45,7 @@ jobs:
4545
shell: bash
4646

4747
- name: Upload the website
48-
uses: actions/upload-artifact@v3
48+
uses: actions/upload-artifact@v4
4949
with:
5050
name: tdms_website
5151
path: html/*
@@ -61,7 +61,7 @@ jobs:
6161
uses: actions/checkout@v3
6262

6363
- name: Download the content for deployment
64-
uses: actions/download-artifact@v3
64+
uses: actions/download-artifact@v4
6565
with:
6666
name: tdms_website
6767
path: html

.github/workflows/matlab_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/checkout@v3
2424

2525
- name: Set up MATLAB
26-
uses: matlab-actions/setup-matlab@v1.2.3
26+
uses: matlab-actions/setup-matlab@v2.5.0
2727

2828
- name: Run script
2929
uses: matlab-actions/run-command@v1

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
repos:
22
# Sort order of Python imports
33
- repo: https://github.com/pycqa/isort
4-
rev: 5.12.0
4+
rev: 6.0.1
55
hooks:
66
- id: isort
77
# Python code formatting
88
- repo: https://github.com/psf/black
9-
rev: 22.3.0
9+
rev: 25.1.0
1010
hooks:
1111
- id: black
1212
# Remove unused Python imports
1313
- repo: https://github.com/myint/autoflake
14-
rev: v1.4
14+
rev: v2.3.1
1515
hooks:
1616
- id: autoflake
1717
args: ["--in-place", "--remove-all-unused-imports"]
1818
# Remove whitespace at line end, ensure newline at the end of files
1919
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v4.3.0 # Use the ref you want to point at
20+
rev: v5.0.0 # Use the ref you want to point at
2121
hooks:
2222
- id: trailing-whitespace
2323
- id: end-of-file-fixer

tdms/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ include_directories(${CMAKE_SOURCE_DIR}/matlabio/)
3737
find_package(Matlab REQUIRED MAT_LIBRARY)
3838
include_directories(${Matlab_INCLUDE_DIRS})
3939

40-
# Currently matlab only has x84 libraries on Mac (no arm)
41-
set(CMAKE_OSX_ARCHITECTURES "x86_64")
42-
4340
# Set the RPATH for the executable to find the dynamically linked libraries
4441
get_filename_component(MATLAB_LIB_ROOT "${Matlab_MAT_LIBRARY}" DIRECTORY)
4542
set(CMAKE_INSTALL_RPATH ${MATLAB_LIB_ROOT})

tdms/src/simulation_manager/execute_detector_subfunctions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void SimulationManager::compute_detector_functions(unsigned int tind,
8181
values from the detector arrays. Ergo, we can handle computing phasors
8282
at different frequencies simultaneously. */
8383
#pragma omp parallel default(shared) private(lambda_an_t, Idxt, Idyt, kprop, \
84-
phaseTermE, cphaseTermE)
84+
phaseTermE, cphaseTermE)
8585
{
8686
// For each frequency
8787
/**
@@ -168,6 +168,6 @@ void SimulationManager::compute_detector_functions(unsigned int tind,
168168
outputs.ID.y[ifx][im] += Idyt * cphaseTermE;
169169

170170
}// end of loop on frequencies
171-
} // end of pragma omp parallel
172-
} // end of loop over each mode
171+
}// end of pragma omp parallel
172+
}// end of loop over each mode
173173
}

tdms/src/simulation_manager/execute_simulation.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ void SimulationManager::execute() {
128128
// warning
129129

130130
#pragma omp parallel default(shared) private( \
131-
i, j, k, n, rho, k_loc, array_ind, Ca, Cb, Cc, alpha_l, beta_l, \
132-
gamma_l, kappa_l, sigma_l, Enp1, Jnp1)//,ca_vec,cb_vec,eh_vec)
131+
i, j, k, n, rho, k_loc, array_ind, Ca, Cb, Cc, alpha_l, \
132+
beta_l, gamma_l, kappa_l, sigma_l, Enp1, \
133+
Jnp1)//,ca_vec,cb_vec,eh_vec)
133134
{
134135
n = omp_get_thread_num();
135136
Enp1 = 0.0;
@@ -803,7 +804,7 @@ void SimulationManager::execute() {
803804
// PSTD, E_s.yz
804805
}// if (solver_method == DerivativeMethod::FiniteDifference) (else
805806
// PseudoSpectral)
806-
} // if(params.dimension==THREE || params.dimension==TE)
807+
}// if(params.dimension==THREE || params.dimension==TE)
807808

808809
if (inputs.params.dimension == THREE ||
809810
inputs.params.dimension == Dimension::TRANSVERSE_ELECTRIC) {
@@ -1128,7 +1129,7 @@ void SimulationManager::execute() {
11281129
// PSTD, E_s.zx
11291130
}// if (solver_method == DerivativeMethod::FiniteDifference) (else
11301131
// PseudoSpectral)
1131-
} //(params.dimension==THREE || params.dimension==TE)
1132+
}//(params.dimension==THREE || params.dimension==TE)
11321133
else {
11331134
#pragma omp for
11341135
// E_s.zx updates
@@ -1565,7 +1566,7 @@ void SimulationManager::execute() {
15651566
// PSTD, E_s.zy
15661567
}// if (solver_method == DerivativeMethod::FiniteDifference) (else
15671568
// PseudoSpectral)
1568-
} //(params.dimension==THREE || params.dimension==TE)
1569+
}//(params.dimension==THREE || params.dimension==TE)
15691570
else {
15701571
#pragma omp for
15711572
for (k = 0; k <= K_tot; k++)
@@ -1719,7 +1720,7 @@ void SimulationManager::execute() {
17191720
/********************/
17201721
// begin parallel
17211722
#pragma omp parallel default(shared) private( \
1722-
i, j, k, n, k_loc, array_ind)//,ca_vec,cb_vec,eh_vec)
1723+
i, j, k, n, k_loc, array_ind)//,ca_vec,cb_vec,eh_vec)
17231724
{
17241725
n = omp_get_thread_num();
17251726

@@ -2153,7 +2154,7 @@ void SimulationManager::execute() {
21532154
// PSTD, H_s.yz
21542155
}// if (solver_method == DerivativeMethod::FiniteDifference) (else
21552156
// PseudoSpectral)
2156-
} //(params.dimension==THREE || params.dimension==TE)
2157+
}//(params.dimension==THREE || params.dimension==TE)
21572158
else {
21582159

21592160
#pragma omp for
@@ -2480,8 +2481,8 @@ void SimulationManager::execute() {
24802481
// PSTD, H_s.zx
24812482
}// if (solver_method == DerivativeMethod::FiniteDifference) (else
24822483
// PseudoSpectral)
2483-
} //(params.dimension==THREE || params.dimension==TE)
2484-
} // end parallel
2484+
}//(params.dimension==THREE || params.dimension==TE)
2485+
}// end parallel
24852486
if (TIME_EXEC) { timers.click_timer(TimersTrackingLoop::INTERNAL); }
24862487

24872488
/* Update source terms for self consistency across scattered/total interface

tdms/src/simulation_parameters.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SimulationParameters::SimulationParameters() = default;
1717

1818
void SimulationParameters::set_source_mode(string mode_string) {
1919

20-
auto s = move(mode_string);
20+
auto s = std::move(mode_string);
2121
if (s == "steadystate") {
2222
source_mode = SourceMode::steadystate;
2323
} else if (s == "pulsed") {
@@ -29,7 +29,7 @@ void SimulationParameters::set_source_mode(string mode_string) {
2929

3030
void SimulationParameters::set_run_mode(string mode_string) {
3131

32-
auto s = move(mode_string);
32+
auto s = std::move(mode_string);
3333
if (s == "complete") {
3434
run_mode = RunMode::complete;
3535
} else if (s == "analyse") {
@@ -41,7 +41,7 @@ void SimulationParameters::set_run_mode(string mode_string) {
4141

4242
void SimulationParameters::set_dimension(string mode_string) {
4343

44-
auto s = move(mode_string);
44+
auto s = std::move(mode_string);
4545
if (s == "3") {
4646
dimension = Dimension::THREE;
4747
} else if (s == "TE") {

tdms/tests/system/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Common utilities for running TDMS system tests
33
"""
4+
45
import os
56
import shutil
67
from dataclasses import dataclass

tdms/tests/unit/test_interpolation_functions.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ TEST_CASE("BLi: interpolation-coefficient sums match") {
144144
coeff_sums[7] = BL7.interpolate(a);
145145
// now check that the entries of coeff_sums are the same
146146
int n = 8;
147-
while (--n > 0 && abs(coeff_sums[n] - coeff_sums[0]) < tol)
148-
;
147+
while (--n > 0 && abs(coeff_sums[n] - coeff_sums[0]) < tol);
149148
// we only reach the end of the while loop, IE get to n==0, when all elements
150149
// in the array are the same
151150
REQUIRE(n == 0);

0 commit comments

Comments
 (0)