Skip to content

Add get_duration and get_starting_time for Units table#2164

Draft
h-mayorquin wants to merge 3 commits intodevfrom
add_timing_methods_to_units_table
Draft

Add get_duration and get_starting_time for Units table#2164
h-mayorquin wants to merge 3 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 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.88%. Comparing base (3fc14aa) to head (b932db4).

Files with missing lines Patch % Lines
src/pynwb/misc.py 70.21% 6 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2164      +/-   ##
==========================================
- Coverage   95.28%   94.88%   -0.40%     
==========================================
  Files          29       29              
  Lines        2904     2951      +47     
  Branches      748      760      +12     
==========================================
+ Hits         2767     2800      +33     
- Misses         83       89       +6     
- Partials       54       62       +8     
Flag Coverage Δ
integration 72.78% <4.25%> (-1.11%) ⬇️
unit 84.85% <70.21%> (-0.24%) ⬇️

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
Contributor

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?

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