Skip to content

Commit e251fc0

Browse files
authored
Merge pull request #26 from BMCV/develop
Update to v0.4.0
2 parents 47c3bce + c00893b commit e251fc0

File tree

118 files changed

+3062
-3523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3062
-3523
lines changed

.devcontainer/devcontainer.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
{
44
"name": "Python 3",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/python:0-3.8",
6+
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
7+
"containerEnv": {
8+
"DOCKER_DEFAULT_PLATFORM": "linux/amd64"
9+
},
710

811
// Features to add to the dev container. More info: https://containers.dev/features.
912
// "features": {},
@@ -12,13 +15,13 @@
1215
// "forwardPorts": [],
1316

1417
// Use 'postCreateCommand' to run commands after the container is created.
15-
"postCreateCommand": "pip3 install --user -r requirements.txt",
18+
"postCreateCommand": "pip3 install -r requirements.txt",
1619

1720
// Configure tool-specific properties.
1821
"customizations": {
1922
"vscode": {
2023
"settings": {
21-
"python.analysis.extraPaths": ["/home/vscode/.local/lib/python3.8/site-packages"]
24+
"python.analysis.extraPaths": ["/home/vscode/.local/lib/python3.11/site-packages"]
2225
}
2326
}
2427
}

.flake8

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
3+
max-line-length = 120
4+
5+
extend-ignore = E221,E211,E222,E202,F541,E201,E203,E125,E272
6+
7+
per-file-ignores =
8+
superdsm/__init__.py:F401
9+
10+
exclude = superdsm/_libs/**/*.py docs/source/conf.py

.github/workflows/linters.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Linters
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: ['*']
7+
8+
jobs:
9+
10+
run_linters:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.11
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install flake8 isort
27+
28+
- name: Run linters
29+
run: |
30+
flake8 superdsm
31+
flake8 tests
32+
isort superdsm --check-only --diff
33+
isort tests --check-only --diff

.github/workflows/regressiontests.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Regression tests
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: ['develop']
6+
branches: ['develop', 'master']
77
paths:
88
- .github/workflows/regressiontests.yml
99
- superdsm/**
@@ -16,6 +16,7 @@ jobs:
1616

1717
regression_tests:
1818
name: "Test: ${{ matrix.taskdir }}"
19+
if: ${{ (github.event.action != 'synchronize' && github.event.action != 'opened') || github.event.pull_request.draft == false }}
1920
timeout-minutes: 1440
2021
runs-on: gpuagrohr-01
2122
container:
@@ -57,10 +58,10 @@ jobs:
5758
5859
- name: Run SuperDSM
5960
run: |
60-
python -m "superdsm.batch" examples --task-dir "${{ matrix.taskdir }}"
61-
python -m "superdsm.batch" examples --task-dir "${{ matrix.taskdir }}" --run
61+
python -m "superdsm" examples --task-dir "examples/${{ matrix.taskdir }}"
62+
python -m "superdsm" examples --task-dir "examples/${{ matrix.taskdir }}" --run
6263
env:
63-
SUPERDSM_INTERMEDIATE_OUTPUT: false
64+
REPYPE_CLI_INTERMEDIATE: false
6465
SUPERDSM_NUM_CPUS: 20
6566

6667
- name: Validate results

.github/workflows/testsuite.yml

+19-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Test suite
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: ['develop']
6+
branches: ['develop', 'master']
77
paths:
8-
- .github/workflows/testsuite.yml
9-
- superdsm/**
10-
- examples/**
11-
- superdsm.yml
12-
- tests/**
13-
- requirements.txt
8+
- '.github/workflows/testsuite.yml'
9+
- 'superdsm/**'
10+
- 'examples/**'
11+
- 'superdsm.yml'
12+
- 'tests/**'
13+
- 'requirements.txt'
1414

1515
jobs:
1616

@@ -31,6 +31,9 @@ jobs:
3131
- name: Clear cache # otherwise corrupted packages can be reported sometimes
3232
run: rm -rf /github/home/conda_pkgs_dir
3333

34+
- name: Install dependencies
35+
run: apt-get update && apt-get install -y git
36+
3437
- name: Setup Miniconda
3538
uses: conda-incubator/setup-miniconda@v2
3639
with:
@@ -41,5 +44,14 @@ jobs:
4144
activate-environment: superdsm
4245
environment-file: superdsm.yml
4346

47+
- name: Export the environment
48+
run: 'conda env export | grep -v "^prefix: " > superdsm.yml'
49+
50+
- name: Save the environment as an artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: superdsm.yml
54+
path: superdsm.yml
55+
4456
- name: Run SuperDSM
4557
run: python -m "unittest"

.github/workflows/validate_pr.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,24 @@ jobs:
3131
apt-get update
3232
apt-get install -y ca-certificates
3333
34-
- uses: blend/[email protected]
34+
- name: Wait for test suite
35+
uses: blend/[email protected]
36+
if: ${{ (github.event.action == 'synchronize' || github.event.action == 'opened') && github.event.pull_request.draft == true }}
37+
with:
38+
interval: 20s
39+
timeout: 1440m
40+
checks-yaml: |
41+
- job: 'Test suite'
42+
paths:
43+
- .github/workflows/testsuite.yml
44+
- superdsm/**
45+
- examples/**
46+
- superdsm.yml
47+
- tests/**
48+
49+
- name: Wait for test suite and regression tests
50+
uses: blend/[email protected]
51+
if: ${{ (github.event.action != 'synchronize' && github.event.action != 'opened') || github.event.pull_request.draft == false }}
3552
with:
3653
interval: 20s
3754
timeout: 1440m

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/build
33
*.swp
44
.DS_Store
5+
._.DS_Store
6+
/actual_csv
7+
/examples.regression
58
/examples/**/*.csv
69
/examples/**/*.gz
710
/examples/**/.*.json
@@ -15,3 +18,5 @@
1518
/tests/data
1619
/tests/actual
1720
/tests/logs
21+
/.venv
22+
/docs/build

.isort.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[settings]
2+
3+
multi_line_output = 3
4+
5+
force_grid_wrap = 2
6+
7+
include_trailing_comma = true
8+
9+
skip_glob =
10+
superdsm/_libs/**/*.py
11+
docs/source/conf.py

.vscode/settings.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"[git-commit]": {
3+
"editor.rulers": [50]
4+
},
5+
6+
"[python]": {
7+
"editor.rulers": [119]
8+
}
9+
}

docs/source/conf.py

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
copyright = '2017-2024 Leonid Kostrykin, Biomedical Computer Vision Group, Heidelberg University'
77
author = 'Leonid Kostrykin'
88

9+
# -- Add directory which contains the project to sys.path
10+
import os, sys
11+
sys.path.insert(0, os.path.abspath('../..'))
12+
os.environ['PYTHONPATH'] = os.path.abspath('../..') + ':' + os.environ.get('PYTHONPATH', '')
13+
914
# -- General configuration
1015

1116
extensions = [
@@ -14,12 +19,14 @@
1419
'sphinx.ext.autodoc',
1520
'sphinx.ext.autosummary',
1621
'sphinx.ext.intersphinx',
22+
'sphinx.ext.napoleon',
1723
'sphinx_autorun',
1824
]
1925

2026
intersphinx_mapping = {
2127
'python': ('https://docs.python.org/3/', None),
2228
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
29+
'repype': ('https://repype.readthedocs.io/en/stable/', None),
2330
}
2431
intersphinx_disabled_domains = ['std']
2532

0 commit comments

Comments
 (0)