Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 36583ab

Browse files
author
Jackson Maxfield Brown
authored
feature/update-to-support-4.0 (#14)
* Admin updates and minor doc updates * Working w/ aicsimageio 4.0 * Doc images * Update tests to use aicsimageio download resources * Fix / ignore typings * Remove / clean some accidental commits * Add docs and napari meta, attempt plugin sort * Doc updates * Minor napari doc remove header * Trigger Build
1 parent dd26dd3 commit 36583ab

33 files changed

Lines changed: 492 additions & 184 deletions
Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
name: Build Master
1+
name: Build Main
22

33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
schedule:
88
# <minute [0,59]> <hour [0,23]> <day of the month [1,31]> <month of the year [1,12]> <day of the week [0,6]>
99
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
1010
# Run every Monday at 18:00:00 UTC (Monday at 10:00:00 PST)
11-
- cron: '0 18 * * 1'
11+
- cron: "0 18 * * 1"
1212

1313
jobs:
1414
test:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
17+
fail-fast: false
1718
matrix:
18-
python-version: [3.7, 3.8, 3.9]
19-
os: [ubuntu-latest, windows-latest, macOS-latest]
19+
python-version: [3.8, 3.9]
20+
os: [
21+
ubuntu-18.04,
22+
ubuntu-20.04,
23+
windows-latest,
24+
macOS-10.15,
25+
]
2026

2127
steps:
2228
- uses: actions/checkout@v1
@@ -28,10 +34,14 @@ jobs:
2834
run: |
2935
python -m pip install --upgrade pip
3036
pip install .[test]
37+
- name: Download Test Resources
38+
run: |
39+
python scripts/download_test_resources.py
3140
- name: Test with pytest
3241
run: |
3342
pytest --cov-report xml --cov=napari_aicsimageio napari_aicsimageio/tests/
34-
codecov -t ${{ secrets.CODECOV_TOKEN }}
43+
- name: Upload codecov
44+
uses: codecov/codecov-action@v1
3545

3646
lint:
3747
runs-on: ubuntu-latest
@@ -49,6 +59,30 @@ jobs:
4959
- name: Lint with flake8
5060
run: |
5161
flake8 napari_aicsimageio --count --verbose --show-source --statistics
52-
- name: Check with black
62+
isort napari_aicsimageio --check-only
63+
mypy napari_aicsimageio
64+
black --check --exclude vendor napari_aicsimageio
65+
66+
publish:
67+
if: "contains(github.event.head_commit.message, 'Bump version')"
68+
needs: [test, lint]
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- uses: actions/checkout@v1
73+
- name: Set up Python
74+
uses: actions/setup-python@v1
75+
with:
76+
python-version: 3.9
77+
- name: Install Dependencies
5378
run: |
54-
black --check napari_aicsimageio
79+
python -m pip install --upgrade pip
80+
pip install setuptools wheel
81+
- name: Build Package
82+
run: |
83+
python setup.py sdist bdist_wheel
84+
- name: Publish to PyPI
85+
uses: pypa/gh-action-pypi-publish@master
86+
with:
87+
user: aicspypi
88+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/publish.yml

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

.github/workflows/test-and-lint.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ jobs:
66
test:
77
runs-on: ${{ matrix.os }}
88
strategy:
9+
fail-fast: false
910
matrix:
10-
python-version: [3.7, 3.8, 3.9]
11-
os: [ubuntu-latest, windows-latest, macOS-latest]
11+
python-version: [3.8, 3.9]
12+
os: [
13+
ubuntu-18.04,
14+
ubuntu-20.04,
15+
windows-latest,
16+
macOS-10.15,
17+
]
1218

1319
steps:
1420
- uses: actions/checkout@v1
@@ -20,13 +26,17 @@ jobs:
2026
run: |
2127
python -m pip install --upgrade pip
2228
pip install .[test]
29+
- name: Download Test Resources
30+
run: |
31+
python scripts/download_test_resources.py
2332
- name: Test with pytest
2433
run: |
25-
pytest napari_aicsimageio/tests/
34+
pytest --cov-report xml --cov=napari_aicsimageio napari_aicsimageio/tests/
35+
- name: Upload codecov
36+
uses: codecov/codecov-action@v1
2637

2738
lint:
2839
runs-on: ubuntu-latest
29-
3040
steps:
3141
- uses: actions/checkout@v1
3242
- name: Set up Python
@@ -40,6 +50,6 @@ jobs:
4050
- name: Lint with flake8
4151
run: |
4252
flake8 napari_aicsimageio --count --verbose --show-source --statistics
43-
- name: Check with black
44-
run: |
45-
black --check napari_aicsimageio
53+
isort napari_aicsimageio --check-only
54+
mypy napari_aicsimageio
55+
black --check --exclude vendor napari_aicsimageio

.gitignore

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ instance/
6969
docs/_build/
7070
docs/napari_aicsimageio.*rst
7171

72+
# Dask workers
73+
dask-worker-space/
74+
7275
# PyBuilder
7376
target/
7477

@@ -81,9 +84,6 @@ target/
8184
# celery beat schedule file
8285
celerybeat-schedule
8386

84-
# Dask
85-
dask-worker-space
86-
8787
# SageMath parsed files
8888
*.sage.py
8989

@@ -99,11 +99,22 @@ ENV/
9999
.spyderproject
100100
.spyproject
101101

102+
# Pycharm project stuff
103+
.idea
102104
# Rope project settings
103105
.ropeproject
106+
# VSCode
107+
.vscode
104108

105109
# mkdocs documentation
106110
/site
107111

108112
# mypy
109113
.mypy_cache/
114+
115+
# Project specific standalone files
116+
workbench.ipynb
117+
118+
# Ignore test resources directory
119+
resources/
120+
writer_products/

.napari/DESCRIPTION.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Features
2+
* Supports reading metadata and imaging data for:
3+
* `CZI`
4+
* `OME-TIFF`
5+
* `TIFF`
6+
* Any formats supported by [aicsimageio](https://github.com/AllenCellModeling/aicsimageio)
7+
* Any additional format supported by [imageio](https://github.com/imageio/imageio)
8+
9+
### Plugin Variants
10+
11+
![screenshot of plugin sorter showing that napari-aicsimageio-in-memory should be placed above napari-aicsimageio-out-of-memory](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/plugin-sorter.png)
12+
13+
There are two variants of this plugin that are added during installation:
14+
* `aicsimageio-in-memory`, which reads an image fully into memory
15+
* `aicsimageio-out-of-memory`, which delays reading ZYX chunks until required.
16+
This allows for incredible large files to be read and displayed.
17+
18+
## Examples of Features
19+
20+
#### General Image Reading
21+
22+
All image file formats supported by
23+
[aicsimageio](https://github.com/AllenCellModeling/aicsimageio) will be read and all
24+
raw data will be available in the napari viewer.
25+
26+
In addition, when reading an OME-TIFF, you can view all OME metadata directly in the
27+
napari viewer thanks to `ome-types`.
28+
29+
![screenshot of an OME-TIFF image view, multi-channel, z-stack, with metadata viewer](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/ome-tiff-with-metadata-viewer.png)
30+
31+
#### Mosaic CZI Reading
32+
33+
When reading CZI images, if the image is a mosaic tiled image, `napari-aicsimageio`
34+
will return the reconstructed image:
35+
36+
![screenshot of a reconstructed / restitched mosaic tile CZI](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/tiled-czi.png)
37+
38+
#### Mosaic LIF Reading
39+
40+
When reading LIF images, if the image is a mosaic tiled image, `napari-aicsimageio`
41+
will return the reconstructed image:
42+
43+
![screenshot of a reconstructed / restitched mosaic tile LIF](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/tiled-lif.png)
44+
45+
## Citation
46+
47+
If you find `aicsimageio` _(or `napari-aicsimageio`)_ useful, please cite as:
48+
49+
> AICSImageIO Contributors (2021). AICSImageIO: Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Pure Python [Computer software]. GitHub. https://github.com/AllenCellModeling/aicsimageio
50+
51+
_Free software: BSD-3-Clause_

.napari/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project_urls:
2+
Bug Tracker: https://github.com/AllenCellModeling/napari-aicsimageio/issues
3+
Documentation: https://github.com/AllenCellModeling/napari-aicsimageio#README.md
4+
Source Code: https://github.com/AllenCellModeling/napari-aicsimageio
5+
User Support: https://github.com/AllenCellModeling/napari-aicsimageio/issues

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,28 @@ Ready to contribute? Here's how to set up `napari-aicsimageio` for local develop
3030
Ex: feature/read-tiff-files or bugfix/handle-file-not-found<br>
3131
Now you can make your changes locally.
3232

33-
5. When you're done making changes, check that your changes pass linting and
33+
5. Download test resources:
34+
35+
```bash
36+
python scripts/download_test_resources.py
37+
```
38+
39+
6. When you're done making changes, check that your changes pass linting and
3440
tests, including testing other Python versions with make:
3541
3642
```bash
3743
make build
3844
```
3945
40-
6. Commit your changes and push your branch to GitHub:
46+
7. Commit your changes and push your branch to GitHub:
4147
4248
```bash
4349
git add .
4450
git commit -m "Resolves gh-###. Your detailed description of your changes."
4551
git push origin {your_development_type}/short-description
4652
```
4753
48-
7. Submit a pull request through the GitHub website.
54+
8. Submit a pull request through the GitHub website.
4955
5056
## Deploying
5157
@@ -57,9 +63,6 @@ Then run:
5763
$ bumpversion patch # possible: major / minor / patch
5864
$ git push
5965
$ git push --tags
60-
git branch -D stable
61-
git checkout -b stable
62-
git push --set-upstream origin stable -f
6366
```
6467
6568
This will release a new package version on Git + GitHub and publish to PyPI.

Makefile

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
.PHONY: clean clean-test clean-pyc clean-build docs help
1+
.PHONY: clean build help
22
.DEFAULT_GOAL := help
33

4-
define BROWSER_PYSCRIPT
5-
import os, webbrowser, sys
6-
7-
try:
8-
from urllib import pathname2url
9-
except:
10-
from urllib.request import pathname2url
11-
12-
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
13-
endef
14-
export BROWSER_PYSCRIPT
15-
164
define PRINT_HELP_PYSCRIPT
175
import re, sys
186

@@ -24,8 +12,6 @@ for line in sys.stdin:
2412
endef
2513
export PRINT_HELP_PYSCRIPT
2614

27-
BROWSER := python -c "$$BROWSER_PYSCRIPT"
28-
2915
help:
3016
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
3117

@@ -34,10 +20,10 @@ clean: ## clean all build, python, and testing files
3420
rm -fr dist/
3521
rm -fr .eggs/
3622
find . -name '*.egg-info' -exec rm -fr {} +
37-
find . -name '*.egg' -exec rm -f {} +
38-
find . -name '*.pyc' -exec rm -f {} +
39-
find . -name '*.pyo' -exec rm -f {} +
40-
find . -name '*~' -exec rm -f {} +
23+
find . -name '*.egg' -exec rm -fr {} +
24+
find . -name '*.pyc' -exec rm -fr {} +
25+
find . -name '*.pyo' -exec rm -fr {} +
26+
find . -name '*~' -exec rm -fr {} +
4127
find . -name '__pycache__' -exec rm -fr {} +
4228
rm -fr .tox/
4329
rm -fr .coverage
@@ -46,14 +32,4 @@ clean: ## clean all build, python, and testing files
4632
rm -fr .pytest_cache
4733

4834
build: ## run tox / run tests and lint
49-
tox
50-
51-
gen-docs: ## generate Sphinx HTML documentation, including API docs
52-
rm -f docs/napari_aicsimageio*.rst
53-
rm -f docs/modules.rst
54-
sphinx-apidoc -o docs/ napari_aicsimageio **/tests/
55-
$(MAKE) -C docs html
56-
57-
docs: ## generate Sphinx HTML documentation, including API docs, and serve to browser
58-
make gen-docs
59-
$(BROWSER) docs/_build/html/index.html
35+
tox

0 commit comments

Comments
 (0)