Skip to content

Commit fa3b9e7

Browse files
committed
package structure; change license MIT -> BDS3
1 parent eba28cb commit fa3b9e7

39 files changed

+1700
-19
lines changed

.codecov.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Based on pydata/xarray
2+
codecov:
3+
require_ci_to_pass: no
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
# Require 1% coverage, i.e., always succeed
10+
target: 1
11+
patch: false
12+
changes: false
13+
14+
comment:
15+
layout: diff, flags, files
16+
behavior: once
17+
require_base: no

.cruft.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"template": "https://github.com/scverse/cookiecutter-scverse",
3+
"commit": "a370e73f7e342f377fee8e902111bbe2bca30b3b",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"project_name": "ngff-transformations",
8+
"package_name": "ngff_transformations",
9+
"project_description": "Apply and manipulate NGFF coordinate transformations",
10+
"author_full_name": "Luca Marconato",
11+
"author_email": "luca.marconato@scverse.org",
12+
"github_user": "BioImageTools",
13+
"github_repo": "ngff-transformations",
14+
"license": "BSD 3-Clause License",
15+
"ide_integration": false,
16+
"_copy_without_render": [
17+
".github/workflows/build.yaml",
18+
".github/workflows/test.yaml",
19+
"docs/_templates/autosummary/**.rst"
20+
],
21+
"_exclude_on_template_update": [
22+
"CHANGELOG.md",
23+
"LICENSE",
24+
"README.md",
25+
"docs/api.md",
26+
"docs/index.md",
27+
"docs/notebooks/example.ipynb",
28+
"docs/references.bib",
29+
"docs/references.md",
30+
"src/**",
31+
"tests/**"
32+
],
33+
"_render_devdocs": false,
34+
"_jinja2_env_vars": {
35+
"lstrip_blocks": true,
36+
"trim_blocks": true
37+
},
38+
"_template": "https://github.com/scverse/cookiecutter-scverse",
39+
"_commit": "a370e73f7e342f377fee8e902111bbe2bca30b3b"
40+
}
41+
},
42+
"directory": null
43+
}

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{*.{yml,yaml,toml},.cruft.json}]
12+
indent_size = 2
13+
14+
[Makefile]
15+
indent_style = tab
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Bug report
2+
description: Report something that is broken or incorrect
3+
labels: bug
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports)
9+
detailing how to provide the necessary information for us to reproduce your bug. In brief:
10+
* Please provide exact steps how to reproduce the bug in a clean Python environment.
11+
* In case it's not clear what's causing this bug, please provide the data or the data generation procedure.
12+
* Sometimes it is not possible to share the data, but usually it is possible to replicate problems on publicly
13+
available datasets or to share a subset of your data.
14+
15+
- type: textarea
16+
id: report
17+
attributes:
18+
label: Report
19+
description: A clear and concise description of what the bug is.
20+
validations:
21+
required: true
22+
23+
- type: textarea
24+
id: versions
25+
attributes:
26+
label: Versions
27+
description: |
28+
Which version of packages.
29+
30+
Please install `session-info2`, run the following command in a notebook,
31+
click the “Copy as Markdown” button, then paste the results into the text box below.
32+
33+
```python
34+
In[1]: import session_info2; session_info2.session_info(dependencies=True)
35+
```
36+
37+
Alternatively, run this in a console:
38+
39+
```python
40+
>>> import session_info2; print(session_info2.session_info(dependencies=True)._repr_mimebundle_()["text/markdown"])
41+
```
42+
render: python
43+
placeholder: |
44+
anndata 0.11.3
45+
---- ----
46+
charset-normalizer 3.4.1
47+
coverage 7.7.0
48+
psutil 7.0.0
49+
dask 2024.7.1
50+
jaraco.context 5.3.0
51+
numcodecs 0.15.1
52+
jaraco.functools 4.0.1
53+
Jinja2 3.1.6
54+
sphinxcontrib-jsmath 1.0.1
55+
sphinxcontrib-htmlhelp 2.1.0
56+
toolz 1.0.0
57+
session-info2 0.1.2
58+
PyYAML 6.0.2
59+
llvmlite 0.44.0
60+
scipy 1.15.2
61+
pandas 2.2.3
62+
sphinxcontrib-devhelp 2.0.0
63+
h5py 3.13.0
64+
tblib 3.0.0
65+
setuptools-scm 8.2.0
66+
more-itertools 10.3.0
67+
msgpack 1.1.0
68+
sparse 0.15.5
69+
wrapt 1.17.2
70+
jaraco.collections 5.1.0
71+
numba 0.61.0
72+
pyarrow 19.0.1
73+
pytz 2025.1
74+
MarkupSafe 3.0.2
75+
crc32c 2.7.1
76+
sphinxcontrib-qthelp 2.0.0
77+
sphinxcontrib-serializinghtml 2.0.0
78+
zarr 2.18.4
79+
asciitree 0.3.3
80+
six 1.17.0
81+
sphinxcontrib-applehelp 2.0.0
82+
numpy 2.1.3
83+
cloudpickle 3.1.1
84+
sphinxcontrib-bibtex 2.6.3
85+
natsort 8.4.0
86+
jaraco.text 3.12.1
87+
setuptools 76.1.0
88+
Deprecated 1.2.18
89+
packaging 24.2
90+
python-dateutil 2.9.0.post0
91+
---- ----
92+
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0]
93+
OS Linux-6.11.0-109019-tuxedo-x86_64-with-glibc2.39
94+
Updated 2025-03-18 15:47

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Scverse Community Forum
4+
url: https://discourse.scverse.org/
5+
about: If you have questions about “How to do X”, please ask them here.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Feature request
2+
description: Propose a new feature for ngff-transformations
3+
labels: enhancement
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description of feature
9+
description: Please describe your suggestion for a new feature. It might help to describe a problem or use case, plus any alternatives that you have considered.
10+
validations:
11+
required: true

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
package:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
with:
19+
filter: blob:none
20+
fetch-depth: 0
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
- name: Build package
24+
run: uv build
25+
- name: Check package
26+
run: uvx twine check --strict dist/*.whl

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# Use "trusted publishing", see https://docs.pypi.org/trusted-publishers/
8+
jobs:
9+
release:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/ngff_transformations
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
filter: blob:none
21+
fetch-depth: 0
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
24+
- name: Build package
25+
run: uv build
26+
- name: Publish package distributions to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 5 1,15 * *"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
# Get the test environment from hatch as defined in pyproject.toml.
17+
# This ensures that the pyproject.toml is the single point of truth for test definitions and the same tests are
18+
# run locally and on continuous integration.
19+
# Check [[tool.hatch.envs.hatch-test.matrix]] in pyproject.toml and https://hatch.pypa.io/latest/environment/ for
20+
# more details.
21+
get-environments:
22+
runs-on: ubuntu-latest
23+
outputs:
24+
envs: ${{ steps.get-envs.outputs.envs }}
25+
steps:
26+
- uses: actions/checkout@v5
27+
with:
28+
filter: blob:none
29+
fetch-depth: 0
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v7
32+
- name: Get test environments
33+
id: get-envs
34+
run: |
35+
ENVS_JSON=$(uvx hatch env show --json | jq -c 'to_entries
36+
| map(
37+
select(.key | startswith("hatch-test"))
38+
| {
39+
name: .key,
40+
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
41+
python: .value.python
42+
}
43+
)')
44+
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
45+
46+
# Run tests through hatch. Spawns a separate runner for each environment defined in the hatch matrix obtained above.
47+
test:
48+
needs: get-environments
49+
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
os: [ubuntu-latest]
54+
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
55+
56+
name: ${{ matrix.env.label }}
57+
runs-on: ${{ matrix.os }}
58+
59+
steps:
60+
- uses: actions/checkout@v5
61+
with:
62+
filter: blob:none
63+
fetch-depth: 0
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v7
66+
with:
67+
python-version: ${{ matrix.env.python }}
68+
- name: create hatch environment
69+
run: uvx hatch env create ${{ matrix.env.name }}
70+
- name: run tests using hatch
71+
env:
72+
MPLBACKEND: agg
73+
PLATFORM: ${{ matrix.os }}
74+
DISPLAY: :42
75+
run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto
76+
- name: generate coverage report
77+
run: |
78+
# See https://coverage.readthedocs.io/en/latest/config.html#run-patch
79+
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
80+
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
81+
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
82+
- name: Upload coverage
83+
uses: codecov/codecov-action@v5
84+
85+
# Check that all tests defined above pass. This makes it easy to set a single "required" test in branch
86+
# protection instead of having to update it frequently. See https://github.com/re-actors/alls-green#why.
87+
check:
88+
name: Tests pass in all hatch environments
89+
if: always()
90+
needs:
91+
- get-environments
92+
- test
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: re-actors/alls-green@release/v1
96+
with:
97+
jobs: ${{ toJSON(needs) }}

.gitignore

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# Temp files
12
.DS_Store
2-
.idea/
3-
.ipynb_checkpoints/
3+
*~
4+
buck-out/
5+
6+
# IDEs
7+
/.idea/
8+
/.vscode/
9+
10+
# Compiled files
11+
.venv/
12+
__pycache__/
13+
.*cache/
14+
15+
# Distribution / packaging
16+
/dist/
17+
18+
# Tests and coverage
19+
/data/
20+
/node_modules/
21+
/.coverage*
22+
23+
# docs
24+
/docs/generated/
25+
/docs/_build/
26+
27+
# others
28+
.ipynb_checkpoints/

0 commit comments

Comments
 (0)