Skip to content

Initial QOIs#61

Open
Sasaank wants to merge 3 commits into
xpdAcq:masterfrom
Sasaank:S_Bandi_qoi
Open

Initial QOIs#61
Sasaank wants to merge 3 commits into
xpdAcq:masterfrom
Sasaank:S_Bandi_qoi

Conversation

@Sasaank

@Sasaank Sasaank commented Nov 7, 2018

Copy link
Copy Markdown

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.

Comment thread xpdtools/pipelines/qoi.py Outdated
mean_argrelmax_kwargs = mean_peaks.upstreams[0].kwargs


def max_value(pdf):

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread xpdtools/pipelines/qoi.py Outdated

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

Copy link
Copy Markdown
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?

Comment thread xpdtools/tools.py Outdated

Parameters
----------
g : ndarray g(r) of the pdf

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

Comment thread xpdtools/tools.py Outdated
return inner


def max_value(g, r):

Copy link
Copy Markdown
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.

Comment thread xpdtools/tools.py Outdated
def average_pearson(group, g,r):
"""Computes the average pearson of this PDF with the rest of the group

Parameters

Copy link
Copy Markdown
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.

Comment thread xpdtools/tools.py


def total_counts(g,r):
def total_counts(g):

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

Comment thread xpdtools/tools.py


def average_pearson(group, g,r):
def average_pearson(group, g, r):

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

Choose a reason for hiding this comment

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

ah ok

@sbillinge sbillinge left a comment

Copy link
Copy Markdown
Member

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

Comment thread xpdtools/tools.py Outdated

Parameters
----------
g : ndarray g(r) of the pdf

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread xpdtools/tools.py


def max_value(g, r):
"""Returns largest value

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