Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
480c6a4
wIP
toloudis Aug 5, 2026
62ea7df
add python build artifacts to regular PR builds
toloudis Aug 6, 2026
e44f2a9
comment
toloudis Aug 7, 2026
3178dbb
try fix mac build
toloudis Aug 7, 2026
6086d43
try to fix linux build
toloudis Aug 7, 2026
bec2e33
fix typo
toloudis Aug 7, 2026
2d755b1
try yum for manylinux
toloudis Aug 7, 2026
9460d23
update deps for manylinux
toloudis Aug 8, 2026
512b048
try to add vulkan sdk for cibuildwheel linux
toloudis Aug 10, 2026
73c3faa
try a different way for vulkan
toloudis Aug 10, 2026
00963ff
try to fix sdk path
toloudis Aug 11, 2026
aab2092
try separate jobs since cibuildwheel generally needs to rebuild rende…
toloudis Aug 14, 2026
5e94927
newer manylinux and improve vulkan loader finding
toloudis Aug 17, 2026
cbfc519
try to improve spdlog installation
toloudis Aug 17, 2026
40107c4
cibuildwheel: skip the tensorstore skips
toloudis Aug 17, 2026
d651201
see if it was a cmake versioning issue
toloudis Aug 17, 2026
cb792cf
pull down curl dependency separately
toloudis Aug 17, 2026
ecc8fb2
more linux deps fixup, related to curl and openssl
toloudis Aug 17, 2026
49d5baf
curl get vulkan before building new curl lib
toloudis Aug 17, 2026
437a3e0
try to fix tensorstore
toloudis Aug 17, 2026
cd1b18e
add vcpkg dir
toloudis Aug 17, 2026
8745e82
now try to explicitly build zstd as a build dep for linux
toloudis Aug 17, 2026
5ccc522
try rebuilding some deps for deployment target
toloudis Aug 17, 2026
6d639cb
try deployment target 15 for apple python pkg
toloudis Aug 18, 2026
f6cf0bc
update manylinux
toloudis Aug 18, 2026
7cdc2b0
oops
toloudis Aug 18, 2026
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
120 changes: 103 additions & 17 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ jobs:
with:
name: agave-linux
path: ./build/install/Release/agave-install
- name: Install and test agave_pyvk
working-directory: agave_pyvk
run: |
python -m pip install -e ".[test]"
python -c "from agave_pyvk import AgaveRenderer; import agave_pyvk._native"
python -m pytest tests

macos-build:
runs-on: macos-15
Expand Down Expand Up @@ -170,12 +164,6 @@ jobs:
with:
name: agave-macos-arm64
path: ./build/agave-macos-arm64.dmg
- name: Install and test agave_pyvk
working-directory: agave_pyvk
run: |
python -m pip install -e ".[test]"
python -c "from agave_pyvk import AgaveRenderer; import agave_pyvk._native"
python -m pytest tests

windows-build:
runs-on: windows-latest
Expand Down Expand Up @@ -225,15 +213,113 @@ jobs:
with:
name: agave-win
path: ./build/agave-win.exe
- name: Install and test agave_pyvk
working-directory: agave_pyvk

linux-pyvk-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: jakoch/install-vulkan-sdk-action@37effcfa045411f8bfbbda26df2fd1b3bf3436fa
with:
vulkan_version: 1.4.350.1
cache: true
- name: Install dependencies
run: sudo apt-get install libspdlog-dev libglm-dev libgl1-mesa-dev libegl1-mesa-dev libtiff-dev libzstd-dev libcurl4-openssl-dev nasm
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- name: Install and test the Python 3.12 wheel
run: |
python -m pip install pytest wheelhouse/*cp312*.whl
python -c "from agave_pyvk import AgaveRenderer; import agave_pyvk._native"
python -m pytest agave_pyvk/tests
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-linux
path: wheelhouse/*.whl
if-no-files-found: error

macos-pyvk-build:
runs-on: macos-15
env:
CC: clang
CXX: clang++
MACOSX_DEPLOYMENT_TARGET: "15.0"
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: jakoch/install-vulkan-sdk-action@37effcfa045411f8bfbbda26df2fd1b3bf3436fa
with:
vulkan_version: 1.4.350.1
cache: true
- name: Install dependencies
run: |
brew install spdlog nasm curl
if [ -d /usr/local/include/openssl ]; then
mv /usr/local/include/openssl /usr/local/include/openssl.bak
fi
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- name: Install and test the Python 3.12 wheel
run: |
python -m pip install pytest wheelhouse/*cp312*.whl
python -c "from agave_pyvk import AgaveRenderer; import agave_pyvk._native"
python -m pytest agave_pyvk/tests
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-macos-arm64
path: wheelhouse/*.whl
if-no-files-found: error

windows-pyvk-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: jakoch/install-vulkan-sdk-action@37effcfa045411f8bfbbda26df2fd1b3bf3436fa
with:
vulkan_version: 1.4.350.0
cache: true
- name: Install dependencies
shell: cmd
run: |
choco install nasm -y
call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
python -m pip install -e ".[test]"
if errorlevel 1 exit /b %errorlevel%
vcpkg install --triplet x64-windows tiff glm zlib libjpeg-turbo liblzma spdlog zstd curl
- name: Remove bad Strawberry Perl patch binary in search path
run: echo "C:\Program Files\git\usr\bin" >> $env:GITHUB_PATH
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels with MSVC 18
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- name: Install and test the Python 3.12 wheel
shell: pwsh
run: |
python -m pip install pytest
$wheel = Get-ChildItem wheelhouse/*cp312*.whl | Select-Object -First 1
python -m pip install $wheel.FullName
python -c "from agave_pyvk import AgaveRenderer; import agave_pyvk._native"
python -m pytest tests
python -m pytest agave_pyvk/tests
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-win
path: wheelhouse/*.whl
if-no-files-found: error

lint-and-test-webclient:
runs-on: ubuntu-latest
Expand Down
98 changes: 81 additions & 17 deletions .github/workflows/tagged_master_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ jobs:
with:
name: agave-linux
path: ./build/install/Release/agave-install
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-linux
path: wheelhouse/*.whl
if-no-files-found: error

macos-build:
runs-on: macos-15
Expand Down Expand Up @@ -102,14 +94,6 @@ jobs:
with:
name: agave-macos-arm64
path: ./build/agave-macos-arm64.dmg
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-macos-arm64
path: wheelhouse/*.whl
if-no-files-found: error

windows-build:
runs-on: windows-latest
Expand Down Expand Up @@ -159,6 +143,78 @@ jobs:
with:
name: agave-win
path: ./build/agave-win.exe

linux-pyvk-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-linux
path: wheelhouse/*.whl
if-no-files-found: error

macos-pyvk-build:
runs-on: macos-15
env:
CC: clang
CXX: clang++
MACOSX_DEPLOYMENT_TARGET: "15.0"
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: jakoch/install-vulkan-sdk-action@37effcfa045411f8bfbbda26df2fd1b3bf3436fa
with:
vulkan_version: 1.4.350.1
cache: true
- name: Install dependencies
run: |
brew install spdlog nasm curl
if [ -d /usr/local/include/openssl ]; then
mv /usr/local/include/openssl /usr/local/include/openssl.bak
fi
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels
run: python -m cibuildwheel agave_pyvk --output-dir wheelhouse
- uses: actions/upload-artifact@v6
with:
name: agave-pyvk-agave-macos-arm64
path: wheelhouse/*.whl
if-no-files-found: error

windows-pyvk-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
submodules: "recursive"
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: jakoch/install-vulkan-sdk-action@37effcfa045411f8bfbbda26df2fd1b3bf3436fa
with:
vulkan_version: 1.4.350.0
cache: true
- name: Install dependencies
shell: cmd
run: |
choco install nasm -y
call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
vcpkg install --triplet x64-windows tiff glm zlib libjpeg-turbo liblzma spdlog zstd curl
- name: Remove bad Strawberry Perl patch binary in search path
run: echo "C:\Program Files\git\usr\bin" >> $env:GITHUB_PATH
- run: python -m pip install cibuildwheel==3.3.0
- name: Build agave_pyvk wheels with MSVC 18
shell: cmd
Expand Down Expand Up @@ -243,7 +299,15 @@ jobs:
verbose: true

publish_agave_pyvk:
needs: [linux-build, macos-build, windows-build]
needs:
[
linux-build,
macos-build,
windows-build,
linux-pyvk-build,
macos-pyvk-build,
windows-pyvk-build,
]
runs-on: ubuntu-latest
steps:
- name: Download agave_pyvk wheel artifacts
Expand Down
2 changes: 2 additions & 0 deletions CMake/ConfigureVulkan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ if(AGAVE_VULKAN_SDK_ROOT)
set(Vulkan_LIBRARY "${AGAVE_VULKAN_SDK_ROOT}/lib/libvulkan.dylib" CACHE FILEPATH "Vulkan loader library" FORCE)
elseif(EXISTS "${AGAVE_VULKAN_SDK_ROOT}/lib/libvulkan.so")
set(Vulkan_LIBRARY "${AGAVE_VULKAN_SDK_ROOT}/lib/libvulkan.so" CACHE FILEPATH "Vulkan loader library" FORCE)
elseif(EXISTS "${AGAVE_VULKAN_SDK_ROOT}/lib/VulkanLoader/lib/libvulkan.so")
set(Vulkan_LIBRARY "${AGAVE_VULKAN_SDK_ROOT}/lib/VulkanLoader/lib/libvulkan.so" CACHE FILEPATH "Vulkan loader library" FORCE)
endif()
endif()

Expand Down
22 changes: 22 additions & 0 deletions agave_pyvk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ with AgaveRenderer(mode="pathtrace") as renderer:
renderer.redraw()
```

NumPy volumes can also be loaded directly. Three-dimensional arrays use ZYX
order and four-dimensional arrays use CZYX order:

```python
import numpy as np

volume = np.zeros((2, 64, 256, 256), dtype=np.uint16)
with AgaveRenderer(mode="pathtrace") as renderer:
info = renderer.load_array(
volume,
name="example",
voxel_size=(0.108, 0.108, 0.29),
spatial_units="um",
channel_names=("DNA", "membrane"),
)
```

`uint8`, `uint16`, and `float32` arrays are accepted and copied into AGAVE's
channel-major `uint16` storage. `uint8` values are widened without rescaling;
each `float32` channel is independently min-max normalized to the full 16-bit
range. A new call replaces the current volume and represents one time point.

A Vulkan 1.3-capable driver and the Vulkan SDK are required to build. The
remaining native dependencies are the same ones used by renderlib.

Expand Down
33 changes: 32 additions & 1 deletion agave_pyvk/agave_pyvk/agave.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import math
from pathlib import Path
from typing import List, Optional
from typing import List, Optional, Sequence

import numpy
from PIL import Image
Expand Down Expand Up @@ -281,6 +281,37 @@ def load_data_and_get_info(
path, scene, multiresolution_level, time, channels, region
)

def load_array(
self,
data: numpy.ndarray,
name: str = "array",
voxel_size: Sequence[float] = (1.0, 1.0, 1.0),
spatial_units: str = "units",
channel_names: Optional[Sequence[str]] = None,
) -> dict:
"""Replace the current volume with a copied ZYX or CZYX NumPy array."""
if self._renderer is None:
raise RuntimeError("Renderer is closed")

array = numpy.asarray(data)
if array.dtype not in (
numpy.dtype("uint8"),
numpy.dtype("uint16"),
numpy.dtype("float32"),
):
raise TypeError("data dtype must be uint8, uint16, or float32")
if array.ndim not in (3, 4):
raise ValueError("data must have ZYX or CZYX shape")

result = self._renderer.load_array(
numpy.ascontiguousarray(array),
name,
list(voxel_size),
spatial_units,
list(channel_names) if channel_names is not None else [],
)
return json.loads(result)

def show_scale_bar(self, on: int):
return self._execute("SHOW_SCALE_BAR", on)

Expand Down
Loading
Loading