-
Notifications
You must be signed in to change notification settings - Fork 11
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 get_histogram utility, option to return histogram of bond lengths and angles #33
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
+ Coverage 99.65% 99.67% +0.01%
==========================================
Files 6 7 +1
Lines 293 308 +15
==========================================
+ Hits 292 307 +15
Misses 1 1
|
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.
A couple minor suggestions. Excited to see all the work you're doing with MSIBI! 🙌
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.
Nice work! One last minor suggestion then LGTM
cmeutils/plotting.py
Outdated
s = sum(bin_heights) | ||
bin_heights = np.array( | ||
[float(i)/s for i in bin_heights] | ||
) |
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.
s = sum(bin_heights) | |
bin_heights = np.array( | |
[float(i)/s for i in bin_heights] | |
) | |
bin_heights /= sum(bin_heights) |
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.
This throws an error.
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'true_divide' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
I did change it so it's a bit cleaner/faster though.
Both of the
angle_distribution
andbond_distribution
functions are a bit of a misnomer. Currently, they only return an array of the calculated bond angles and lengths, rather than giving the actual distributions.This PR adds an additional parameter to these functions that returns a distribution of these values. I decided to add a parameter rather than outright changing the behavior of the function in case there are still use cases where we want a list of the actual bond lengths and angles. However, I'm open to changing this if someone thinks there is a better approach.
I still need to add some unit tests.