-
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
find_sample_from_2dscan #57
base: master
Are you sure you want to change the base?
Conversation
add find_sample_from_2dscan
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 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).
xpdtools/tools.py
Outdated
|
||
if params is None: | ||
print('params is not provided. Using default parameters') | ||
params = {'eps':0.05,'min_samples':20,'n_jobs':1, |
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.
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, ...):
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.
@CJ-Wright How do we do the testing?
The default parameters are working for 44 different samples.
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.
xpdtools/tools.py
Outdated
|
||
""" | ||
|
||
from sklearn.cluster import DBSCAN |
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.
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): |
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 this might be able to be if Q_arr
since None
is False
like
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
This seems to be failing due to anaconda.org 503 errors so we might give it a few mins and try the build again. |
How many points could we get away with for the tests? |
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 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, |
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 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.
find_sample_from_2dscan