Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update default mock_NWBFile start time #2018

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

stephprince
Copy link
Contributor

Motivation

Fix #2013. There was an error when creating a mock_NWBFile in specific time zones, where converting the default start time to local time would result in a time before the Unix epoch.

The default could also be updated to any later time, I left as 1970 for now in case that is used to indicate this is mock data.

I don't think these changes require a CHANGELOG update but can add if needed.

How to test the behavior?

from pynwb import NWBHDF5IO
from pynwb.testing.mock.file import mock_NWBFile

nwb = mock_NWBFile()

with NWBHDF5IO('test.nwb', mode='w') as io:
    io.write(nwbfile)

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running ruff check . && codespell from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.73%. Comparing base (739ee54) to head (a1c4112).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2018   +/-   ##
=======================================
  Coverage   91.73%   91.73%           
=======================================
  Files          27       27           
  Lines        2722     2722           
  Branches      710      710           
=======================================
  Hits         2497     2497           
  Misses        149      149           
  Partials       76       76           
Flag Coverage Δ
integration 72.96% <ø> (ø)
unit 82.29% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stephprince stephprince marked this pull request as ready for review January 23, 2025 22:05
@stephprince stephprince requested a review from rly January 23, 2025 22:05
@h-mayorquin
Copy link
Contributor

Hey guys, slightly related but now that python 3.9 is minimal have you considered using ZoneInfo from the standard library instead of dateutil?

https://docs.python.org/3/library/zoneinfo.html

Eventually you can eliminate another dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Issue with Default session_start_time timezone in mock_NWBFile
2 participants