Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hatch #21

Merged
merged 7 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ pip-wheel-metadata

# numba
*/__pycache__/*

# docs
site
31 changes: 21 additions & 10 deletions .pre-commit-config.yaml
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
39 changes: 39 additions & 0 deletions README.md
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/).
144 changes: 0 additions & 144 deletions README.rst

This file was deleted.

19 changes: 0 additions & 19 deletions docs/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions docs/api/chunks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xarray_multiscale.chunks
1 change: 1 addition & 0 deletions docs/api/multiscale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xarray_multiscale.multiscale
1 change: 1 addition & 0 deletions docs/api/reducers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xarray_multiscale.reducers
1 change: 1 addition & 0 deletions docs/api/util.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: xarray_multiscale.util
63 changes: 0 additions & 63 deletions docs/conf.py

This file was deleted.

Loading