You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# unix time in nanoseconds, state label
1697484378937217074, START
1697484745299889963, A
1697485399208931183, B
1697485926167354421, C
1697486056988285912, IGNORE
1697486140155652332, C
1697486494707281352, STOP
files=mass.off.getOffFileListFromOneFile(r'/home/pcuser/data/20231016/0000/20231016_run0000', 3)
In [12]: filesOut[12]:
['/home/pcuser/data/20231016/0000/20231016_run0000_chan1.off',
'/home/pcuser/data/20231016/0000/20231016_run0000_chan2.off',
'/home/pcuser/data/20231016/0000/20231016_run0000_chan3.off']
data=mass.off.ChannelGroup(files)
In [14]: data.refreshFromFiles()
---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
InputIn [14], in<cellline: 1>()
---->1data.refreshFromFiles()
File~/qsp/src/mass/mass/off/channels.py:1169, inChannelGroup.refreshFromFiles(self)
1167i0_unixnanos=len(ds)
1168ds.offFile._updateMmap() # will update nRecords by mmapping more data in the offFile if available->1169ds._statesDict=self.experimentStateFile.calcStatesDict(
1170ds.unixnano[i0_unixnanos:], ds.statesDict, i0_allLabels, i0_unixnanos)
1171n_new_pulses_dict[ds.channum] =len(ds)-i0_unixnanos1172returnn_new_labels, n_new_pulses_dictFile~/qsp/src/mass/mass/off/experiment_state.py:117, inExperimentStateFile.calcStatesDict(self, unixnanos, statesDict, i0_allLabels, i0_unixnanos)
115last_key=k116s=statesDict[last_key]
-->117s2=slice(s.start, i0_unixnanos+len(unixnanos)) # set the slice from the start of the state to the last new record118statesDict[k] =s2119returnstatesDictAttributeError: 'list'objecthasnoattribute'start'
The text was updated successfully, but these errors were encountered:
Original comment by Galen O'Neil (Bitbucket: oneilg, GitHub: oneilg).
diff --git a/mass/off/experiment_state.py b/mass/off/experiment_state.py
index 1fb3cea33..de6626934 100644
--- a/mass/off/experiment_state.py
+++ b/mass/off/experiment_state.py
@@ -113,8 +113,13 @@ class ExperimentStateFile:
assert i0_allLabels > 0
for k in statesDict.keys():
last_key = k
- s = statesDict[last_key]
- s2 = slice(s.start, i0_unixnanos+len(unixnanos)) # set the slice from the start of the state to the last new record
+ s = statesDict[last_key]
+ if isinstance(s, slice):
+ s2 = slice(s.start, i0_unixnanos+len(unixnanos)) # set the slice from the start of the state to the last new record
+ if isinstance(s, list):
+ s_ = s[-1] # get last instance of same state
+ s[-1] = slice(s_.start, i0_unixnanos+len(unixnanos)) # set the slice from the start of the state to the last new record
+ s2 = s
statesDict[k] = s2
return statesDict
appears to fix it, but since massgui only works with an older version of mass I can’t easily make a PR from the ebit computer
Original report by Galen O'Neil (Bitbucket: oneilg, GitHub: oneilg).
The text was updated successfully, but these errors were encountered: