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

Add better bad-input checking after parsing outstruct args #90

Open
gavinmischler opened this issue Oct 27, 2022 · 0 comments
Open

Add better bad-input checking after parsing outstruct args #90

gavinmischler opened this issue Oct 27, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@gavinmischler
Copy link
Collaborator

Expected Behavior

After parsing args, there should be better and more descriptive errors thrown if data is not correct.

Actual Behavior

For example, if you try to pass a list of length 2 (when it should be an array of length 2), to responsive_ttest, the error comes up later, but it should really happen right after the inputs are parsed

https://github.com/naplab/naplib-python/blob/main/naplib/stats/responsive_elecs.py#L112

Template Code

Y = [np.random.rand(400,3) for _ in range(5)]
_, stats = responsive_ttest(resp=Y, befaft=[1,1], sfreq=100, alpha=0.01, random_state=1)

whereas no error happens if you correctly pass befaft as an array:

_, stats = responsive_ttest(resp=Y, befaft=np.array([1,1]), sfreq=100, alpha=0.01, random_state=1)

Your Environment

  • Python version: 3.9
  • naplib-python version: 1.4
@gavinmischler gavinmischler added the enhancement New feature or request label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant