Skip to content

Commit 6ce87f6

Browse files
authored
Merge pull request #429 from Dana-Farber-AIOS/dev
PathML 3.0.0: New Features and User Experience Improvements
2 parents f86c5c6 + 58c8f6a commit 6ce87f6

File tree

116 files changed

+15009
-2455
lines changed

Some content is hidden

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

116 files changed

+15009
-2455
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/testdata/tilestitching_testdata/*.tif filter=lfs diff=lfs merge=lfs -text

.github/workflows/precommit-hooks.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ name: pre-commit-hooks
33
on: [pull_request]
44

55
jobs:
6-
build:
6+
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python 3.8
11-
uses: actions/setup-python@v1
12-
with:
13-
python-version: 3.8
14-
- name: Linting
15-
run: |
16-
pip install pre-commit
17-
pre-commit run --all-files
9+
- uses: actions/checkout@v3
10+
- uses: psf/black@stable
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v3
16+
- uses: pre-commit/action@v3.0.0
17+
with:
18+
extra_args: flake8 --all-files

.github/workflows/publish-to-docker-hub.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
password: ${{ secrets.DOCKERHUB_TOKEN }}
2828
- name: Build and push
2929
id: docker_build
30-
uses: docker/build-push-action@v2.7.0
30+
uses: docker/build-push-action@v4
3131
with:
3232
context: .
33+
platforms: linux/amd64,linux/arm64
3334
push: true
3435
tags: |
3536
pathml/pathml:latest

.github/workflows/tests-conda.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/tests-linux.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Tests linux
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
- master
9+
push:
10+
branches:
11+
- dev
12+
- master
13+
14+
jobs:
15+
build-linux:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
max-parallel: 5
19+
matrix:
20+
python-version: ["3.8", "3.9", "3.10"]
21+
timeout-minutes: 60 # add a timeout
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Display Python version
30+
run: python -c "import sys; print(sys.version)"
31+
- name: Install dependencies
32+
shell: bash -l {0}
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install openslide-tools
36+
sudo apt-get install pandoc
37+
- name: Setup Micromamba
38+
uses: mamba-org/setup-micromamba@v1
39+
with:
40+
micromamba-version: '1.5.6-0'
41+
environment-name: pathml
42+
environment-file: requirements/environment_test.yml
43+
init-shell: >-
44+
bash
45+
create-args: >-
46+
python=${{ matrix.python-version }}
47+
- name: Debugging
48+
run: |
49+
echo "Printing the environment.yml file..."
50+
cat requirements/environment_test.yml
51+
echo "Checking the status of micro mamba..."
52+
micromamba config
53+
echo "Checking the available disk space..."
54+
df -h
55+
56+
# - name: Install dependencies with micromamba
57+
# shell: bash -l {0}
58+
# run: micromamba env update --file requirements/environment_test.yml --name pathml
59+
60+
- name: Micromamba info
61+
shell: bash -l {0}
62+
run: |
63+
micromamba info
64+
micromamba config
65+
micromamba list
66+
67+
- name: Set default Temurin JDK 17
68+
run: |
69+
sudo update-java-alternatives --set temurin-17-jdk-amd64 || true
70+
java -version
71+
72+
- name: Install PathML
73+
shell: bash -l {0}
74+
run: pip install -e .
75+
76+
- name: Install torchvision
77+
shell: bash -l {0}
78+
run: pip install torchvision==0.14.1
79+
80+
- name: disk usage
81+
shell: bash -l {0}
82+
run: |
83+
sudo df -h
84+
sudo du -h
85+
86+
- name: free disk space
87+
run: |
88+
sudo swapoff -a
89+
sudo rm -f /swapfile
90+
sudo apt clean
91+
docker rmi $(docker image ls -aq)
92+
sudo df -h
93+
sudo du -h
94+
95+
# - name: Check Coverage Command
96+
# run: |
97+
# which coverage
98+
# coverage --version
99+
100+
# - name: Test with pytest for tile_stitcher
101+
# run: |
102+
# java -version
103+
# python -m pytest tests/preprocessing_tests/test_tilestitcher.py
104+
105+
# - name: Test with pytest and generate coverage report
106+
# shell: bash -l {0}
107+
# run: |
108+
# coverage run -m pytest -m "not slow and not exclude"
109+
# coverage xml
110+
# - name: Upload coverage to Codecov
111+
# uses: codecov/codecov-action@v2
112+
# with:
113+
# token: ${{ secrets.CODECOV_TOKEN }}
114+
# env_vars: OS,PYTHON
115+
# fail_ci_if_error: true
116+
# files: ./coverage.xml
117+
# name: codecov-umbrella
118+
# verbose: true
119+
120+
- name: Test other modules with pytest and generate coverage
121+
shell: bash -l {0}
122+
run: |
123+
COVERAGE_FILE=.coverage_others coverage run -m pytest -m "not slow and not exclude"
124+
125+
- name: Test tile_stitcher with pytest and generate coverage
126+
shell: bash -l {0}
127+
run: |
128+
COVERAGE_FILE=.coverage_tilestitcher coverage run -m pytest tests/preprocessing_tests/test_tilestitcher.py
129+
130+
- name: List Files in Directory
131+
shell: bash -l {0}
132+
run: |
133+
ls -la
134+
135+
- name: Combine Coverage Data
136+
shell: bash -l {0}
137+
run: |
138+
coverage combine .coverage_tilestitcher .coverage_others
139+
140+
- name: Generate Combined Coverage Report
141+
shell: bash -l {0}
142+
run: |
143+
coverage xml -o combined_coverage.xml
144+
145+
# - name: Combine coverage data
146+
# shell: bash -l {0}
147+
# run: |
148+
# coverage combine coverage_tilestitcher.xml coverage_others.xml
149+
# coverage xml -o coverage_combined.xml
150+
151+
- name: Upload combined coverage to Codecov
152+
uses: codecov/codecov-action@v2
153+
with:
154+
token: ${{ secrets.CODECOV_TOKEN }}
155+
env_vars: OS,PYTHON
156+
fail_ci_if_error: true
157+
files: ./combined_coverage.xml
158+
name: codecov-umbrella
159+
verbose: true
160+
161+
- name: Compile docs
162+
shell: bash -l {0}
163+
run: |
164+
cd docs
165+
pip install -r readthedocs-requirements.txt
166+
make html

.github/workflows/tests-macos.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Tests MacOS
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev_graph
8+
push:
9+
branches:
10+
- dev_graph
11+
12+
jobs:
13+
build:
14+
name: Build (${{ matrix.os }}, Python ${{ matrix.python-version }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [macos-latest]
20+
python-version: ["3.8", "3.9", "3.10"]
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Install openslide
26+
shell: bash -l {0}
27+
run: brew install openslide
28+
29+
30+
- name: Setup Micromamba
31+
uses: mamba-org/setup-micromamba@v1
32+
with:
33+
micromamba-version: '1.5.6-0'
34+
environment-name: pathml
35+
environment-file: requirements/environment_mac.yml
36+
init-shell: >-
37+
bash
38+
create-args: >-
39+
python=${{ matrix.python-version }}
40+
41+
42+
- name: Micromamba info
43+
shell: bash -l {0}
44+
run: |
45+
micromamba info
46+
micromamba config
47+
micromamba list
48+
49+
- name: Set default Temurin JDK 17
50+
run: |
51+
sudo update-java-alternatives --set temurin-17-jdk-amd64 || true
52+
java -version
53+
54+
- name: Install PathML
55+
shell: bash -l {0}
56+
run: pip install -e .
57+
58+
- name: Install torchvision
59+
shell: bash -l {0}
60+
run: pip install torchvision==0.14.1
61+
62+
- name: Test other modules with pytest and generate coverage
63+
shell: bash -l {0}
64+
run: |
65+
COVERAGE_FILE=.coverage_others coverage run -m pytest -m "not slow and not exclude"
66+
67+
- name: Test tile_stitcher with pytest and generate coverage
68+
shell: bash -l {0}
69+
run: |
70+
COVERAGE_FILE=.coverage_tilestitcher coverage run -m pytest tests/preprocessing_tests/test_tilestitcher.py

0 commit comments

Comments
 (0)