Incorrect handling of series slice
When working on !108 (merged) I saw that there's a bug in series with slicing over finite dimensions combined with scipy data and masking.
Here is the reproduction example
from pytest import raises
import pymablock
from scipy import sparse
import numpy as np
H = pymablock.series.BlockSeries(
data={
(0, 0, 0): sparse.eye(2, format="csr"),
},
shape=(1, 1),
n_infinite=1,
)
H[0, 0, :3] # Runs
H[:1, :1][0, 0, :3] # Runs
with raises(IndexError, match="invalid number of indices"):
H[0, 0][:3] # <- bug
assert H[0, 0, 3] is pymablock.series.zero
assert H[:1, :1][0, 0, 3] is np.ma.masked # <- bug
Edited by Anton Akhmerov