Skip to content

Conversation

@MGAMZ
Copy link
Contributor

@MGAMZ MGAMZ commented Jan 7, 2026

This is a follow-up PR from #1624 and #1629 .

This PR delays the computaion of null_value in spikeinterface module. This can avoid the error of being unable to obtain the default null value when null values are not needed.

Note that is PR requires further discussion combining #1624 and #1629 before we determine to merge it.

Copilot AI review requested due to automatic review settings January 7, 2026 07:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the computation of null values by deferring their calculation until it's determined that rows will actually be added to NWB tables. This prevents errors when default null values cannot be obtained but aren't needed because no new rows are being added.

Key Changes:

  • Moved null value computation in add_electrodes_to_nwbfile to occur only when channel_ids_to_add is non-empty
  • Moved null value computation in _add_units_table_to_nwbfile to occur only when rows_to_add is non-empty

@MGAMZ MGAMZ force-pushed the fix/EagerEvaluation-null_values_for_properties branch from a917bbd to 51520d2 Compare January 8, 2026 15:15
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.48%. Comparing base (b3e6463) to head (51520d2).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1633   +/-   ##
=======================================
  Coverage   87.48%   87.48%           
=======================================
  Files         159      159           
  Lines       11362    11364    +2     
=======================================
+ Hits         9940     9942    +2     
  Misses       1422     1422           
Flag Coverage Δ
unittests 87.48% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...c/neuroconv/tools/spikeinterface/spikeinterface.py 80.00% <100.00%> (+0.04%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant