Skip to content

Neuralynx DateTime incorrectly parsed #1901

Description

@eduardosand

Hi,

I am reaching a last few datasets for a project, and now reaching the more problematic of the datasets that still need to be looked at.
I have one dataset that is mostly fine but the header information indicated that the "File was not properly closed", so the 'recording_closed' that nlxheader.py is looking for can't parse the DateTime information. Instead, the dt2 generated has Date as 'File' and Time as 'was'.

I edited nlxheader.py on my end(line 351-353) to

            dt2 = sr.groupdict()
            if dt2['date'] == 'File':
                self['recording_closed'] = 'File was not properly closed'
            else:
                self["recording_closed"] = dateutil.parser.parse(f"{dt2['date']} {dt2['time']}")

Not the cleanest solution, but gets the job done and I can load the rest of this particular dataset. I think this is related to a previous issue, when the recording_closed information wasn't present at allissue here but this issue is distinct from that.

I am happy to help think about better resolutions to this if needed, or assist in pushing this.

Activity

  1. h-mayorquin commented on Sep 30, 2026

    @h-mayorquin
    Contributor

    I will take a look into this.

  2. h-mayorquin commented on Oct 2, 2026

    @h-mayorquin
    Contributor

    Hi, @eduardosand
    Thanks for reporting this again (you also hit it in #1212!). I took a look and the fix is simple:
    #1908

    The thing is that neo already handled this. The old NeuralynxIO warned on File was not closed properly back in 2017, but the check got lost in later refactors. That is why tests against real data are so important as they keep this from happening again.

    So I would REALLY like an example file if you can share one. It can be the full recording. I will stub it to a small size for our testing data, and anonymize it if you care about that.

  3. eduardosand commented on Oct 8, 2026

    @eduardosand
    Author

    hi, @h-mayorquin

    Thanks for the help. I recall this being fixed already, so figured it'd be easy to solve, glad it was easy. I might have shared data in the past for something related, but regardless I just shared with you a file on google drive. Hard to future proof what will be considered HIPPA data in the future (neural and auditory data may be identifiable at some point), so I was cautious and shared a photodiode file from this session that contains an analog trigger signal for events, should have the same missing header problem.

    Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions