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

Add default name="units" to Units object in the mock_Units testing function #1883

Merged

Conversation

h-mayorquin
Copy link
Contributor

Related to this discussion here:
#1882

This is a quality of life small change that would allow two things to work:

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

nwbfile = mock_NWBFile()
units_table = mock_Units(num_units=5)
nwbfile.units = units_table

The only downside is that for Units object that are destined for some other places of the nwbfile (.e.g processing) this will not follow the best practices. As these are functions that are mainly used for testing I think that this is not a big deal.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.82%. Comparing base (2259bed) to head (9dcf7f9).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1883      +/-   ##
==========================================
- Coverage   91.81%   83.82%   -8.00%     
==========================================
  Files          27       27              
  Lines        2627     2627              
  Branches      688      688              
==========================================
- Hits         2412     2202     -210     
- Misses        142      330     +188     
- Partials       73       95      +22     
Flag Coverage Δ
integration ?
unit 83.82% <ø> (ø)

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.

@h-mayorquin h-mayorquin marked this pull request as ready for review April 2, 2024 01:38
@rly
Copy link
Contributor

rly commented Apr 24, 2024

Looks good. Thanks @h-mayorquin

@rly rly added this to the 2.7.0 milestone Apr 24, 2024
@rly rly added the category: enhancement improvements of code or code behavior label Apr 24, 2024
@rly rly merged commit 001a9fd into NeurodataWithoutBorders:dev Apr 24, 2024
20 of 24 checks passed
@h-mayorquin h-mayorquin deleted the add_default_name_to_mock_units branch April 24, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants