bowman-lab / enspara

Modeling molecular ensembles with scalable data structures and parallel computing
https://enspara.readthedocs.io
GNU General Public License v3.0
33 stars 16 forks source link

enspara not executing correctly #204

Open MMLawal opened 3 years ago

MMLawal commented 3 years ago

This traceback error pops when executing enspara Kindly assist

INFO:numexpr.utils:NumExpr defaulting to 8 threads.
Traceback (most recent call last):
  File "/Users/monsurat/opt/anaconda3/bin/enspara", line 33, in <module>
    sys.exit(load_entry_point('enspara==0.1.1', 'console_scripts', 'enspara')())
  File "/Users/monsurat/opt/anaconda3/lib/python3.8/site-packages/enspara-0.1.1-py3.8-macosx-10.9-x86_64.egg/enspara/apps/main.py", line 44, in main
    args = identify_app(argv)
  File "/Users/monsurat/opt/anaconda3/lib/python3.8/site-packages/enspara-0.1.1-py3.8-macosx-10.9-x86_64.egg/enspara/apps/main.py", line 23, in identify_app
    while h in argv and argv.index(h) != 1:
TypeError: argument of type 'NoneType' is not iterable
sukritsingh commented 3 years ago

From the stack trace it looks like you're running main.py but not passing any further command line arguments (which it expects)? Hard to be sure from this alone, unfortunately. Could you provide the command line argument you run when you're achieving this error? Anything (including files) we could use to minimally reproduce this error would be helpful!

MMLawal commented 3 years ago

Hello, the command line argument is "enspara"

or

enspara cluster \ 
  --trajectories trajectory-*.xtc \ 
  --topology fs-peptide.pdb \ 
  --algorithm khybrid \ 
  --cluster-number 20 \ 
  --subsample 10 \ 
  --atoms '(name N or name C or name CA)' \ 
  --distances ./fs-khybrid-clusters0020-distances.h5 \ 
  --center-features ./fs-khybrid-clusters0020-centers.pickle \ 
  --assignments ./fs-khybrid-clusters0020-assignments.h5
sukritsingh commented 3 years ago

Looks like you are missing some \ characters - you'll want to include a \ at the end of every single line in your command (in the same way you have it for lines 2 and 3 of your current command as written.

MMLawal commented 3 years ago

I did not omit \ . Something was off during posting. Sorry

sukritsingh commented 3 years ago

At a glance nothing seems off about the command line you submitted, however, the main.py script is not one as commonly used - seems like the following section in identify_app() is causing issues:

    helpstack = []
    for h in ['--help', '-h']:
        while h in argv and argv.index(h) != 1:
            argv.remove(h)
            helpstack.append(h)

May be worth identifying the exact problem and either submitting a new issue (or, if you're willing, debugging and submitting a PR?).

In the meantime, a more common way to utilize enspara is through the cluster.py app which can also be found in the apps directory. The command line you provided would look almost identical to the one you wrote, but instead just call python /path/to/enspara/enspara/apps/cluster.py followed by the rest of your arguments. That should work fine!

justinrporter commented 3 years ago

Hmm this does seem to be an issue. It looks like you're using the exact command from the tutorial, right? I wonder if we broke identify_app() somehow. It has always been brittle...

sukritsingh commented 3 years ago

In the brief moment that I was looking at it, my sense is that argv is always reading NoneType no matter what you put in. Perhaps something about argparse has changed? In newer versions I think you're supposed to do just args = parser.parse_args() for example (ie not pass argv)...

anonymnon commented 1 year ago

Hello, I am also getting a similar error, and I followed the @justinrporter posted in a previous thread. I executed the cluster program using the following method: python path/to/enspara/apps/cluster.py instead of enspara cluster as was suggested. The program executed successfully.