CaviTracer - additonal functions and multoprocessing - #2266
Conversation
jamesmkrieger
left a comment
There was a problem hiding this comment.
Generally looks good, just some minor changes
| return cavities_all, surfaces_all | ||
|
|
||
| if max_proc is None: | ||
| max_proc = multiprocessing.cpu_count() |
There was a problem hiding this comment.
This is too high for a default. We don’t want the program to take over someone’s whole cpu if they aren’t expecting it. I think other places use cpu count divided by 2
|
|
||
| import multiprocessing | ||
|
|
||
| if len(tasks) == 0: |
There was a problem hiding this comment.
what triggers getting len(tasks) == 0? There should probably be a warning here before returning empty lists
| 'sparsity'})) | ||
|
|
||
| if forbidden_params: | ||
| raise ValueError("Grid-controlled arguments must not be passed in kwargs: {0}".format(', '.join(forbidden_params))) |
There was a problem hiding this comment.
split long lines like this one
| - getSurfaceCavityResidueNamesMultipleFrames() | ||
|
|
||
| Residue labels are expected to contain chain identifiers, e.g. ASP108:A. | ||
| If count_residue_names is False, individual residues are counted, e.g. |
There was a problem hiding this comment.
This seems redundant with docs for the arg below
| ASP108 in chain A. If count_residue_names is True, residue types are counted, | ||
| e.g. ASP in chain A. | ||
|
|
||
| If count_once_per_frame is True, the same residue is counted only once per |
There was a problem hiding this comment.
this one is redundant with arg docs below too
| labels = [item[0] for item in items] | ||
| values = [item[1] for item in items] | ||
|
|
||
| plt.figure(figsize=(14, 4)) |
There was a problem hiding this comment.
we generally allow users to handle the plt.figure and plt.show parts outside the function and use prody's auto_show config to help with that. plt.show may not be useful in some application cases like running a script and saving the figures straight away
I added several new functionalities:
How to use them will be displayed in the tutorials:
https://github.com/prody/ProDy-website/tree/master/tutorials/cavitracer_tutorial
@briza81 @MatthewLicht