The fill method, at least for VectorData, doesn't return anything; it just internally fills the array in the data container. When hacking with @bosschmidt, we realised that this behaviour wasn't very intuitive. I wonder if it should return, too. Or perhaps we should encourage people to use VectorData instead of allocating a random or zero DataContainer and filling it?
from cil.framework import VectorGeometry, VectorData
import numpy as np
from cil.utilities.display import show1D
#%%
n=50
b = np.random.randn(n)
vg = VectorGeometry(n)
b_cil = VectorData(b, geometry=vg)
print(b_cil)
#%%
b_cil2 = vg.allocate(0)
a=b_cil2.fill(b)
print(b_cil2)
print(a)
Description
The
fill
method, at least forVectorData
, doesn't return anything; it just internally fills the array in the data container. When hacking with @bosschmidt, we realised that this behaviour wasn't very intuitive. I wonder if it should return, too. Or perhaps we should encourage people to useVectorData
instead of allocating a random or zeroDataContainer
and filling it?Gives the result
You can see that
a
isNone
.