Repository navigation
Device and precision vocabulary (gpu:N, auto, single/double); release 2.4.0 - #6
Merged
Merged
Conversation
Every device argument (Camera, get_backend, the CLI [camera] table) now accepts "cpu", "gpu", "gpu:N" and "auto" (aocore CONVENTIONS 8.1), keeping the "numpy"/"cuda"/"cupy" aliases. A GPU camera is pinned to its card: the fixed-pattern maps and cuRAND streams are created there and every camera method runs with that device current. "gpu:N" is validated against the CuPy device count. Working precision takes "single"/"double" with "float32"/"float64" as aliases (8.2) on Camera, Scene.photon_rate_map/photoelectron_rate_map and the noise functions that take a float_dtype; resolve_precision is public. dataset.pairs and the CLI writers copy GPU frames to the host explicitly. Tests cover parsing, out-of-range N, auto fallback with CuPy hidden, the precision aliases, conformance with aocore's vocabulary, and gpu:0/auto on a real GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_conformance.py now drives check_point_source_centring and check_point_source_flux with render(shape) callables instead of the dummy-OPD workaround, and runs check_edge_flux_loss for every PSF model. The dev extra pins aocore>=0.1.3,<0.2; the runtime pin is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings getframes in line with aocore CONVENTIONS section 8 and cuts 2.4.0.
Device (8.1)
device=(Camera,get_backend, CLI[camera]table) accepts"cpu","gpu","gpu:N"and"auto";"numpy"/"cuda"/"cupy"aliases still work (case-insensitive)."gpu:N"is validated againstcupy.cuda.runtime.getDeviceCount()with a clearValueError; unknown strings raiseValueError, non-stringsTypeError."auto": GPU when CuPy imports and sees a device, else CPU.RandomStatestreams are built inside that device's context, and every public generation method (including generator methods, per step) runs with the device current.with_configkeeps the card.Camera.device_id,ArrayBackend.device_id/.spec/.activate().Precision (8.2)
precision="single"|"double"(aliases"float32"/"float64") onCamera, a newprecisionkeyword onScene.photon_rate_map/photoelectron_rate_mapand on thenoisefunctions with afloat_dtype; conflictingdtype+precisionraise. Publicgetframes.resolve_precision.Camera.precisionstill reports"float32"/"float64"(backward compatible).dataset.pairs(dtype=...)is a host storage type, not a working precision, so it is unchanged.Fixed
dataset.pairswith a GPU camera failed on implicit CuPy→NumPy conversion; it now goes throughto_numpy(as do the CLI writers).aocore 0.1.3 conformance
tests/test_conformance.pyswitched from the dummy-OPD workaround tocheck_point_source_centring/check_point_source_flux, and addscheck_edge_flux_lossfor all five PSF models (worst edge ratios 0.500-0.504). Thedevextra pinsaocore>=0.1.3,<0.2; the runtime pin is unchanged.Tests
tests/test_backend.py: parsing, invalid strings, out-of-range N (fake CuPy), RNG built on the selected device, auto fallback with CuPy hidden viasys.modules, precision aliases across Camera/Scene/noise.tests/test_conformance.py: device and precision vocabulary, precision names matched againstaocore.get_backend(...).real_dtype.tests/test_gpu.py(-m gpu, run locally on a Quadro P620):gpu:0maps/RNG/frames/series/binning on device 0, auto picks the GPU, out-of-range rejected.No measurable overhead on the GPU hot path (80x80 CMOS: 310 us/frame vs 315 us/frame on main).
Release: version 2.4.0, CHANGELOG dated 2026-10-07.
🤖 Generated with Claude Code