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

find_sample_from_2dscan #57

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

find_sample_from_2dscan #57

wants to merge 4 commits into from

Conversation

MehmetTopsakal
Copy link

find_sample_from_2dscan

Copy link
Member

@CJ-Wright CJ-Wright left a comment

Choose a reason for hiding this comment

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

This looks great!
I have a few inline comments.
Would you be interested in writing a test? (If not I can push up tests to this branch).


if params is None:
print('params is not provided. Using default parameters')
params = {'eps':0.05,'min_samples':20,'n_jobs':1,
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to have these as keyword arguments to the function?
For example:

def find_sample_from_2dscan(I_arr, xy_arr, Q_arr=None, eps=0.05, min_samples=20, n_jobs=1, ...):

Copy link
Author

Choose a reason for hiding this comment

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

@CJ-Wright How do we do the testing?

The default parameters are working for 44 different samples.

See this gif:
all

Copy link
Member

Choose a reason for hiding this comment

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

We use the pytest system. The test suite for the tools module is located here.
One usually hands the function parameters with known results and then checks that the results of the function are the expected results.


"""

from sklearn.cluster import DBSCAN
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to put these imports at the top of the module?

's_ratio':0.5,'qrange':(1,5),
'use_unclassified':True}

if isinstance(Q_arr,np.ndarray):
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 this might be able to be if Q_arr since None is False like

@codecov-io
Copy link

codecov-io commented Sep 26, 2018

Codecov Report

Merging #57 into master will decrease coverage by 2.54%.
The diff coverage is 11.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
- Coverage   87.43%   84.88%   -2.55%     
==========================================
  Files          16       16              
  Lines         748      774      +26     
==========================================
+ Hits          654      657       +3     
- Misses         94      117      +23
Impacted Files Coverage Δ
xpdtools/tools.py 78.67% <11.53%> (-9.44%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad01072...adf90af. Read the comment docs.

@CJ-Wright
Copy link
Member

This seems to be failing due to anaconda.org 503 errors so we might give it a few mins and try the build again.

@CJ-Wright
Copy link
Member

How many points could we get away with for the tests?

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 see my inline comment. I think we need a conversation to decide what goes where.

Also, make sure that @MehmetTopsakal is up to speed with testing.




def find_sample_from_2dscan(I_arr, xy_arr, Q_arr=None,
Copy link
Member

Choose a reason for hiding this comment

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

I am a little confused about whether this is in the right place. It seems that most things in xpdtools.tools are fairly low-level functions for the functioning of the pipelines. On the other hand, I think this is some kind of script for actually doing xy scans to find a sample? Or is it for analyzing 2d data from such a scan to find positions of the sample given the data? I am afraid that if we don't hae the right structure to our files and projects it will become a maintenance (and user) nightmare. Can we have a discussion (maybe a call) to discuss some of these issues? I would like to define different activities and group code accordingly.

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.

4 participants