FiniteTempBasis.__getitem__ raises
NotImplementedError("Basis truncation not yet implemented in C API").
Two call sites depend on it and are therefore dead:
AugmentedBasis.__getitem__ (src/sparse_ir/augment.py) builds
AugmentedBasis(self._basis[:stop - self._naug], ...).
_AugmentedFunction.__getitem__ slices self._fbasis[:stop - self._naug].
While fixing the audit findings, both of these were repaired to the extent
possible at this layer: they called a nonexistent basis._slice_to_size(...)
and raised AttributeError before ever reaching the truncation, and now use a
local _slice_to_size(index, size) helper that range-checks the slice and
raises IndexError/ValueError with a clear message. Slicing an augmented
basis still ends in NotImplementedError from the underlying
FiniteTempBasis, which is the honest outcome until truncation exists.
This issue tracks implementing truncation once the C API supports
constructing a basis limited to the n most significant singular values
(may need a corresponding entry point tracked on SpM-lab/sparse-ir-rs).
FiniteTempBasis.__getitem__raisesNotImplementedError("Basis truncation not yet implemented in C API").Two call sites depend on it and are therefore dead:
AugmentedBasis.__getitem__(src/sparse_ir/augment.py) buildsAugmentedBasis(self._basis[:stop - self._naug], ...)._AugmentedFunction.__getitem__slicesself._fbasis[:stop - self._naug].While fixing the audit findings, both of these were repaired to the extent
possible at this layer: they called a nonexistent
basis._slice_to_size(...)and raised
AttributeErrorbefore ever reaching the truncation, and now use alocal
_slice_to_size(index, size)helper that range-checks the slice andraises
IndexError/ValueErrorwith a clear message. Slicing an augmentedbasis still ends in
NotImplementedErrorfrom the underlyingFiniteTempBasis, which is the honest outcome until truncation exists.This issue tracks implementing truncation once the C API supports
constructing a basis limited to the n most significant singular values
(may need a corresponding entry point tracked on SpM-lab/sparse-ir-rs).