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

mock_ElectricalSeries : Make number of electrodes between data an electrode region agree when explicitly passing data #2019

Conversation

h-mayorquin
Copy link
Contributor

@h-mayorquin h-mayorquin commented Jan 24, 2025

Motivation

The following code raises this warning:

import numpy as np
from pynwb.testing.mock.ecephys import mock_ElectricalSeries
from pynwb.testing.mock.file import mock_NWBFile


data = np.ones((10000000,128))

nwbfile = mock_NWBFile()

ts = mock_ElectricalSeries(data=data, nwbfile=nwbfile)
/home/heberto/development/pynwb/src/pynwb/ecephys.py:109: UserWarning: ElectricalSeries 'ElectricalSeries2': The second dimension of data does not match the length of electrodes. Your data may be transposed.
  warnings.warn("%s '%s': The second dimension of data does not match the length of electrodes. "

This PR fixes the mock by adjusting the number of electrodes when data is passed explicitly.

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 Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.73%. Comparing base (739ee54) to head (8986e4d).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2019   +/-   ##
=======================================
  Coverage   91.73%   91.73%           
=======================================
  Files          27       27           
  Lines        2722     2722           
  Branches      710      710           
=======================================
  Hits         2497     2497           
  Misses        149      149           
  Partials       76       76           
Flag Coverage Δ
integration 72.96% <ø> (ø)
unit 82.29% <ø> (ø)

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 changed the title mock_ElectricalSeries : Make number of electrodes betweeen data an electrode region agree when explicitly passing data mock_ElectricalSeries : Make number of electrodes between data an electrode region agree when explicitly passing data Jan 27, 2025
stephprince
stephprince previously approved these changes Jan 28, 2025
Copy link
Contributor

@stephprince stephprince left a comment

Choose a reason for hiding this comment

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

Small typo fix in changelog otherwise looks good to me. Thanks!

Co-authored-by: Steph Prince <[email protected]>
@stephprince stephprince merged commit c0ba7e1 into NeurodataWithoutBorders:dev Jan 28, 2025
26 checks passed
@h-mayorquin h-mayorquin deleted the small_bug_in_mock_electrical_series branch January 28, 2025 19:25
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