-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from JaneliaSciComp/use-hatch
Use hatch
- Loading branch information
Showing
29 changed files
with
709 additions
and
1,913 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 |
---|---|---|
|
@@ -42,3 +42,6 @@ pip-wheel-metadata | |
|
||
# numba | ||
*/__pycache__/* | ||
|
||
# docs | ||
site |
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,33 @@ | ||
ci: | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
autofix_commit_msg: "style: pre-commit fixes" | ||
autofix_prs: false | ||
default_stages: [commit, push] | ||
default_language_version: | ||
python: python3 | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: 'v0.5.4' | ||
hooks: | ||
- id: black | ||
language_version: python3.9 | ||
- id: ruff | ||
args: ["--fix", "--show-fixes"] | ||
- id: ruff-format | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-yaml | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
# Ruff version. | ||
rev: 'v0.0.245' | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.11.0 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: mypy | ||
files: src | ||
additional_dependencies: | ||
- numpy | ||
- typing_extensions | ||
# Tests | ||
- pytest |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# xarray-multiscale | ||
|
||
Simple tools for creating multiscale representations of large images. | ||
|
||
## Installation | ||
|
||
`pip install xarray-multiscale` | ||
|
||
## Motivation | ||
|
||
Many image processing applications benefit from representing images at multiple scales (also known as [image pyramids] (https://en.wikipedia.org/wiki/Pyramid_(image_processing)). This package provides tools for generating lazy multiscale representations of N-dimensional data using [`xarray`](http://xarray.pydata.org/en/stable/) to ensure that the downsampled images have the correct axis coordinates. | ||
|
||
Why are coordinates important for this application? Because a downsampled image is typically scaled and *translated* relative to the source image. Without a coordinate-aware representation of the data, the scaling and translation information is easily lost. | ||
|
||
|
||
## Usage | ||
|
||
Generate a multiscale representation of a numpy array: | ||
|
||
```python | ||
from xarray_multiscale import multiscale, windowed_mean | ||
import numpy as np | ||
|
||
data = np.arange(4) | ||
print(*multiscale(data, windowed_mean, 2), sep='\n') | ||
""" | ||
<xarray.DataArray 's0' (dim_0: 4)> Size: 32B | ||
array([0, 1, 2, 3]) | ||
Coordinates: | ||
* dim_0 (dim_0) float64 32B 0.0 1.0 2.0 3.0 | ||
<xarray.DataArray 's1' (dim_0: 2)> Size: 16B | ||
array([0, 2]) | ||
Coordinates: | ||
* dim_0 (dim_0) float64 16B 0.5 2.5 | ||
""" | ||
``` | ||
|
||
read more in the [project documentation](https://JaneliaSciComp.github.io/xarray-multiscale/). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
::: xarray_multiscale.chunks |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
::: xarray_multiscale.multiscale |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
::: xarray_multiscale.reducers |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
::: xarray_multiscale.util |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.