Skip to content

Commit c503e72

Browse files
authored
Update to 0.2.0 (#4)
* Add build workflow * Fix build workflow * Fix build script * Fix build script * Fix build script * Add `libglu1-mesa-dev` dependency for build script * Add `libglew-dev` dependency to build script * Add `-Dpybind11_DIR=` * Set `$CONDA_PREFIX` environment variable * Fix build workflow * Remove doxygen from build script * Fix bug in setup.py * Fix build script * Disable tests * Fix bug in setup.py * Use `sudo` for `setup.py install` in build script * Fix build script * Build wheel and upload artifact * Reduce artifact size * Fix artifact * Exclude debug build from artifact * Clean up artifact * Fix workflow * Add Docker build workflow * Add `pyyaml` as build dependency to build script * Update build instructions * Fix build workflow * Fix Docker workflow * Fix workflow * Add debug code to workflow * Fix Dockerfile * Squashed commit of the following: commit 750d7f8 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:32:42 2023 +0100 Fix Dockerfile commit cc5fc3f Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:28:01 2023 +0100 Fix Dockerfile commit 0006721 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:24:11 2023 +0100 Fix Dockerfile commit fba55bb Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:15:22 2023 +0100 Fix Dockerfile commit 8891b25 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:10:23 2023 +0100 Fix Dockerfile commit d282592 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 10:03:30 2023 +0100 Fix Dockerfile commit 2a4edd0 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:59:18 2023 +0100 Fix Dockerfile commit dc78de0 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:53:39 2023 +0100 Fix Dockerfile commit 7d97369 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:46:30 2023 +0100 Add debug info to Dockerfile commit e789036 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:40:22 2023 +0100 Fix Dockerfile commit dc48cc7 Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:27:00 2023 +0100 Add debug code commit be4c97e Author: Leonid Kostrykin <[email protected]> Date: Wed Dec 13 09:22:19 2023 +0100 Fix Dockerfile * Add examples to Dockerfile * Update README.md * Fix Dockerfile * Fix Dockerfile * Fix Dockerfile * Fix Dockerfile * Fix Dockerfile * Fix Dockerfile * Update README.md * Fix `docker run` instruction * Refactor for 0.2.0 (#1) * Add environment.yml * Update CMakeLists.txt * Clean up build script * Add `libopengl-devel` dependency * Fix build * Clean up tests, fix linking * Clean up `egl.Context` binding * Drop `carna.py` * Update settings.json * Clean up `base.Spatial` and `base.Node` * Implement `SpatialView` and add memory tests * Add `Node.test__attach_child__circular` * Add `Node.test__attach_child__nonfree` * Add `Node.test__movable` * Add `Node.test__tag` * Add `Node.test__localTransform` * Add `Node.test__detach_from_parent` * Add `CARNA_EXRA_CHECKS` environment variable * Add `Camera` tests * Add `Geometry` tests (incomplete) * Add `Geometry.test__geometry_type` and `Geometry.test__features_count` * Clean up code * Add `Material` and tests * Fix typo * Add `Geometry.put_feature` and `Geometry.remove_feature` * Add `Geometry.clear_features` * Add `Geometry.has_feature` * Clean up code * Add `ContextView` * Pin `pybind11 <3` * Refactor structure * Add `Surface` (no tests yet) * Add `FrameRenderer` and tests * Clean up test/test_egl.py * Add `configure_carna_log` * Add `math` * Add `MeshFactory` * Add `OpaqueRenderingStage` * Add `CarnaRenderingTestCase` * Make build directory readonly in VSCode * Fix `Surface::end` * Fix tests * Add `helpers.FrameRendererHelper` * Add `FrameRenderer.append_stage` * Remove extra checks (not working properly across submodules) * Add convenience layer * Add `renderer` convenience function * Extend spatial convenience functions * Add RTD setup * Add sphinx build to build script * Fix doc building * Update docs * Make `carna.renderer` a class instead of a function * Update docs * Update integration test * Add `frustum` method to convenience renderer * Update docs * Update docs * Update docs * Rename `configure_carna_log` to `logging` * Add `VolumeGridHelperBase` * Add `VolumeGridHelper_IntensityVolumeUInt16` * Add `VolumeGridHelper_IntensityVolumeUInt16.intensities_role` * Add `VolumeGridHelper_IntensityVolumeUInt16_NormalMap3DInt8` * Add `VolumeGridHelper_IntensityVolumeUInt8` * Add `VolumeGridHelper_IntensityVolumeUInt8_NormalMap3DInt8` * Add `VolumeGridHelper_*.create_node` * Add `MaskRenderingStage` (test fail) * Add failing `EGLContext` test case * Fix bug in `EGLContext` d'tor (tests pass) * Add `Color` and tests * Add `MaskRenderingStage` attributes, methods, and tests * Add docs * Add `volume` convenience function * Add debug build mode * Fix bug with lazy data loading behaviour of `VolumeGridHelper` https://kostrykin.github.io/Carna/html/classCarna_1_1base_1_1ManagedTexture3D.html#a37f03f311b2d1bd87ccb12f545d70f04 * Update docs * Update docs * Add logo to docs * Add `renderer.animation` * Use `solid` shaders instead of `unshaded` for example materials * Fix `animation.render` to produce smooth animations * Fix docs * Add `MIPStage` and `MIPLayer` * Fix bug in `EGLContext` (enable resource sharing) * Add `CuttingPlanesStage` * Add script to install Carna development version * Fix install_carna_dev.bash * Employ `.carna-dev` in CMakeLists.txt * Add `ColorMapView` * Fix install_carna_dev.bash * Add `MIPStage.color_map` * Update test results * Add `color_map_helper` and fix tests * Update build instructions * Add `carna.base.AssertionFailure` * Migrate to `Carna::base::MeshRenderingMixin` * Rename `Dimensions` to `Extent` and `millimeters` to `units` * Migrate build process from Carna to LibCarna * Migrate LICENSE to MIT * Migrate code from Carna to CarnaLib * Add logo * Add example notebook * Clean up convenience layer * Add `_transform` to convenience layer * Replace `np.bool` by `bool` * Add support for h264 rendering in `imshow` * Always build docs from scratch This is to avoid errors with nbsphinx. * Add examples/cthead.ipynb * Import colormaps from matplotlib * Add `DVRStage` * Add DVR to cells.ipynb * Update example notebooks * Rename `libcarna.animation` to `libcarna.animate` * Update example notebooks * Simplify `animate` syntax * Update example notebooks * Clean up `_expand_module` * Update example notebooks * Add material scheme validation * Update example notebooks * Add `dvr.replicate` * Add `mip.replicate` * Update example notebooks * Add `transform_into_voxels_from` method for volumes * Update example notebooks * Fix HUV normalization * Add `drr` * Update example notebooks * Update docs and example notebooks * Add `normalize_hounsfield_units` function * Add more debugging checks to `EGLContext` * Rename `mesh_factory` to `meshes` * Add `camera.proj` and `camera.frustum` methods * Refactor `_transform` and `_spatial_mixin` * Update * Update example notebooks * Add `libcarna.data` * Add `libcarna.data.toy` * Add `cutting_planes` * Add `cutting_planes` and `mask_renderer` * Rename `render` to `render_stage` * Fix `base.MeshFactory` * Clean up API, docs, and examples * Migrate `cutting_planes` to use color maps instead of windowing * Add `.normalized` and `.raw` convenience methods for `volume` geometries * Add fundamental colorbars * Refactor `colormap_helper` * Add colorbar labels, update example notebooks * Update example notebooks * Add spatial annotations example * Fix bugs, add segmentation example * Update README.md and example notebooks * Add `material.line_width` * Add track visualization example * Add `mesh` and `material` arguments to `geometry` function * Adapt to newest upstream changes * Add keyword aliases * Add more aliases and update docs * Update CI to build wheel * Add testing to CI * Update requirements * Update build workflows * Fix .github/workflows/build_all.yml * Fix .github/workflows/build_all.yml * Fix .github/workflows/build_all.yml * Fix .github/workflows/build.yml * Add example notebooks to test CI, fix triggers * Update README.md * Update environment.yml * Add `workflow_dispatch` trigger * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build.yml * Update build_all.yml * Update CI * Update CI * Update CI * Update CI * Update CI * Update CI * Update CI, update environment.yml * Update CI * Fix setup.py * Remove dangling files * Add dependencies to setup.py * Update CI * Update CI * Migrate to unity build * Update CI * Update CI * Update CI * Update CI * Update CI * Update CI * Remove libcarna from setup.py dependencies (not a Python dependency) * Fix dependencies * Update CI * Add test/__init__.py * Fix Python<3.12 compatibility * Update CI * Update CI * Update CI * Update CI * Fix compatibility with Python<3.11 * Debug * Add `LibCarna::egl::EGLContext::Details::selectDisplay` * Debug * Debug * Add `LIBCARNA_PYTHON_LOGGING` environment variable * Debug * Update CI * Install `libegl` via conda instead of apt * Add `typing_extensions` as dependency in setup.py * Update CI * Update CI * Update CI * Update CI * Remove support for Python 3.9 * Debug * Debug * Debug * Debug, add `EGLContext.vendor` and `EGLContext.renderer` * Update image comparison methods * Update image comparison methods * Update image comparison methods * Add vendor-specific expected test outputs * Employ vendor-specific expected test outputs * Remove debug output * Install missing dependencies * Add summary of notebook changes * Fix CI * Install ffmpeg * Remove notebooks from CI (taking too long) * Add more keyword aliases * Refactor `_spatial_mixin` rotation/translation/scaling methods * Update README.md * Remove MANIFEST.in * Update .readthedocs.yaml * Update .readthedocs.yaml * Update .readthedocs.yaml * Update RTD integration (#2) * Add `LIBCARNA_PYTHON_NBSPHINX_EXECUTE` environment variable * Add docs building for testing to CI * Update RTD integration, remove doc building from CI * Update docs/conf.py * Update .readthedocs.yaml * Update .readthedocs.yaml * Update .readthedocs.yaml * Update README.md * Update README.md * Update README.md * Update README.md * Migrate build system to `python-build` (#3) * Migrate to `python-build` * Clean-up setup.py.in * Fix linux_build.bash * Update CMakeLists.txt * Fix linux_build.bash * Fix linux_build.bash * Update build * Update tests * Fix linux_build.bash * Update CMake files * Update CI and RTD integration * Update build.yml * Rename `LIBCARNA_PYTHON_BUILD_TEST` to `LIBCARNA_PYTHON_BUILD_TESTS` * Update README.md * Update docs
1 parent 41839e7 commit c503e72

File tree

143 files changed

+8157
-2864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+8157
-2864
lines changed

.github/workflows/build.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Build and Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Git checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Miniconda
19+
uses: conda-incubator/setup-miniconda@v3
20+
with:
21+
miniconda-version: latest
22+
auto-update-conda: true
23+
24+
- name: Patch required Python version
25+
run: |
26+
sed -i "s|python .\+|python ==${{ inputs.python-version }}|g" environment.yml
27+
cat environment.yml
28+
29+
- name: Create and validate conda environment
30+
shell: bash
31+
run: |
32+
conda env create -f environment.yml --prefix ./.env
33+
eval "$(conda shell.bash hook)"
34+
conda activate ./.env
35+
python -V
36+
python -c "import sys; v = sys.version_info; assert f'{v.major}.{v.minor}' == '${{ inputs.python-version }}'"
37+
38+
- name: Extract libcarna version
39+
id: meta
40+
shell: bash
41+
run: |
42+
eval "$(conda shell.bash hook)"
43+
conda activate ./.env
44+
export libcarna_version=$(conda list --json |jq -rj '[ .[] | select( .name == "libcarna" ) ][0].version')
45+
echo "libcarna_version=$libcarna_version" >> "$GITHUB_OUTPUT"
46+
47+
- name: Build wheel
48+
shell: bash
49+
run: ./linux_build.bash
50+
51+
- name: Upload wheel
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: dist-${{ inputs.python-version }}
55+
path: build/dist/libcarna_python-*.whl
56+
57+
outputs:
58+
libcarna_version: ${{ steps.meta.outputs.libcarna_version }}
59+
60+
test:
61+
needs: build
62+
name: Test
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Git checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Install dependencies
69+
run: |
70+
sudo apt-get update -y -qq
71+
sudo apt-get install -y -qq libegl1
72+
73+
- name: Download artifact
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: dist-${{ inputs.python-version }}
77+
78+
- name: Setup Miniconda
79+
uses: conda-incubator/setup-miniconda@v3
80+
with:
81+
miniconda-version: latest
82+
auto-update-conda: true
83+
84+
- name: Create and validate conda environment
85+
shell: bash
86+
run: |
87+
conda create --prefix ./.env -c conda-forge -c bioconda \
88+
python==${{ inputs.python-version }} \
89+
libcarna==${{ needs.build.outputs.libcarna_version }} \
90+
pip
91+
eval "$(conda shell.bash hook)"
92+
conda activate ./.env
93+
python -V
94+
python -c "import sys; v = sys.version_info; assert f'{v.major}.{v.minor}' == '${{ inputs.python-version }}'"
95+
96+
- name: Install wheel
97+
run: |
98+
eval "$(conda shell.bash hook)"
99+
conda activate ./.env
100+
pip install libcarna_python-*.whl
101+
102+
- name: Test installation
103+
run: |
104+
eval "$(conda shell.bash hook)"
105+
conda activate ./.env
106+
python -c "import libcarna; assert libcarna.libcarna_version == '${{ needs.build.outputs.libcarna_version }}'"
107+
108+
- name: Install dependencies for tests and examples
109+
run: |
110+
eval "$(conda shell.bash hook)"
111+
conda activate ./.env
112+
pip install -r test/requirements.txt
113+
pip install -r docs/requirements.txt
114+
115+
- name: Run tests
116+
run: |
117+
eval "$(conda shell.bash hook)"
118+
conda activate ./.env
119+
python -m unittest -vv
120+
env:
121+
LIBCARNA_PYTHON_LOGGING: true
122+
123+
- name: Upload failed test output
124+
uses: actions/upload-artifact@v4
125+
if: failure()
126+
with:
127+
name: test-output-${{ inputs.python-version }}
128+
path: |
129+
test/test/results/actual

.github/workflows/build_all.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and Test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches: [ 'master', 'develop' ]
8+
paths-ignore:
9+
- 'docs/**'
10+
- '.git*'
11+
- 'LICENSE'
12+
- 'LICENSE-*'
13+
- '**/*.md'
14+
- '.readthedocs.yaml'
15+
- '.vscode/**'
16+
- 'install_libcarna_dev.bash'
17+
- 'linux_build.bash'
18+
19+
pull_request:
20+
branches-ignore: [ 'master' ]
21+
22+
jobs:
23+
build_and_test:
24+
name: Build and Test ${{ matrix.python-version }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
python-version: ['3.10', '3.11', '3.12']
29+
uses: ./.github/workflows/build.yml
30+
secrets: inherit
31+
with:
32+
python-version: ${{ matrix.python-version }}

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/.env
2+
/condaenv.*
13
/build
4+
/docs/build
25
/dist
3-
/CarnaPy.egg-info
4-
/misc/conda-recipe/carnapy
6+
/LibCarna_Python.egg-info
7+
/.libcarna-dev
8+
/test/results/actual
59
.ipynb_checkpoints
610
*.swp
11+
*.pyc
12+
*.DS_Store

.readthedocs.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
# Sphinx setup
7+
sphinx:
8+
fail_on_warning: true
9+
configuration: docs/conf.py
10+
11+
# Install build dependencies
12+
conda:
13+
environment: environment.yml
14+
15+
# Specify the build process
16+
build:
17+
os: ubuntu-24.04
18+
tools:
19+
python: "miniconda-latest"
20+
jobs:
21+
install:
22+
- bash ./linux_build.bash
23+
- pip install build/dist/libcarna_python-*.whl
24+
pre_build:
25+
- pip install -r docs/requirements.txt
26+
build:
27+
html:
28+
- LIBCARNA_PYTHON_NBSPHINX_EXECUTE=never sphinx-build -M html docs $READTHEDOCS_OUTPUT

.vscode/settings.json

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"python.analysis.extraPaths": [
3+
"./build/make_release"
4+
],
5+
"search.exclude": {
6+
"docs/examples": true,
7+
"docs/build": true
8+
},
9+
"files.readonlyInclude": {
10+
"build/**": true,
11+
},
12+
"[git-commit]": {
13+
"editor.rulers": [50]
14+
},
15+
"editor.rulers": [
16+
119
17+
],
18+
"files.associations": {
19+
"any": "cpp",
20+
"array": "cpp",
21+
"atomic": "cpp",
22+
"barrier": "cpp",
23+
"bit": "cpp",
24+
"bitset": "cpp",
25+
"cctype": "cpp",
26+
"cfenv": "cpp",
27+
"charconv": "cpp",
28+
"chrono": "cpp",
29+
"cinttypes": "cpp",
30+
"clocale": "cpp",
31+
"cmath": "cpp",
32+
"codecvt": "cpp",
33+
"compare": "cpp",
34+
"complex": "cpp",
35+
"concepts": "cpp",
36+
"condition_variable": "cpp",
37+
"coroutine": "cpp",
38+
"csetjmp": "cpp",
39+
"csignal": "cpp",
40+
"cstdarg": "cpp",
41+
"cstddef": "cpp",
42+
"cstdint": "cpp",
43+
"cstdio": "cpp",
44+
"cstdlib": "cpp",
45+
"cstring": "cpp",
46+
"ctime": "cpp",
47+
"cuchar": "cpp",
48+
"cwchar": "cpp",
49+
"cwctype": "cpp",
50+
"deque": "cpp",
51+
"forward_list": "cpp",
52+
"list": "cpp",
53+
"map": "cpp",
54+
"set": "cpp",
55+
"string": "cpp",
56+
"unordered_map": "cpp",
57+
"unordered_set": "cpp",
58+
"vector": "cpp",
59+
"exception": "cpp",
60+
"expected": "cpp",
61+
"algorithm": "cpp",
62+
"functional": "cpp",
63+
"iterator": "cpp",
64+
"memory": "cpp",
65+
"memory_resource": "cpp",
66+
"netfwd": "cpp",
67+
"numeric": "cpp",
68+
"optional": "cpp",
69+
"random": "cpp",
70+
"ratio": "cpp",
71+
"regex": "cpp",
72+
"source_location": "cpp",
73+
"string_view": "cpp",
74+
"system_error": "cpp",
75+
"tuple": "cpp",
76+
"type_traits": "cpp",
77+
"utility": "cpp",
78+
"rope": "cpp",
79+
"slist": "cpp",
80+
"format": "cpp",
81+
"fstream": "cpp",
82+
"future": "cpp",
83+
"initializer_list": "cpp",
84+
"iomanip": "cpp",
85+
"iosfwd": "cpp",
86+
"iostream": "cpp",
87+
"istream": "cpp",
88+
"latch": "cpp",
89+
"limits": "cpp",
90+
"mutex": "cpp",
91+
"new": "cpp",
92+
"numbers": "cpp",
93+
"ostream": "cpp",
94+
"ranges": "cpp",
95+
"scoped_allocator": "cpp",
96+
"semaphore": "cpp",
97+
"shared_mutex": "cpp",
98+
"span": "cpp",
99+
"spanstream": "cpp",
100+
"sstream": "cpp",
101+
"stacktrace": "cpp",
102+
"stdexcept": "cpp",
103+
"stdfloat": "cpp",
104+
"stop_token": "cpp",
105+
"streambuf": "cpp",
106+
"syncstream": "cpp",
107+
"thread": "cpp",
108+
"typeindex": "cpp",
109+
"typeinfo": "cpp",
110+
"valarray": "cpp",
111+
"variant": "cpp",
112+
"*.py.in": "python"
113+
}
114+
}

0 commit comments

Comments
 (0)