Skip to content

Adding norm parameter to smooth, and allowing for smoothing in the decode1d and 2d functions #249

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

Closed
wants to merge 5 commits into from

Conversation

dhruvm9
Copy link
Contributor

@dhruvm9 dhruvm9 commented Mar 22, 2024

  1. The Gaussian window used in smooth can either be normalized (norm=True), or not (norm=False).
  2. decode1d and decode2d now take the arguments of smooth as optional arguments, which allow for smoothing of the group before decoding. The default values of the call for smooth do no smoothing.

@dhruvm9 dhruvm9 requested a review from gviejo as a code owner March 22, 2024 16:30
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8393458494

Details

  • 3 of 7 (42.86%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 84.33%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pynapple/core/time_series.py 1 3 33.33%
pynapple/process/decoding.py 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
pynapple/core/time_series.py 1 47.95%
Totals Coverage Status
Change from base Build 8130753953: -0.3%
Covered Lines: 2190
Relevant Lines: 2522

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8393458494

Details

  • 3 of 7 (42.86%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 84.68%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pynapple/core/time_series.py 1 3 33.33%
pynapple/process/decoding.py 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
pynapple/core/time_series.py 1 48.61%
Totals Coverage Status
Change from base Build 8130753953: 0.02%
Covered Lines: 2190
Relevant Lines: 2522

💛 - Coveralls

@coveralls
Copy link

coveralls commented Mar 22, 2024

Pull Request Test Coverage Report for Build 8528172187

Details

  • 3 of 7 (42.86%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-60.3%) to 24.51%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pynapple/core/time_series.py 1 3 33.33%
pynapple/process/decoding.py 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
pynapple/core/time_series.py 1 24.07%
Totals Coverage Status
Change from base Build 8528071119: -60.3%
Covered Lines: 758
Relevant Lines: 2575

💛 - Coveralls

Copy link
Contributor

@gviejo gviejo left a comment

Choose a reason for hiding this comment

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

You need to write the test for it in the file tests/test_decoding.py

@@ -445,7 +445,7 @@ def convolve(self, array, ep=None, trim="both"):

return self.__class__(t=time_array, d=new_data_array, time_support=ep)

def smooth(self, std, size):
def smooth(self, std, size, norm=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

Norm should be True by default.

Description
Size of the Gaussian window
norm : bool
To toggle between having a normalized Gaussian kernel or not. Default value is false.
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to True

Size of the Gaussian window to be used for smoothing the data. Default value is None.
smoothing_std : float
Standard deviation of the Gaussian kernel for smoothing. Default value is 0.
norm : bool
Copy link
Contributor

Choose a reason for hiding this comment

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

You should explain more here what it does. When computing a spike count, it smooth it and preserves the spike count in the 0 bin.

size of the Gaussian window to be used for smoothing the data. Default value is None.
smoothing_std : float
Standard deviation of the Gaussian kernel for smoothing. Default value is 0.
norm : bool
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@dhruvm9 dhruvm9 closed this Apr 2, 2024
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.

3 participants