Skip to content

Error loading continuous files: AssertionError assert numRecords % 1 == 0 #38

@stef1029

Description

@stef1029

Hi,

I'm having another issue with loading some data I've recorded. The error I'm getting is this:

Traceback (most recent call last):
  File "/cephfs2/srogers/Behaviour code/2407_July_WT_cohort/Analysis/NAP/July_cohort_scripts/analysis_manager.py", line 36, in __init__
    self.ingest_behaviour_data()
  File "/cephfs2/srogers/Behaviour code/2407_July_WT_cohort/Analysis/NAP/July_cohort_scripts/analysis_manager.py", line 83, in ingest_behaviour_data
    self.OEAB_data = process_ADC_Recordings(self.OEAB_folder, self.rig_id)
  File "/cephfs2/srogers/Behaviour code/2407_July_WT_cohort/Analysis/NAP/July_cohort_scripts/Preliminary_analysis_scripts/process_ADC_recordings.py", line 28, in __init__
    self.extract_ADC_data()
  File "/cephfs2/srogers/Behaviour code/2407_July_WT_cohort/Analysis/NAP/July_cohort_scripts/Preliminary_analysis_scripts/process_ADC_recordings.py", line 35, in extract_ADC_data
    self.recording = open_ephys.analysis.Session(self.dirname).recordnodes[0].recordings[0].continuous[0]
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/recording.py", line 81, in continuous
    self.load_continuous()
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/formats/OpenEphysRecording.py", line 252, in load_continuous
    self._continuous.append(self.Continuous(stream_info[stream_index],
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/formats/OpenEphysRecording.py", line 63, in __init__
    self._sample_numbers_internal, _, _, self.valid_records = load(files[0], recording_index)
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/formats/helpers/oe_fast_loader.py", line 105, in load
    return load_continuous(filename, recording_index)
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/formats/helpers/oe_fast_loader.py", line 152, in load_continuous
    numRecords = getNumRecords(filename, RECORD_SIZE)
  File "/lmb/home/srogers/anaconda3/envs/behaviour_analysis/lib/python3.10/site-packages/open_ephys/analysis/formats/helpers/oe_fast_loader.py", line 80, in getNumRecords
    assert numRecords % 1 == 0
AssertionError

I'm not sure why these files are having these issues regarding issues at the time of recording. I did, however, notice that a large number of my recording files had not saved the structure.openephys file at the end of recording. When i originally tried to load these files I got the error IndexError: list index out of range from the line self.recording = open_ephys.analysis.Session(self.dirname).recordnodes[0].recordings[0].continuous[0].

To try and fix this, I tried transplanting in structure files from healthy folders, however that is when I started getting this error. The contents of the structure files seems to be correct, unless bitVolts is the cause of the issue. Primarily I'm wondering if there's something I can do to fix this issue, and if there are any known reasons why the structure files failed to save in the first place. It's happened on a very large number of recordings over the last couple weeks, so I don't think anything was happening obviously indicating a failure at the ends of recordings as I would have noticed this number of crashes or something like that.

Thanks very much for any help you can give,

Stefan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions