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 betweeen data an electrode region agree when explicitly passing data #2019

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

h-mayorquin
Copy link
Contributor

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 (45e86c0).

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.

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