HyMD icon indicating copy to clipboard operation
HyMD copied to clipboard

ValueError for prepare bonds

Open hmcezar opened this issue 3 years ago • 1 comments

When running the peptide example with the main branch version I'm getting (not sure if it's something related with Python 3.10 or my conda installation or not):

Traceback (most recent call last):
  File "/home/hmcezar/anaconda3/envs/hymd/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/hmcezar/anaconda3/envs/hymd/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/hmcezar/Dev/Cascella_HyMD/hymd/__main__.py", line 2, in <module>
    main()
  File "/home/hmcezar/Dev/Cascella_HyMD/hymd/main.py", line 279, in main
    bonds_prep = prepare_bonds(
  File "/home/hmcezar/Dev/Cascella_HyMD/hymd/force.py", line 541, in prepare_bonds
    bonds_2, bonds_3, bonds_4, bb_index = prepare_bonds_old(
  File "/home/hmcezar/Dev/Cascella_HyMD/hymd/force.py", line 430, in prepare_bonds_old
    and [
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

hmcezar avatar May 02 '22 11:05 hmcezar

I guess it's because the dihedral coeffs are numpy arrays, while in an earlier version they were simple lists. So either we revert that change or we fix the condition in prepare_bonds_old. Anyway many of these problems (like also parsing the dihedrals in input_parser.py, which is written in a very clucky way) will get fixed we the index based connectivity #137 is merged.

Lun4m avatar May 02 '22 12:05 Lun4m