Skip to content

Add get_duration and get_starting_time for Units table#2164

Merged
bendichter merged 6 commits intodevfrom
add_timing_methods_to_units_table
Feb 5, 2026
Merged

Add get_duration and get_starting_time for Units table#2164
bendichter merged 6 commits intodevfrom
add_timing_methods_to_units_table

Conversation

@h-mayorquin
Copy link
Contributor

@h-mayorquin h-mayorquin changed the title Add get_duration and get_starting_time for Units table Add get_duration and get_starting_time for Units table Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.21%. Comparing base (3fc14aa) to head (83d462e).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
src/pynwb/misc.py 90.24% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2164      +/-   ##
==========================================
- Coverage   95.28%   95.21%   -0.08%     
==========================================
  Files          29       29              
  Lines        2904     2945      +41     
  Branches      748      757       +9     
==========================================
+ Hits         2767     2804      +37     
- Misses         83       84       +1     
- Partials       54       57       +3     
Flag Coverage Δ
integration 72.93% <4.87%> (-0.97%) ⬇️
unit 85.16% <90.24%> (+0.07%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@h-mayorquin h-mayorquin mentioned this pull request Feb 4, 2026
6 tasks
ut.add_unit(spike_times=[1.0, 2.0, 20.0]) # has BOTH earliest (1.0) AND latest (20.0)
ut.add_unit(spike_times=[10.0, 11.0, 12.0])
# Duration from earliest (1.0) to latest (20.0) = 19.0
self.assertEqual(ut.get_duration(), 19.0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are great. Can you also please add tests where the empty unit is the first unit where where the empty unit is the last unit? And also where there are multiple empty units in a row?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. I also added other tests to test defensive branches that were not included in the coverage.

@h-mayorquin h-mayorquin marked this pull request as ready for review February 5, 2026 13:52
@bendichter bendichter merged commit e00ffc0 into dev Feb 5, 2026
25 of 26 checks passed
@bendichter bendichter deleted the add_timing_methods_to_units_table branch February 5, 2026 14:16
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.

2 participants