Currently users get the raw message from numpy in that case:
>>> import numpy as np
>>> arr = ndtest((2, 3))
>>> arr['a0'] = np.array([1, 2])
ValueError: could not broadcast input array from shape (2,) into shape (3,)
But we could help debugging by providing the labels of the target subset in the error message.
>>> arr['a0'].axes
AxisCollection([
Axis(['b0', 'b1', 'b2'], 'b')
])
This kind of issue is more frequent than one could think as our users encounter it when loading "raw" (unlabelled) data from Excel via:
>>> with open_excel() as wb:
... sheet = wb[0]
... # add some data (no dump => no labels)
... sheet[:] = ndtest((2, 3))
... arr['a0'] = sheet['A1:B1']
ValueError: could not broadcast input array from shape (2,) into shape (3,)