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

Quickly get sweep numbers without generating sweep table #463

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kasbaker
Copy link
Contributor

@kasbaker kasbaker commented Jul 23, 2020

Overview:

Generating the sweep table can take a long time. For fast plotting, all you need is sweep_data for each sweep you want to plot. Adding EphysDataSet.sweep_numbers as a property that returns EPhysDataSet._data.sweep_numbers allows you to map EPhysDataSet.get_sweep_data onto the sweep_numbers you wish to plot.

Addresses:

This is a small addition so no issue was created on GitHub

Type of Fix:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
  • Documentation Change

Solution:

Adding sweep_numbers as a property avoids accessing ._data, a protected attribute of this class.

Changes:

Just these lines added to ephys_data_set.py

    @property
    def sweep_numbers(self):
        """ Returns array containing all sweep numbers in this data set.

        Returns
        -------
        sweep_numbers : numpy.ndarray
            Array containing all the sweep numbers

        """
        return self._data.sweep_numbers

Validation:

Tested in a scratch file:

from ipfx.dataset.create import create_ephys_data_set

data_set = create_ephys_data_set(r"path/filename.nwb")
print(data_set.sweep_numbers)

Prints an array of sweep numbers as expected

Screenshots: N/A

Unit Tests: N/A

Script to reproduce error and fix: N/A

Configuration details: N/A

Checklist

  • My code follows
    Allen Institute Contribution Guidelines
  • My code is unit tested and does not decrease test coverage
  • Minor change that should not require unit test
  • I have performed a self review of my own code
  • My code is well-documented, and the docstrings conform to
    Numpy Standards
  • I have updated the documentation of the repository where
    appropriate
  • The header on my commit includes the issue number
  • Minor change so issue not created
  • My code passes all tests
  • I have updated the CHANGELOG.md with the description of changes understandable by end users

Notes:

N/A

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