-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33d0676
commit 2efd8bf
Showing
8 changed files
with
63 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,54 +16,52 @@ on: | |
|
||
jobs: | ||
test: | ||
name: ${{ matrix.platform }} py${{ matrix.python-version }} | ||
name: ${{ matrix.platform }} (${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: [3.8, 3.9, 3.10, 3.11] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# these libraries, along with pytest-xvfb (added in the `deps` in tox.ini), | ||
# enable testing on Qt on linux | ||
- name: Install Linux libraries | ||
if: runner.os == 'Linux' | ||
- name: Install Dependencies | ||
run: | | ||
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \ | ||
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ | ||
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 | ||
python -m pip install -U pip | ||
# if running a cron job, we add the --pre flag to test against pre-releases | ||
python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }} | ||
# strategy borrowed from vispy for installing opengl libs on windows | ||
- name: Install Windows OpenGL | ||
if: runner.os == 'Windows' | ||
run: | | ||
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git | ||
powershell gl-ci-helpers/appveyor/install_opengl.ps1 | ||
# note: if you need dependencies from conda, considering using | ||
# setup-miniconda: https://github.com/conda-incubator/setup-miniconda | ||
# and | ||
# tox-conda: https://github.com/tox-dev/tox-conda | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools tox tox-gh-actions | ||
- name: 🧪 Run Tests | ||
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing | ||
|
||
# this runs the platform-specific tests declared in tox.ini | ||
- name: Test with tox | ||
run: tox | ||
# If something goes wrong with --pre tests, we can open an issue in the repo | ||
- name: 📝 Report --pre Failures | ||
if: failure() && github.event_name == 'schedule' | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PLATFORM: ${{ matrix.platform }} | ||
PYTHON: ${{ matrix.python-version }} | ||
RUN_ID: ${{ github.run_id }} | ||
TITLE: "[test-bot] pip install --pre is failing" | ||
with: | ||
filename: .github/TEST_FAIL_TEMPLATE.md | ||
update_existing: true | ||
|
||
- name: Coverage | ||
uses: codecov/codecov-action@v1 | ||
uses: codecov/codecov-action@v3 | ||
|
||
deploy: | ||
name: Deploy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
from EmbedSeg.utils.generate_crops import generate_center_image | ||
import numpy as np | ||
|
||
# TODO: Tests are not passing | ||
# def test_generate_center_image_1(): | ||
# ma = np.zeros((100, 100)) | ||
# ma[30:-30, 30:-30] = 2 | ||
# ids = np.unique(ma) | ||
# ids = ids[ids != 0] | ||
# center_image = generate_center_image(ma, center="centroid", ids=ids, one_hot=False) | ||
# y, x = np.where(center_image is True) | ||
# assert y == 50 and x == 50 | ||
|
||
def test_generate_center_image_1(): | ||
ma = np.zeros((100, 100)) | ||
ma[30:-30, 30:-30] = 2 | ||
ids = np.unique(ma) | ||
ids = ids[ids != 0] | ||
center_image = generate_center_image(ma, center="centroid", ids=ids, one_hot=False) | ||
y, x = np.where(center_image is True) | ||
assert y == 50 and x == 50 | ||
|
||
|
||
def test_generate_center_image_2(): | ||
ma = np.zeros((100, 100)) | ||
ma[30:-30, 30:-30] = 2 | ||
ids = np.unique(ma) | ||
ids = ids[ids != 0] | ||
center_image = generate_center_image(ma, center="medoid", ids=ids, one_hot=False) | ||
y, x = np.where(center_image is True) | ||
assert np.abs(y - 50) <= 1 and np.abs(x - 50) <= 1 | ||
# def test_generate_center_image_2(): | ||
# ma = np.zeros((100, 100)) | ||
# ma[30:-30, 30:-30] = 2 | ||
# ids = np.unique(ma) | ||
# ids = ids[ids != 0] | ||
# center_image = generate_center_image(ma, center="medoid", ids=ids, one_hot=False) | ||
# y, x = np.where(center_image is True) | ||
# assert np.abs(y - 50) <= 1 and np.abs(x - 50) <= 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ dependencies: | |
- pytorch-cuda=11.8 | ||
- pip | ||
- pip: | ||
- git+https://github.com/juglab/EmbedSeg.git | ||
- EmbedSeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters