-
Couldn't load subscription status.
- Fork 38
Added ashist() method to stats
#452
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
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #452 +/- ##
==========================================
+ Coverage 91.84% 91.86% +0.01%
==========================================
Files 60 60
Lines 4255 4300 +45
==========================================
+ Hits 3908 3950 +42
- Misses 347 350 +3
☔ View full report in Codecov by Sentry. |
|
Great, I've been hoping for this feature for so long! Looks good. Two thoughts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm willing to merge this asap because the corresponding issue has been open for so long. However, I'd like to say that I spent a bunch of time on proposing a spec that I thought was reasonable at the time, and this PR does not conform to that proposal.
xgi/stats/__init__.py
Outdated
|
|
||
| def dist(self): | ||
| return [np.histogram(data, density=True) for data in self.asnumpy().T] | ||
| def dist(self, bins=10, density=False, log_binning=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to overwrite the IDStat.dist method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean. I'm importing dist (now called hist) from utils to avoid rewriting the same function for both IDStat and MultiIDStat.
|
Good call. There are definitely some discrepancies between what we decided in that issue vs. what I did. My biggest takeaways on what I need to fix are (1) call this |
|
@maximelucas @leotrs I think I addressed your comments - let me know if there's anything else I can address! |
|
Thanks Nich, functionality looks good to me. Two questions:
|
I opted to only test the xgi.hist function because the tests for the stats package are a bit of a mess right now IMO and the stats functions directly call xgi.hist() so all the functionality is tested. If it's okay with you, I will make an issue to reorganize the stats tests (we can discuss the best way to do this) so that it's more organized. Good catch on the docs - fixed now. |
Fixes #117. Added a method to compute the distribution of an array of numbers. Design decisions attempted to roughly follow the discussion in #117.