Latest Results
fix: guard degenerate ZStackLoop when calculating home index (#306)
* fix: guard degenerate ZStackLoop when calculating home index
A 1-plane ZStackLoop with dZStep=0 and dZLow == dZHigh (written by
NIS-Elements for single-plane acquisitions on systems with a piezo Z
device) made _calc_zstack_home_index divide by zero, so .experiment,
.metadata, .sizes and .asarray() all raised ZeroDivisionError on
otherwise valid 2D files.
Return 0 for count <= 1 (which also stops the fallback branch returning
-1 for count == 0), and 0 when dZLow == dZHigh, where every plane sits at
the same z and no index is more "home" than another.
Also replace the `(inverted and home_range_i) or home_range_f` idiom with
real ternaries: it silently fell back to the non-inverted range whenever
the inverted one was exactly 0.0 (i.e. home == high for types 2/3, or
home == low for types 6/7).
Fixes #305
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* test: bump minimum xarray to 2023.9.0 for numpy 2 compatibility
The ubuntu-latest (3.12) [lowest-direct] job failed at collection with
`AttributeError: np.unicode_ was removed in the NumPy 2.0 release`,
raised from inside xarray 2023.1.0.
Under lowest-direct only *direct* deps are lowered, so xarray drops to
its floor while transitive deps stay at their highest: pandas resolves
to 3.x, which requires numpy >= 2, and xarray 2023.1.0 still refers to
np.unicode_ at import time. pandas 3.x requires python >= 3.11, which is
why only the 3.12 job broke and the 3.9/3.10 lowest-direct jobs pass.
2023.9.0 is the first xarray release that imports cleanly under numpy 2,
and it still supports python >= 3.9, so the floor can be raised
unconditionally.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Latest Branches
0%
0%
pre-commit-ci-update-config 0%
fix-degenerate-zstack-home-index © 2026 CodSpeed Technology