[ePix100][Correct] Correcting one train for epix100 and storing a list of one pulseId
Description
A few weeks ago a bug was identified in ePix100 correction notebook when correcting a sequence file of 1 train.
This is a fix for the following error when converting an array of one pulseId to a list:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-44-b0dfb1190f77> in <module>
----> 1 list(seq_dc[instrument_src]['data.pulseId'].ndarray().squeeze())
TypeError: iteration over a 0-d array
How Has This Been Tested?
Unit tests and attached the correction result for the run which exposed the bug in the first place
Relevant Documents (optional)
The failed run after correcting it with this MR
Types of changes
- Bug fix (non-breaking change which fixes an issue)
Checklist:
Reviewers
Merge request reports
Activity
added Testing label
assigned to @ahmedk
635 635 " \"data.trainId\", data=seq_dc.train_ids, chunks=min(50, len(seq_dc.train_ids)))\n", 636 636 " \n", 637 637 " if np.isin('data.pulseId', list(seq_dc[instrument_src].keys())): # some runs are missing 'data.pulseId'\n", 638 " pulseid = seq_dc[instrument_src]['data.pulseId'].ndarray().squeeze()\n", I'm not sure this is the right fix - isn't the
.squeeze()
the cause for this issue in the first place? In the case of a single train, you're unintentionally squeezing away the train axis. Instead, you could explicitly remove the axis you don't want to have, I suspect it's some(N_TRAINS, 1, x, y)
shape?Of course sorry, we're looking at
data.pulseId
here. Still the point stands, instead of squeezing (and turning a single train into a scalar), you could simply remove the second axis:.ndarray()[:, 0]
We intentionally tried to make sure that the dimensionality of data accessor methods in EXtra-data does not change when inspecting a single train.
changed this line in version 3 of the diff
added 32 commits
-
6e67150f...6f3f34e7 - 29 commits from branch
master
- cdbdc0ef - Correcting one train for epix100 and storing a list of one pulseId
- 03ff42d9 - preserve pulseid dtype
- 75f4e499 - Improve fix by just discarding the axis instead of squeezing
Toggle commit list-
6e67150f...6f3f34e7 - 29 commits from branch
Thanks @schmidtp for the review!
mentioned in commit 017f4bdc
changed milestone to %3.13.0