micro-glancer 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. micro_glancer-0.0.1/.github/workflows/build-wheels.yml +54 -0
  2. micro_glancer-0.0.1/.github/workflows/publish.yml +66 -0
  3. micro_glancer-0.0.1/.github/workflows/tests.yml +96 -0
  4. micro_glancer-0.0.1/.gitignore +10 -0
  5. micro_glancer-0.0.1/CHANGELOG.md +27 -0
  6. micro_glancer-0.0.1/Cargo.lock +2689 -0
  7. micro_glancer-0.0.1/Cargo.toml +34 -0
  8. micro_glancer-0.0.1/LICENSE +21 -0
  9. micro_glancer-0.0.1/PKG-INFO +299 -0
  10. micro_glancer-0.0.1/README.md +265 -0
  11. micro_glancer-0.0.1/THIRD_PARTY_LICENSES.txt +9480 -0
  12. micro_glancer-0.0.1/bench/harness.py +205 -0
  13. micro_glancer-0.0.1/crates/micro-glancer-core/Cargo.toml +28 -0
  14. micro_glancer-0.0.1/crates/micro-glancer-core/src/blocks.rs +224 -0
  15. micro_glancer-0.0.1/crates/micro-glancer-core/src/bricks.rs +258 -0
  16. micro_glancer-0.0.1/crates/micro-glancer-core/src/geom.rs +253 -0
  17. micro_glancer-0.0.1/crates/micro-glancer-core/src/gpu.rs +1983 -0
  18. micro_glancer-0.0.1/crates/micro-glancer-core/src/lib.rs +3539 -0
  19. micro_glancer-0.0.1/crates/micro-glancer-core/src/loader.rs +270 -0
  20. micro_glancer-0.0.1/crates/micro-glancer-core/src/luts.rs +294 -0
  21. micro_glancer-0.0.1/crates/micro-glancer-core/src/mosaic.rs +456 -0
  22. micro_glancer-0.0.1/crates/micro-glancer-core/src/placement.rs +349 -0
  23. micro_glancer-0.0.1/crates/micro-glancer-core/src/plate.rs +521 -0
  24. micro_glancer-0.0.1/crates/micro-glancer-core/src/shader.wgsl +150 -0
  25. micro_glancer-0.0.1/crates/micro-glancer-core/src/shader_bricks.wgsl +197 -0
  26. micro_glancer-0.0.1/crates/micro-glancer-core/src/shader_label.wgsl +121 -0
  27. micro_glancer-0.0.1/crates/micro-glancer-core/src/shader_label_bricks.wgsl +117 -0
  28. micro_glancer-0.0.1/crates/micro-glancer-core/src/shader_mip.wgsl +563 -0
  29. micro_glancer-0.0.1/crates/micro-glancer-core/src/source.rs +1319 -0
  30. micro_glancer-0.0.1/crates/micro-glancer-core/src/tiles.rs +126 -0
  31. micro_glancer-0.0.1/crates/micro-glancer-core/src/view.rs +542 -0
  32. micro_glancer-0.0.1/eubi-dev.ps1 +10 -0
  33. micro_glancer-0.0.1/licenses/c-blosc/LICENSE.txt +31 -0
  34. micro_glancer-0.0.1/licenses/objc2/LICENSE-APACHE.txt +179 -0
  35. micro_glancer-0.0.1/licenses/objc2/LICENSE-MIT.txt +25 -0
  36. micro_glancer-0.0.1/licenses/objc2/LICENSE-ZLIB.txt +11 -0
  37. micro_glancer-0.0.1/licenses/objc2/LICENSE.md +36 -0
  38. micro_glancer-0.0.1/licenses/profiling/LICENSE-APACHE +201 -0
  39. micro_glancer-0.0.1/licenses/profiling/LICENSE-MIT +21 -0
  40. micro_glancer-0.0.1/licenses/rc-zip/LICENSE-APACHE +201 -0
  41. micro_glancer-0.0.1/licenses/rc-zip/LICENSE-MIT +17 -0
  42. micro_glancer-0.0.1/licenses/spirv/LICENSE +202 -0
  43. micro_glancer-0.0.1/pyproject.toml +48 -0
  44. micro_glancer-0.0.1/python/micro_glancer/__init__.py +31 -0
  45. micro_glancer-0.0.1/python/micro_glancer/__main__.py +6 -0
  46. micro_glancer-0.0.1/python/micro_glancer/app.py +573 -0
  47. micro_glancer-0.0.1/python/micro_glancer/cli.py +21 -0
  48. micro_glancer-0.0.1/python/micro_glancer/contents.py +131 -0
  49. micro_glancer-0.0.1/python/micro_glancer/panel.py +422 -0
  50. micro_glancer-0.0.1/python/micro_glancer/qt.py +440 -0
  51. micro_glancer-0.0.1/python/micro_glancer/save.py +147 -0
  52. micro_glancer-0.0.1/rust-toolchain.toml +5 -0
  53. micro_glancer-0.0.1/scratch/inspect_mv.py +296 -0
  54. micro_glancer-0.0.1/scratch/smoke_inspect_mv.py +73 -0
  55. micro_glancer-0.0.1/scripts/third_party_licenses.py +156 -0
  56. micro_glancer-0.0.1/src/lib.rs +1148 -0
  57. micro_glancer-0.0.1/tests/test_app.py +250 -0
  58. micro_glancer-0.0.1/tests/test_labels.py +208 -0
  59. micro_glancer-0.0.1/tests/test_layers.py +460 -0
  60. micro_glancer-0.0.1/tests/test_plates.py +195 -0
  61. micro_glancer-0.0.1/tests/test_positions.py +289 -0
  62. micro_glancer-0.0.1/tests/test_transfer.py +232 -0
  63. micro_glancer-0.0.1/tests/test_viewer.py +529 -0
  64. micro_glancer-0.0.1/tests/test_views.py +329 -0
  65. micro_glancer-0.0.1/tests/test_volume.py +325 -0
@@ -0,0 +1,54 @@
1
+ # Build micro-glancer: one abi3 wheel per platform (Python >= 3.11) and the sdist.
2
+ # Called by tests.yml, so it runs on every pull request and before every release
3
+ # (publish.yml calls tests.yml), and the tests run on these very wheels.
4
+ #
5
+ # zarrs (through dyna-zarr's arrays) compiles C / C++ libraries from source through its
6
+ # -sys crates (c-blosc, LZ4, Snappy, zlib, zstd): a C and a C++ compiler are needed,
7
+ # which every runner and the manylinux container have. wgpu needs nothing at build
8
+ # time: it loads Vulkan, Metal or DX12 when the viewer starts.
9
+ name: Build wheels
10
+
11
+ on:
12
+ workflow_call:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ wheels:
19
+ name: wheel ${{ matrix.platform.name }}
20
+ runs-on: ${{ matrix.platform.runner }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ platform:
25
+ - { name: linux-x86_64, runner: ubuntu-latest, target: x86_64 }
26
+ - { name: linux-aarch64, runner: ubuntu-24.04-arm, target: aarch64 }
27
+ - { name: macos-arm64, runner: macos-latest, target: aarch64 }
28
+ - { name: macos-x86_64, runner: macos-latest, target: x86_64 } # cross-compiled
29
+ - { name: windows-x64, runner: windows-latest, target: x64 }
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: PyO3/maturin-action@v1
33
+ with:
34
+ target: ${{ matrix.platform.target }}
35
+ manylinux: auto # ignored outside Linux
36
+ args: --release --locked --out dist
37
+ - uses: actions/upload-artifact@v4
38
+ with:
39
+ name: wheel-${{ matrix.platform.name }}
40
+ path: dist
41
+
42
+ sdist:
43
+ name: sdist
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - uses: PyO3/maturin-action@v1
48
+ with:
49
+ command: sdist
50
+ args: --out dist
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: sdist
54
+ path: dist
@@ -0,0 +1,66 @@
1
+ name: Publish to PyPI
2
+
3
+ # Runs when you publish a GitHub Release (Releases -> Draft a new release -> Publish):
4
+ #
5
+ # 1. the release tag must equal the version (vX.Y.Z), which is the binding crate's
6
+ # in Cargo.toml (pyproject.toml takes it from there);
7
+ # 2. the full test suite runs on the release's commit (tests.yml, which also builds
8
+ # the wheels and the sdist); nothing is published unless it passes;
9
+ # 3. the wheels and the sdist built by tests.yml are uploaded to PyPI through
10
+ # Trusted Publishing (OIDC): no API token or secret.
11
+ #
12
+ # If only the upload failed, "Re-run failed jobs" on the run retries it. If the tests
13
+ # failed: fix, delete the release and its tag, and release again.
14
+ #
15
+ # Keep this file's name: the PyPI trusted publisher is registered for publish.yml with
16
+ # the environment pypi. One-time setup before the first release: on PyPI, a pending
17
+ # publisher for the project micro-glancer (this repository, workflow publish.yml,
18
+ # environment pypi); on GitHub, the environment pypi (Settings > Environments).
19
+ on:
20
+ release:
21
+ types: [published]
22
+
23
+ permissions:
24
+ contents: read
25
+
26
+ jobs:
27
+ checks:
28
+ name: Tag matches the version
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - name: Release tag equals Cargo.toml's version
33
+ run: |
34
+ version=$(python3 -c "import tomllib; print(tomllib.load(open('Cargo.toml', 'rb'))['package']['version'])")
35
+ test "v$version" = "${{ github.event.release.tag_name }}" \
36
+ || { echo "::error::release tag ${{ github.event.release.tag_name }} != v$version (Cargo.toml)"; exit 1; }
37
+
38
+ tests:
39
+ needs: checks
40
+ uses: ./.github/workflows/tests.yml
41
+
42
+ publish:
43
+ name: Publish to PyPI
44
+ needs: tests
45
+ runs-on: ubuntu-latest
46
+ environment:
47
+ name: pypi
48
+ url: https://pypi.org/project/micro-glancer/
49
+ permissions:
50
+ contents: read # a permissions block drops the defaults: keep read
51
+ id-token: write # OIDC token for Trusted Publishing
52
+ steps:
53
+ - uses: actions/download-artifact@v4
54
+ with:
55
+ pattern: wheel-* # every platform's wheel, built by tests.yml
56
+ merge-multiple: true
57
+ path: dist
58
+ - uses: actions/download-artifact@v4
59
+ with:
60
+ name: sdist
61
+ path: dist
62
+ - name: Check metadata
63
+ run: |
64
+ python3 -m pip install --upgrade twine
65
+ python3 -m twine check dist/*
66
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,96 @@
1
+ name: Tests
2
+
3
+ # Tests run in two places: on a pull request (when it is opened, on every new commit,
4
+ # when it is reopened) and before every release (publish.yml calls this workflow;
5
+ # nothing is published unless it passes). Plain pushes do not run them; the
6
+ # "Run workflow" button on the Actions tab runs them by hand.
7
+ on:
8
+ pull_request:
9
+ types: [opened, synchronize, reopened]
10
+ workflow_dispatch:
11
+ workflow_call:
12
+
13
+ concurrency:
14
+ # A new commit on the same PR cancels its run still in progress (not releases).
15
+ group: tests-${{ github.event_name }}-${{ github.ref }}
16
+ cancel-in-progress: ${{ github.event_name != 'release' }}
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ rust:
23
+ name: Rust (fmt, clippy, cargo test)
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ # cargo test leaves out the binding (micro-glancer): it has no Rust tests, and its
28
+ # test program cannot link on macOS, where an extension module finds Python's
29
+ # symbols only when Python loads it. The Python tests below test it.
30
+ - name: format, lint, test (toolchain from rust-toolchain.toml)
31
+ run: |
32
+ cargo fmt --all -- --check
33
+ cargo clippy --workspace --all-targets --locked -- -D warnings
34
+ cargo test --workspace --exclude micro-glancer --locked
35
+
36
+ licences:
37
+ name: licence notices current
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - name: regenerate THIRD_PARTY_LICENSES.txt and compare
42
+ run: |
43
+ cargo fetch --locked
44
+ python3 scripts/third_party_licenses.py
45
+ git diff --exit-code THIRD_PARTY_LICENSES.txt
46
+
47
+ build:
48
+ uses: ./.github/workflows/build-wheels.yml
49
+
50
+ test:
51
+ # The tests run on the wheels just built (not the source tree), so a module left
52
+ # out of the wheel fails here. Runners have no GPU: Linux draws with Mesa's
53
+ # lavapipe (a Vulkan driver on the CPU), Windows with WARP (DX12 on the CPU),
54
+ # macOS with the runner's Metal device.
55
+ name: pytest (${{ matrix.os }}, py${{ matrix.python }})
56
+ needs: build
57
+ runs-on: ${{ matrix.os }}
58
+ strategy:
59
+ fail-fast: false
60
+ matrix:
61
+ include:
62
+ - { os: ubuntu-latest, python: "3.11", wheel: linux-x86_64 }
63
+ - { os: ubuntu-latest, python: "3.13", wheel: linux-x86_64 }
64
+ - { os: windows-latest, python: "3.12", wheel: windows-x64 }
65
+ - { os: macos-latest, python: "3.13", wheel: macos-arm64 }
66
+ env:
67
+ QT_QPA_PLATFORM: offscreen # Qt without a display
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+
71
+ - uses: actions/setup-python@v5
72
+ with:
73
+ python-version: ${{ matrix.python }}
74
+
75
+ - name: Linux libraries (lavapipe, and what PyQt6 needs off screen)
76
+ if: runner.os == 'Linux'
77
+ run: |
78
+ sudo apt-get update
79
+ sudo apt-get install -y --no-install-recommends mesa-vulkan-drivers \
80
+ libegl1 libgl1 libxkbcommon0 libfontconfig1 libdbus-1-3
81
+
82
+ - uses: actions/download-artifact@v4
83
+ with:
84
+ name: wheel-${{ matrix.wheel }}
85
+ path: dist
86
+
87
+ - name: Install the wheel with Qt, ome_zarr_pyramid and pytest
88
+ shell: bash
89
+ run: |
90
+ python -m pip install --upgrade pip
91
+ # the wheel file itself (with --find-links, pip could take a PyPI copy instead)
92
+ python -m pip install "$(ls dist/*.whl)[dev]"
93
+ python -c "import micro_glancer as m; print(m.__file__); assert 'site-packages' in m.__file__, 'not the installed wheel'"
94
+
95
+ - name: pytest
96
+ run: python -m pytest tests -v -o addopts=""
@@ -0,0 +1,10 @@
1
+ /target/
2
+ /dist/
3
+ __pycache__/
4
+ *.pyd
5
+ *.so
6
+ .pytest_cache/
7
+ /.venv/
8
+ *.pdb
9
+ # release notes (given to gh release create, not part of the repo)
10
+ /reports/
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1 (2026-11-24)
4
+
5
+ The first release: a viewer for OME-Zarr images (NGFF 0.4, 0.5 and 0.6) that draws on
6
+ the GPU, with a Rust core and a Qt widget and app for Python. Wheels for Windows, macOS
7
+ and Linux, Python 3.11 and newer (one wheel per platform).
8
+
9
+ - Images from folders, `.zip` and `.ozx` files; smooth pan and zoom over the resolution
10
+ levels, coarser tiles standing in while finer ones are read.
11
+ - Channels in colours or colour maps, contrast limits, gamma, auto contrast, and a
12
+ histogram per channel; omero metadata as the starting point.
13
+ - Planes at any angle through a volume, linked XY / YZ / XZ views, and the whole volume
14
+ as a maximum intensity projection, a composited volume or surfaces, with shading and
15
+ opacity curves.
16
+ - Several images as layers, each moved and turned by hand; the transform saved into the
17
+ image (a translation for NGFF 0.4 / 0.5, a transform to an "aligned" coordinate system
18
+ for 0.6).
19
+ - Label images with exact 32 and 64-bit ids, outlines and selection.
20
+ - Image positions: plates with every field at its place, wells and collections as
21
+ mosaics, NGFF 0.6 scenes; a navigation tree of plates, collections and label images.
22
+ - `micro-glancer` command (`pip install "micro-glancer[qt]"`); without PyQt6 it says what
23
+ to install. Saving a translation into an NGFF 0.4 / 0.5 image needs ome_zarr_pyramid
24
+ (`pip install "micro-glancer[save]"`).
25
+ - The Qt widget draws into its own native window on Windows and macOS, and off screen
26
+ everywhere else. Asking for native drawing where Qt has no real windows (its
27
+ `offscreen` or `minimal` platform) raises an error that names `mode='offscreen'`.