Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Initial QOIs #61

wants to merge 3 commits into from

Conversation

Sasaank
Copy link

@Sasaank Sasaank commented Nov 7, 2018

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.

@@ -29,3 +30,44 @@

pdf_argrelmax_kwargs = pdf_peaks.upstreams[0].kwargs
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs


def max_value(pdf):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these need docstrings.

Copy link
Author

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.

@@ -29,3 +30,10 @@

pdf_argrelmax_kwargs = pdf_peaks.upstreams[0].kwargs
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs

Copy link
Member

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?


Parameters
----------
g : ndarray g(r) of the pdf
Copy link
Member

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

@@ -581,3 +583,85 @@ def inner(x, *args, **kwargs):
return func(*args, **kwargs)

return inner


def max_value(g, r):
Copy link
Member

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.

def average_pearson(group, g,r):
"""Computes the average pearson of this PDF with the rest of the group

Parameters
Copy link
Member

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):
Copy link
Member

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):
Copy link
Member

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?)

Copy link
Author

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.

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sasaank poke

Copy link
Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok

Copy link
Member

@sbillinge sbillinge left a 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


Parameters
----------
g : ndarray g(r) of the pdf
Copy link
Member

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?

Copy link
Author

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)?

Copy link
Member

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
Copy link
Member

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())?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants