Skip to content

Commit

Permalink
Merge pull request #26 from BMCV/develop
Browse files Browse the repository at this point in the history
Update to v0.4.0
  • Loading branch information
kostrykin authored Sep 19, 2024
2 parents 47c3bce + c00893b commit e251fc0
Show file tree
Hide file tree
Showing 118 changed files with 3,062 additions and 3,523 deletions.
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.8",
"image": "mcr.microsoft.com/devcontainers/python:0-3.11",
"containerEnv": {
"DOCKER_DEFAULT_PLATFORM": "linux/amd64"
},

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

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

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"python.analysis.extraPaths": ["/home/vscode/.local/lib/python3.8/site-packages"]
"python.analysis.extraPaths": ["/home/vscode/.local/lib/python3.11/site-packages"]
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]

max-line-length = 120

extend-ignore = E221,E211,E222,E202,F541,E201,E203,E125,E272

per-file-ignores =
superdsm/__init__.py:F401

exclude = superdsm/_libs/**/*.py docs/source/conf.py
33 changes: 33 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Linters

on:
workflow_dispatch:
pull_request:
branches: ['*']

jobs:

run_linters:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 isort
- name: Run linters
run: |
flake8 superdsm
flake8 tests
isort superdsm --check-only --diff
isort tests --check-only --diff
9 changes: 5 additions & 4 deletions .github/workflows/regressiontests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Regression tests
on:
workflow_dispatch:
pull_request:
branches: ['develop']
branches: ['develop', 'master']
paths:
- .github/workflows/regressiontests.yml
- superdsm/**
Expand All @@ -16,6 +16,7 @@ jobs:

regression_tests:
name: "Test: ${{ matrix.taskdir }}"
if: ${{ (github.event.action != 'synchronize' && github.event.action != 'opened') || github.event.pull_request.draft == false }}
timeout-minutes: 1440
runs-on: gpuagrohr-01
container:
Expand Down Expand Up @@ -57,10 +58,10 @@ jobs:
- name: Run SuperDSM
run: |
python -m "superdsm.batch" examples --task-dir "${{ matrix.taskdir }}"
python -m "superdsm.batch" examples --task-dir "${{ matrix.taskdir }}" --run
python -m "superdsm" examples --task-dir "examples/${{ matrix.taskdir }}"
python -m "superdsm" examples --task-dir "examples/${{ matrix.taskdir }}" --run
env:
SUPERDSM_INTERMEDIATE_OUTPUT: false
REPYPE_CLI_INTERMEDIATE: false
SUPERDSM_NUM_CPUS: 20

- name: Validate results
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Test suite
on:
workflow_dispatch:
pull_request:
branches: ['develop']
branches: ['develop', 'master']
paths:
- .github/workflows/testsuite.yml
- superdsm/**
- examples/**
- superdsm.yml
- tests/**
- requirements.txt
- '.github/workflows/testsuite.yml'
- 'superdsm/**'
- 'examples/**'
- 'superdsm.yml'
- 'tests/**'
- 'requirements.txt'

jobs:

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

- name: Install dependencies
run: apt-get update && apt-get install -y git

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -41,5 +44,14 @@ jobs:
activate-environment: superdsm
environment-file: superdsm.yml

- name: Export the environment
run: 'conda env export | grep -v "^prefix: " > superdsm.yml'

- name: Save the environment as an artifact
uses: actions/upload-artifact@v4
with:
name: superdsm.yml
path: superdsm.yml

- name: Run SuperDSM
run: python -m "unittest"
19 changes: 18 additions & 1 deletion .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,24 @@ jobs:
apt-get update
apt-get install -y ca-certificates
- uses: blend/[email protected]
- name: Wait for test suite
uses: blend/[email protected]
if: ${{ (github.event.action == 'synchronize' || github.event.action == 'opened') && github.event.pull_request.draft == true }}
with:
interval: 20s
timeout: 1440m
checks-yaml: |
- job: 'Test suite'
paths:
- .github/workflows/testsuite.yml
- superdsm/**
- examples/**
- superdsm.yml
- tests/**
- name: Wait for test suite and regression tests
uses: blend/[email protected]
if: ${{ (github.event.action != 'synchronize' && github.event.action != 'opened') || github.event.pull_request.draft == false }}
with:
interval: 20s
timeout: 1440m
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/build
*.swp
.DS_Store
._.DS_Store
/actual_csv
/examples.regression
/examples/**/*.csv
/examples/**/*.gz
/examples/**/.*.json
Expand All @@ -15,3 +18,5 @@
/tests/data
/tests/actual
/tests/logs
/.venv
/docs/build
11 changes: 11 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[settings]

multi_line_output = 3

force_grid_wrap = 2

include_trailing_comma = true

skip_glob =
superdsm/_libs/**/*.py
docs/source/conf.py
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"[git-commit]": {
"editor.rulers": [50]
},

"[python]": {
"editor.rulers": [119]
}
}
7 changes: 7 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
copyright = '2017-2024 Leonid Kostrykin, Biomedical Computer Vision Group, Heidelberg University'
author = 'Leonid Kostrykin'

# -- Add directory which contains the project to sys.path
import os, sys
sys.path.insert(0, os.path.abspath('../..'))
os.environ['PYTHONPATH'] = os.path.abspath('../..') + ':' + os.environ.get('PYTHONPATH', '')

# -- General configuration

extensions = [
Expand All @@ -14,12 +19,14 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx_autorun',
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
'repype': ('https://repype.readthedocs.io/en/stable/', None),
}
intersphinx_disabled_domains = ['std']

Expand Down
Loading

0 comments on commit e251fc0

Please sign in to comment.