astropy / astropy/astropy

Circular Statistics: astropy vs scipy

Open
#13,749 8 comments 0 reactions 0 assignees View on GitHub
needs-discussion stats
Dominant language
Python
Stars
5.3k
Forks
2.2k
Avg merge
1d 20h
Merged PRs (30d)
81

Description

Seems like scipy has some circular statistics support that might overlap with astropy a little. However, API is not exactly the same and I am not sure if both sides cover all the same use cases. There is a need to do the following:

1. Compare https://docs.astropy.org/en/latest/stats/circ.html with https://docs.scipy.org/doc/scipy/reference/stats.html#circular-statistical-functions
2. Who do we talk to on the scipy side about this?
3. How do we make them 100% compatible?
4. Have a plan and roadmap to deprecate what we have and point people upstream.
5. If Option 4 is not possible, clearly document why and when user should choose one over the other.

### circmean

astropy: `astropy.stats.circstats.circmean(data[, axis, weights])`
*Computes the circular mean angle of an array of circular data.*

scipy: `scipy.stats.circmean(samples[, high, low, axis, nan_policy])`
*Compute the circular mean for samples in a range.*

### circstd

astropy: `astropy.stats.circstats.circstd(data[, axis, weights, method])`
*Computes the circular standard deviation of an array of circular data.*

scipy: `scipy.stats.circstd(samples[, high, low, axis, ...])`
*Compute the circular standard deviation for samples assumed to be in the range [low to high].*

### circvar

astropy: `astropy.stats.circstats.circvar(data[, axis, weights])`
*Computes the circular variance of an array of circular data.*

scipy: `circvar(samples[, high, low, axis, nan_policy])`
*Compute the circular variance for samples assumed to be in a range.*

Contributor guide

Open the contributing guide

Research direction

Start by comparing Astropy's circstats documentation with SciPy's circular statistical functions for circmean, circstd, and circvar, including their parameters and supported use cases. Identify the appropriate SciPy contact, then produce a compatibility and deprecation roadmap; if upstreaming is not feasible, document the differences and when users should choose each implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.