-
Notifications
You must be signed in to change notification settings - Fork 10
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
Initial QOIs #61
base: master
Are you sure you want to change the base?
Initial QOIs #61
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,3 @@ | |
|
||
pdf_argrelmax_kwargs = pdf_peaks.upstreams[0].kwargs | ||
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -585,13 +585,13 @@ def inner(x, *args, **kwargs): | |
return inner | ||
|
||
|
||
def max_value(g, r): | ||
def max_value(g): | ||
"""Returns largest value | ||
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf | ||
r : ndarray of corresponding r values | ||
g : ndarray | ||
g(r) of the pdf | ||
|
||
Returns | ||
------- | ||
|
@@ -602,13 +602,16 @@ def max_value(g, r): | |
return np.amax(g) | ||
|
||
|
||
def tallest_peak(g,r): | ||
def tallest_peak(g, r): | ||
"""Returns r,g(r) of the tallest peak | ||
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf | ||
r : ndarray of corresponding r values | ||
g : ndarray | ||
g(r) of the pdf | ||
|
||
r : ndarray | ||
corresponding r values | ||
|
||
Returns | ||
------- | ||
|
@@ -617,7 +620,7 @@ def tallest_peak(g,r): | |
float : | ||
g(r) value of the tallest peak | ||
|
||
""" | ||
""" | ||
peaks = sig.find_peaks(g) | ||
height = [] | ||
r_val = [] | ||
|
@@ -627,41 +630,43 @@ def tallest_peak(g,r): | |
return r_val[np.argmax(height)], np.amax(height) | ||
|
||
|
||
def total_counts(g,r): | ||
def total_counts(g): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not certain we need this function if it is only calling |
||
"""Returns total number of data points in graph | ||
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf | ||
r : ndarray of corresponding r values | ||
|
||
Returns | ||
------- | ||
float : | ||
total number of data points | ||
Parameters | ||
---------- | ||
g : ndarray | ||
g(r) of the pdf | ||
|
||
Returns | ||
------- | ||
int : | ||
total number of data points | ||
|
||
""" | ||
""" | ||
return len(g) | ||
|
||
|
||
def average_pearson(group, g,r): | ||
def average_pearson(group, g, r): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also compute the complete pearson correction? (Maybe as a separate function?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I may be confused on the stats here, to my knowledge the pearson's coefficients can be used on two different datasets. Is there a separate coefficient to compare a dataset to an entire group of datasets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could return the list of pearson's coefficents for the new pdf and all the prior pdfs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Sasaank poke There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pushed this into the other pr There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah ok |
||
"""Computes the average pearson of this PDF with the rest of the group | ||
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf | ||
r : ndarray of corresponding r values | ||
group : ndarray of PDFs (PDFs as tuples (g,r)) | ||
Returns | ||
------- | ||
float : | ||
Average pearson's coefficient | ||
Parameters | ||
---------- | ||
g : ndarray | ||
g(r) of the pdf | ||
|
||
r : ndarray | ||
corresponding r values | ||
group : ndarray | ||
Group of PDFs (PDFs as tuples (g,r)) | ||
Returns | ||
------- | ||
float : | ||
Average pearson's coefficient | ||
|
||
""" | ||
""" | ||
val = 0 | ||
for i in group: | ||
r,p = stats.pearsonr((g, r), i) | ||
r, p = stats.pearsonr((g, r), i) | ||
val = val + r | ||
return val/len(group) |
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 is not so helpful. Bear in mind what the docstring is for. It is for a user to understand what this function is for and how it should be used. Also, the docstring shouldn't include the function name, which is effectively what your's does.
In other words, why do we (or rather a user) need this function (rather than just typing np.amax())?