DynamicsAndNeuralSystems / DynamicsAndNeuralSystems/pycatch22

co_autocorrs NAN issue

Open
#32 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
103
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I was testing what happened when you insert an array of just 0's into pycatch22 and its local C file. Functions that use co_autocorrs, such as Co_firstmin and co_f1, will face a division by zero error and therefore return NaN as a complex number, this happens when dividing F by the divisor.

However, what I found interesting is that running these functions on pycatch22 will return 0, while if you run them locally on C it returns the length of the array. Is this discrepancy happening due to the python wrapper (python_wrapper_int)?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing co_autocorrs and the python_wrapper_int path used by Co_firstmin and co_f1 on an all-zero array. Reproduce the result in pycatch22 and local C, then determine why one returns 0 while the other returns the array length; done means the discrepancy is explained and the behavior is made consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.