fact-project/zfits

Rows with just one number are arrays with one element

Closed this issue · 3 comments

I think this is a bit impractical:

In [1]: from zfits import FactFitsCalib
In [2]: f = FactFitsCalib('20160817_016.fits.fz', '20160817_030.drs.fits.gz')
In [3]: e = next(f)
In [4]: e['EventNum']
Out[5]: array([1], dtype=int32)

It is impractical, but isn't it "better" to return a dict with all np.arrays one can ask for shape instead of a few numbers and a few arrays?
I mean, this way it is more homogeneous. its a map<string, np.array> and not a map <string, find_it_out_yourself>

...

I think it's principle of least surprise for EventNum to be an int, not an int array with one element.

Okay it should be an easy fix.