-
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
Conversation
xpdtools/pipelines/qoi.py
Outdated
@@ -29,3 +30,44 @@ | |||
|
|||
pdf_argrelmax_kwargs = pdf_peaks.upstreams[0].kwargs | |||
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs | |||
|
|||
|
|||
def max_value(pdf): |
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.
these need docstrings.
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 believe this is the old commit. The more recent commit has these functions moved to the tools.py file with docstrings.
xpdtools/pipelines/qoi.py
Outdated
@@ -29,3 +30,10 @@ | |||
|
|||
pdf_argrelmax_kwargs = pdf_peaks.upstreams[0].kwargs | |||
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs | |||
|
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 seems like a lot of extra lines, can we reduce it down to 1?
xpdtools/tools.py
Outdated
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf |
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.
ndarray
and the description need to be on different lines eg
g : ndarray
g(r) of the pdf
xpdtools/tools.py
Outdated
@@ -581,3 +583,85 @@ def inner(x, *args, **kwargs): | |||
return func(*args, **kwargs) | |||
|
|||
return inner | |||
|
|||
|
|||
def max_value(g, r): |
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 does this take in r? It doesn't seem to be used.
xpdtools/tools.py
Outdated
def average_pearson(group, g,r): | ||
"""Computes the average pearson of this PDF with the rest of the group | ||
|
||
Parameters |
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 has too many indents. Parameters
should be on the same indentation as the description line.
@@ -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 comment
The 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 len
on an array
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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok
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.
please work on your git commit messages. They suck currently
xpdtools/tools.py
Outdated
|
||
Parameters | ||
---------- | ||
g : ndarray g(r) of the pdf |
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.
does this function only work for a PDF?
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.
The functions should work for any 2 variable data. I assumed the inputs were pdfs because the end goal. Would it be better to make this more general (x,y instead of r,g)?
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 think x, y would be better. You might identify x and y as independent and dependent variables.
|
||
|
||
def max_value(g, r): | ||
"""Returns largest value |
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())?
QoIs implemented: Highest Value, Total Counts, Tallest Peak Height, Tallest Peak R Value ,Oscillation behavior
Oscillation Behavior doesn't quite work yet as a QOI.