Skip to content

Commit

Permalink
Code release v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mathpluscode committed Sep 1, 2023
1 parent 1409624 commit b9af090
Show file tree
Hide file tree
Showing 175 changed files with 13,699 additions and 6,217 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.9"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
name: unit-test

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
push:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.8"]
group: [1, 2, 3, 4]
python-version: ["3.9"]

steps:
- name: Checkout repository
Expand All @@ -37,11 +31,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tensorflow-cpu==2.11.0
pip install jax==0.4.1
pip install jaxlib==0.4.1
pip install tensorflow-cpu==2.12.0
pip install jax==0.4.8
pip install jaxlib==0.4.7
pip install -r docker/requirements.txt
pip install -e .
pip install -e imgx
pip install -e imgx_datasets
- name: Test with pytest
run: |
pytest tests/unit
pytest --splits 4 --group ${{ matrix.group }} --randomly-seed=0 -k "not slow" imgx/tests/unit
pytest --splits 4 --group ${{ matrix.group }} --randomly-seed=0 -k "not slow" imgx_datasets/tests
38 changes: 29 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,37 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.7.0
hooks:
- id: black
args:
- --line-length=80
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
hooks:
rev: v1.4.1
hooks: # https://github.com/python/mypy/issues/4008#issuecomment-582458665
- id: mypy
name: mypy-imgx
files: ^imgx/
entry: mypy imgx/
pass_filenames: false
args:
[
--strict-equality,
--disallow-untyped-calls,
--disallow-untyped-defs,
--disallow-incomplete-defs,
--check-untyped-defs,
--disallow-untyped-decorators,
--warn-redundant-casts,
--warn-unused-ignores,
--no-warn-no-return,
--warn-unreachable,
]
- id: mypy
name: mypy-imgx_datasets
files: ^imgx_datasets/
entry: mypy imgx_datasets/
pass_filenames: false
args:
[
--strict-equality,
Expand All @@ -50,29 +72,27 @@ repos:
--warn-unreachable,
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0
hooks:
- id: prettier
args:
- --print-width=80
- --prose-wrap=always
- --tab-width=2
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.254"
rev: "v0.0.280"
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a5
hooks:
- id: pylint
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.9.0
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py37-plus
- --py38-plus
- --py39-plus
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pip:
pip install -e imgx
pip install -e imgx_datasets

test:
pytest --cov=imgx -n 4 imgx/tests -x
pytest --cov=imgx_datasets -n 4 imgx_datasets/tests -x

build_dataset:
tfds build imgx_datasets/imgx_datasets/male_pelvic_mr &
tfds build imgx_datasets/imgx_datasets/amos_ct &
tfds build imgx_datasets/imgx_datasets/muscle_us &
tfds build imgx_datasets/imgx_datasets/brats2021_mr &

rebuild_dataset:
tfds build imgx_datasets/imgx_datasets/male_pelvic_mr --overwrite &
tfds build imgx_datasets/imgx_datasets/amos_ct --overwrite &
tfds build imgx_datasets/imgx_datasets/muscle_us --overwrite &
tfds build imgx_datasets/imgx_datasets/brats2021_mr --overwrite &
Loading

0 comments on commit b9af090

Please sign in to comment.