Skip to content

Commit

Permalink
feature/update-to-support-4.0 (#14)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Jackson Maxfield Brown authored Jun 29, 2021
1 parent dd26dd3 commit 36583ab
Show file tree
Hide file tree
Showing 33 changed files with 492 additions and 184 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
name: Build Master
name: Build Main

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

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.8, 3.9]
os: [
ubuntu-18.04,
ubuntu-20.04,
windows-latest,
macOS-10.15,
]

steps:
- uses: actions/checkout@v1
Expand All @@ -28,10 +34,14 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Download Test Resources
run: |
python scripts/download_test_resources.py
- name: Test with pytest
run: |
pytest --cov-report xml --cov=napari_aicsimageio napari_aicsimageio/tests/
codecov -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload codecov
uses: codecov/codecov-action@v1

lint:
runs-on: ubuntu-latest
Expand All @@ -49,6 +59,30 @@ jobs:
- name: Lint with flake8
run: |
flake8 napari_aicsimageio --count --verbose --show-source --statistics
- name: Check with black
isort napari_aicsimageio --check-only
mypy napari_aicsimageio
black --check --exclude vendor napari_aicsimageio
publish:
if: "contains(github.event.head_commit.message, 'Bump version')"
needs: [test, lint]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install Dependencies
run: |
black --check napari_aicsimageio
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build Package
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: aicspypi
password: ${{ secrets.PYPI_TOKEN }}
28 changes: 0 additions & 28 deletions .github/workflows/publish.yml

This file was deleted.

24 changes: 17 additions & 7 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.8, 3.9]
os: [
ubuntu-18.04,
ubuntu-20.04,
windows-latest,
macOS-10.15,
]

steps:
- uses: actions/checkout@v1
Expand All @@ -20,13 +26,17 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Download Test Resources
run: |
python scripts/download_test_resources.py
- name: Test with pytest
run: |
pytest napari_aicsimageio/tests/
pytest --cov-report xml --cov=napari_aicsimageio napari_aicsimageio/tests/
- name: Upload codecov
uses: codecov/codecov-action@v1

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python
Expand All @@ -40,6 +50,6 @@ jobs:
- name: Lint with flake8
run: |
flake8 napari_aicsimageio --count --verbose --show-source --statistics
- name: Check with black
run: |
black --check napari_aicsimageio
isort napari_aicsimageio --check-only
mypy napari_aicsimageio
black --check --exclude vendor napari_aicsimageio
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ instance/
docs/_build/
docs/napari_aicsimageio.*rst

# Dask workers
dask-worker-space/

# PyBuilder
target/

Expand All @@ -81,9 +84,6 @@ target/
# celery beat schedule file
celerybeat-schedule

# Dask
dask-worker-space

# SageMath parsed files
*.sage.py

Expand All @@ -99,11 +99,22 @@ ENV/
.spyderproject
.spyproject

# Pycharm project stuff
.idea
# Rope project settings
.ropeproject
# VSCode
.vscode

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Project specific standalone files
workbench.ipynb

# Ignore test resources directory
resources/
writer_products/
51 changes: 51 additions & 0 deletions .napari/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Features
* Supports reading metadata and imaging data for:
* `CZI`
* `OME-TIFF`
* `TIFF`
* Any formats supported by [aicsimageio](https://github.com/AllenCellModeling/aicsimageio)
* Any additional format supported by [imageio](https://github.com/imageio/imageio)

### Plugin Variants

![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)

There are two variants of this plugin that are added during installation:
* `aicsimageio-in-memory`, which reads an image fully into memory
* `aicsimageio-out-of-memory`, which delays reading ZYX chunks until required.
This allows for incredible large files to be read and displayed.

## Examples of Features

#### General Image Reading

All image file formats supported by
[aicsimageio](https://github.com/AllenCellModeling/aicsimageio) will be read and all
raw data will be available in the napari viewer.

In addition, when reading an OME-TIFF, you can view all OME metadata directly in the
napari viewer thanks to `ome-types`.

![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)

#### Mosaic CZI Reading

When reading CZI images, if the image is a mosaic tiled image, `napari-aicsimageio`
will return the reconstructed image:

![screenshot of a reconstructed / restitched mosaic tile CZI](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/tiled-czi.png)

#### Mosaic LIF Reading

When reading LIF images, if the image is a mosaic tiled image, `napari-aicsimageio`
will return the reconstructed image:

![screenshot of a reconstructed / restitched mosaic tile LIF](https://github.com/AllenCellModeling/napari-aicsimageio/tree/main/images/tiled-lif.png)

## Citation

If you find `aicsimageio` _(or `napari-aicsimageio`)_ useful, please cite as:

> 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
_Free software: BSD-3-Clause_
5 changes: 5 additions & 0 deletions .napari/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project_urls:
Bug Tracker: https://github.com/AllenCellModeling/napari-aicsimageio/issues
Documentation: https://github.com/AllenCellModeling/napari-aicsimageio#README.md
Source Code: https://github.com/AllenCellModeling/napari-aicsimageio
User Support: https://github.com/AllenCellModeling/napari-aicsimageio/issues
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ Ready to contribute? Here's how to set up `napari-aicsimageio` for local develop
Ex: feature/read-tiff-files or bugfix/handle-file-not-found<br>
Now you can make your changes locally.

5. When you're done making changes, check that your changes pass linting and
5. Download test resources:

```bash
python scripts/download_test_resources.py
```

6. When you're done making changes, check that your changes pass linting and
tests, including testing other Python versions with make:
```bash
make build
```
6. Commit your changes and push your branch to GitHub:
7. Commit your changes and push your branch to GitHub:
```bash
git add .
git commit -m "Resolves gh-###. Your detailed description of your changes."
git push origin {your_development_type}/short-description
```
7. Submit a pull request through the GitHub website.
8. Submit a pull request through the GitHub website.
## Deploying
Expand All @@ -57,9 +63,6 @@ Then run:
$ bumpversion patch # possible: major / minor / patch
$ git push
$ git push --tags
git branch -D stable
git checkout -b stable
git push --set-upstream origin stable -f
```
This will release a new package version on Git + GitHub and publish to PyPI.
36 changes: 6 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
.PHONY: clean clean-test clean-pyc clean-build docs help
.PHONY: clean build help
.DEFAULT_GOAL := help

define BROWSER_PYSCRIPT
import os, webbrowser, sys

try:
from urllib import pathname2url
except:
from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT

define PRINT_HELP_PYSCRIPT
import re, sys

Expand All @@ -24,8 +12,6 @@ for line in sys.stdin:
endef
export PRINT_HELP_PYSCRIPT

BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

Expand All @@ -34,10 +20,10 @@ clean: ## clean all build, python, and testing files
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '*.egg' -exec rm -fr {} +
find . -name '*.pyc' -exec rm -fr {} +
find . -name '*.pyo' -exec rm -fr {} +
find . -name '*~' -exec rm -fr {} +
find . -name '__pycache__' -exec rm -fr {} +
rm -fr .tox/
rm -fr .coverage
Expand All @@ -46,14 +32,4 @@ clean: ## clean all build, python, and testing files
rm -fr .pytest_cache

build: ## run tox / run tests and lint
tox

gen-docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/napari_aicsimageio*.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ napari_aicsimageio **/tests/
$(MAKE) -C docs html

docs: ## generate Sphinx HTML documentation, including API docs, and serve to browser
make gen-docs
$(BROWSER) docs/_build/html/index.html
tox
Loading

0 comments on commit 36583ab

Please sign in to comment.