Skip to content

Commit 3eae84a

Browse files
authored
TODO labeling; some noexcepts; test_todos_annoteted.py; test-time-requirements.txt
1 parent 13d41d2 commit 3eae84a

29 files changed

+190
-111
lines changed

.github/workflows/conda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
- name: Install dependencies with pip in conda
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install pytest
28+
pip install -r test-time-requirements.txt
2929
- name: Install PyPartMC
3030
run: |
3131
pip install -e .
3232
- name: Test with pytest
3333
run: |
3434
cd tests
35-
pytest -v -s -We -p no:unraisableexception .
35+
pytest -v -s -We -p no:unraisableexception -k 'not test_todos_annotated' .

.github/workflows/pdoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
pip install pdoc3
2626
pip install -e .
27-
# TODO: add -We
27+
# FIXME #23: add -We
2828
python -m pdoc --html PyPartMC
2929
- name: Deploy
3030
if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}

.github/workflows/pylint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
python-version: 3.9
2121
- run: |
2222
python -m pip install --upgrade pip
23-
pip install pylint pytest nbconvert
23+
pip install pylint
24+
pip install -r test-time-requirements.txt
2425
pip install -e .
2526
- run: pylint --unsafe-load-any-extension=y --disable=fixme,no-member,trailing-newlines,missing-module-docstring,missing-class-docstring,missing-function-docstring,unnecessary-pass $(git ls-files '*.py')

.github/workflows/tests+artifacts+pypi.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,22 @@ on:
1515
types: [published]
1616

1717
jobs:
18+
todos_annotated:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
with:
23+
submodules: recursive
24+
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480
25+
- run: pip install -r test-time-requirements.txt
26+
- run: DEBUG=0 VERBOSE=1 pip install --verbose -e .
27+
- run: pytest -v -s -We -p no:unraisableexception tests/test_todos_annotated.py
28+
1829
build:
30+
needs: [todos_annotated]
1931
strategy:
2032
matrix:
21-
platform: [ubuntu-latest, macos-11, macOS-12, windows-latest]
33+
platform: [ubuntu-latest, macos-11, macos-12, windows-latest]
2234
python-version: ["3.7", "3.8", "3.9", "3.10"]
2335
runs-on: ${{ matrix.platform }}
2436
steps:
@@ -54,7 +66,8 @@ jobs:
5466
with:
5567
python-version: ${{ matrix.python-version }}
5668

57-
- run: pip install pytest build wheel
69+
- run: pip install build wheel
70+
- run: pip install -r test-time-requirements.txt
5871

5972
- run: |
6073
python -m build 2>&1 | tee build.log
@@ -81,7 +94,7 @@ jobs:
8194
name: dist
8295
path: dist
8396

84-
# TODO: should be doable on any OS
97+
# TODO #114: should be doable on any OS
8598
- if: matrix.platform == 'windows-latest' || matrix.platform == 'ubuntu-latest'
8699
run: |
87100
pip install dist/*.whl
@@ -94,10 +107,10 @@ jobs:
94107
### make sure PyPartMC is not picked up from a local folder
95108
- run: |
96109
cd tests
97-
python -v -c "import PyPartMC"
98-
pytest -v -s -We -p no:unraisableexception .
110+
python -c "import PyPartMC"
111+
pytest -v -s -We -p no:unraisableexception -k 'not test_todos_annotated' .
99112
100-
# TODO: worth checking but perhaps in a separater workflow? (here conflicts with build dir created for manylinux by other user)
113+
# TODO #114: worth checking but perhaps in a separater workflow? (here conflicts with build dir created for manylinux by other user)
101114
# - run: DEBUG=1 VERBOSE=1 pip install --verbose -e .
102115
#
103116
# - run: pytest -v -s -We -p no:unraisableexception tests

CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ set(CMAKE_CXX_STANDARD 17)
1313
set(CMAKE_CXX_STANDARD_REQUIRED YES)
1414
set(CMAKE_CXX_EXTENSIONS OFF)
1515

16-
# TODO
17-
#set(CMAKE_Fortran_STANDARD 2008)
18-
#set(CMAKE_Fortran_STANDARD_REQUIRED YES)
19-
#set(CMAKE_Fortran_EXTENSIONS OFF)
20-
2116
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
2217
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none>)
2318
endif()
@@ -84,7 +79,7 @@ function(scoped_sundials_setup_config)
8479
set(PROJECT_SOURCE_DIR ${SUNDIALS_SOURCE_DIR})
8580
set(SUNDIALS_PRECISION "double")
8681
set(SUNDIALS_CINDEX_TYPE "int64_t")
87-
# TODO: read from submodule files!
82+
# TODO #111: read from submodule files!
8883
set(PACKAGE_VERSION_MAJOR "5")
8984
set(PACKAGE_VERSION_MINOR "8")
9085
set(PACKAGE_VERSION_PATCH "0")
@@ -143,18 +138,11 @@ endif()
143138

144139
### pedantics ######################################################################################
145140

146-
foreach(target _PyPartMC) # TODO: the same for partmclib
141+
foreach(target _PyPartMC)
147142
target_compile_options(${target} PRIVATE
148143
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
149144
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror>
150-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-compare-reals> # TODO
151-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unused-dummy-argument> # TODO
152-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unused-variable> # TODO
153-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c-binding-type> # TODO
154-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-maybe-uninitialized> # TODO
155-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-function-elimination> # TODO
156-
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unused-parameter> # TODO
157-
#$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-surprising> # TODO
145+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unused-parameter>
158146
)
159147
endforeach()
160148

PyPartMC/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __build_extension_env():
2222
for cookie in cookies:
2323
cookie.close()
2424

25-
# TODO: 2 x loop over prefixes and units
25+
# TODO #113: 2 x loop over prefixes and units
2626
si = namedtuple("SI", (
2727
"m", "cm", "um",
2828
"kg", "g",
@@ -38,7 +38,7 @@ def __build_extension_env():
3838
Pa=1., hPa=100.,
3939
mol=1.
4040
)
41-
""" TODO """
41+
""" TODO #113 """
4242

4343
with __build_extension_env():
4444
from _PyPartMC import *

src/aero_data.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct AeroData {
2222
{
2323
gimmick_ptr() = std::make_unique<InputGimmick>(json);
2424
f_aero_data_from_json(this->ptr.f_arg());
25-
gimmick_ptr().reset(); // TODO: guard
25+
gimmick_ptr().reset(); // TODO #117: guard
2626
}
2727

2828
static int spec_by_name(const AeroData &self, const std::string &name) {

src/aero_state.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ subroutine f_aero_state_init(ptr_c, n_part, aero_data_ptr_c) bind(C)
4141
call aero_state_set_n_part_ideal(ptr_f, n_part)
4242
!call aero_state_add_aero_dist_sample(aero_state, aero_data_ptr_f, &
4343
! aero_dist_init, 1d0, 0d0, &
44-
! .false. & ! TODO run_part_opt%allow_doubling, &
45-
! .false. & ! TODO run_part_opt%allow_halving)
44+
! .false. & ! TODO #121 run_part_opt%allow_doubling, &
45+
! .false. & ! TODO #121 run_part_opt%allow_halving)
4646
!)
4747

4848
end subroutine

src/env_state.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct EnvState {
1919
EnvState(const nlohmann::json &json) :
2020
ptr(f_env_state_ctor, f_env_state_dtor)
2121
{
22-
gimmick_ptr() = std::make_unique<InputGimmick>(json); // TODO: guard
22+
gimmick_ptr() = std::make_unique<InputGimmick>(json); // TODO #117: guard
2323
f_env_state_from_json(this->ptr.f_arg());
2424
gimmick_ptr().reset();
2525
}

src/fake_mpi.F90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ module mpi
2020
MPI_MAX = -1, &
2121
MPI_SUM = -1, &
2222
MPI_SUCCESS = -1, &
23-
MPI_TAG = 1, & ! TODO this is used as status array index
2423
MPI_ANY_TAG = -1, &
25-
MPI_SOURCE = 1, & ! TODO this is used as status array index
26-
MPI_ANY_SOURCE = -1
24+
MPI_ANY_SOURCE = -1, &
25+
! status array indices
26+
MPI_TAG = 1, &
27+
MPI_SOURCE = 1
2728

2829
interface
2930
subroutine mpi_abort(comm, errorcode, ierror) bind(C)

0 commit comments

Comments
 (0)