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

[Fix] interpolate signal with only one value #787

Merged

Conversation

danibene
Copy link
Collaborator

Description

Interpolating a single value currently raises an error, causing tests here to fail, and I know this has also previously been an issue #740

Proposed Changes

I changed the signal_interpolate() function so that it returns a constant signal if only one x value is provided rather than raising an error.

We could alternatively check the length of the input to signal_interpolate() in rsp_rvt() where it is currently causing the error. But unless we can think of a situation in which a constant signal is not the desired output given only one x value, I feel like directly modifying signal_interpolate() makes more sense than checking the length of the input wherever signal_interpolate() is used?

Checklist

Here are some things to check before creating the PR. If you encounter any issues, do let us know :)

  • I have read the CONTRIBUTING file.
  • My PR is targetted at the dev branch (and not towards the master branch).

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2023

Codecov Report

Base: 53.77% // Head: 53.77% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (8656a66) compared to base (a45f7d4).
Patch coverage: 66.66% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #787   +/-   ##
=======================================
  Coverage   53.77%   53.77%           
=======================================
  Files         293      293           
  Lines       13298    13299    +1     
=======================================
+ Hits         7151     7152    +1     
  Misses       6147     6147           
Impacted Files Coverage Δ
neurokit2/signal/signal_interpolate.py 63.04% <66.66%> (-1.41%) ⬇️
neurokit2/rsp/rsp_simulate.py 93.75% <0.00%> (-0.90%) ⬇️
neurokit2/signal/signal_fixpeaks.py 73.76% <0.00%> (+0.76%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DominiqueMakowski
Copy link
Member

Merge when you want!

@danibene danibene merged commit 64a617f into neuropsychology:dev Feb 20, 2023
@danibene danibene deleted the fix/signal_interpolate_one_value branch March 2, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants