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

Fix add_data_interface functionality #2052

Merged
merged 4 commits into from
Mar 12, 2025
Merged

Fix add_data_interface functionality #2052

merged 4 commits into from
Mar 12, 2025

Conversation

stephprince
Copy link
Contributor

@stephprince stephprince commented Mar 4, 2025

Motivation

Fix #2050.

In #2011 I mistakenly removed the functionality of add_data_interface when updating the deprecation warning. I think add_data_interface should still operate as expected until the function is fully removed and replaced by add.

How to test the behavior?

from pynwb.testing.mock.file import mock_NWBFile
from pynwb.testing.mock.ecephys import mock_ElectricalSeries


nwbfile = mock_NWBFile()

# Create processing modules
ecephys_module = nwbfile.create_processing_module('ecephys', 'Example ecephys data')

electrical_series = mock_ElectricalSeries()
ecephys_module.add_data_interface(electrical_series)

assert len(nwbfile.processing["ecephys"].data_interfaces) == 1

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 Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.85%. Comparing base (01d9ab9) to head (d3c662c).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2052   +/-   ##
=======================================
  Coverage   92.84%   92.85%           
=======================================
  Files          28       28           
  Lines        2755     2756    +1     
  Branches      716      716           
=======================================
+ Hits         2558     2559    +1     
  Misses        127      127           
  Partials       70       70           
Flag Coverage Δ
integration 73.69% <0.00%> (-0.03%) ⬇️
unit 82.76% <100.00%> (+<0.01%) ⬆️

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.

@stephprince stephprince changed the title Readd add_data_interface functionality Fix add_data_interface functionality Mar 4, 2025
@stephprince stephprince marked this pull request as ready for review March 5, 2025 00:10
@stephprince stephprince requested a review from rly March 5, 2025 00:10
@stephprince stephprince merged commit 2888ad0 into dev Mar 12, 2025
26 checks passed
@stephprince stephprince deleted the readd-data-interface branch March 12, 2025 20:06
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]: add_data_interface fails silently on pynwb 3.0
2 participants