Acellera / htmd

HTMD: Programming Environment for Molecular Discovery
https://software.acellera.com/docs/latest/htmd/index.html
Other
255 stars 58 forks source link

ValueError: setting an array element with a sequence. on model.viewStates() #201

Closed GerardBCN closed 7 years ago

GerardBCN commented 7 years ago

I get this error when doing:

model.viewStates(ligand="resname MOL")

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-10-293b119fe16c> in <module>()
----> 1 model.viewStates(ligand="resname MOL")

/shared/gerard/HTMD/htmd/htmd/model.py in viewStates(self, states, statetype, protein, ligand, viewer, mols, numsamples, wrapsel, alignsel, gui, simlist)
    536             states = [states]
    537         if mols is None:
--> 538             mols = self.getStates(states, statetype, numsamples=numsamples, wrapsel=wrapsel, alignsel=alignsel, simlist=simlist)
    539         colors = [0, 1, 3, 4, 5, 6, 7, 9]
    540         for i, s in enumerate(states):

/shared/gerard/HTMD/htmd/htmd/model.py in getStates(self, states, statetype, wrapsel, alignsel, alignmol, samplemode, numsamples, simlist)
    485         aprun = ParallelExecutor(n_jobs=1)  # _config['ncpus'])
    486         mols = aprun(total=len(relframes), description='Getting state Molecules')\
--> 487             (delayed(_loadMols)(self, rel, molfile, wrapsel, alignsel, refmol, simlist) for rel in enumerate(relframes))
    488         return np.array(mols, dtype=object)
    489 

/shared/gerard/HTMD/htmd/htmd/parallelprogress.py in tmp(op_iter)
     28             foo = lambda args: lambda x: progressbar(x, **args)
     29             bar_func = foo(tq_args)
---> 30             return Parallel(**joblib_args)(bar_func(op_iter))
     31         return tmp
     32     return aprun

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in __call__(self, iterable)
    798             # was dispatched. In particular this covers the edge
    799             # case of Parallel used with an exhausted iterator.
--> 800             while self.dispatch_one_batch(iterator):
    801                 self._iterating = True
    802             else:

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator)
    656                 return False
    657             else:
--> 658                 self._dispatch(tasks)
    659                 return True
    660 

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in _dispatch(self, batch)
    564 
    565         if self._pool is None:
--> 566             job = ImmediateComputeBatch(batch)
    567             self._jobs.append(job)
    568             self.n_dispatched_batches += 1

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in __init__(self, batch)
    178         # Don't delay the application, to avoid keeping the input
    179         # arguments in memory
--> 180         self.results = batch()
    181 
    182     def get(self):

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in __call__(self)
     70 
     71     def __call__(self):
---> 72         return [func(*args, **kwargs) for func, args, kwargs in self.items]
     73 
     74     def __len__(self):

/shared/gerard/anaconda3/lib/python3.5/site-packages/joblib/parallel.py in <listcomp>(.0)
     70 
     71     def __call__(self):
---> 72         return [func(*args, **kwargs) for func, args, kwargs in self.items]
     73 
     74     def __len__(self):

/shared/gerard/HTMD/htmd/htmd/model.py in _loadMols(self, rel, molfile, wrapsel, alignsel, refmol, simlist)
    765 
    766 def _loadMols(self, rel, molfile, wrapsel, alignsel, refmol, simlist):
--> 767     frames = self.data.rel2sim(rel, simlist=simlist)
    768     mol = Molecule(molfile)
    769     trajs = np.empty(0, dtype=str)

/shared/gerard/HTMD/htmd/htmd/metricdata.py in rel2sim(self, relFrames, simlist)
    432                 raise AttributeError('Provided simlist has different number of trajectories than the one used by this object.')
    433 
--> 434         relFrames = np.array(relFrames)
    435         if relFrames.ndim == 1:
    436             relFrames = relFrames[np.newaxis, :]

ValueError: setting an array element with a sequence.
j3mdamas commented 7 years ago

Can you pull the latest HEAD and see if it's solved? If not, can you share with me a working failing example so I can do some testing? Thanks, João

GerardBCN commented 7 years ago

Seems that latest HEAD fixes it. Thank you!

j3mdamas commented 7 years ago

Yay, I was capable of fixing a bug in Stefan's code! feeling proud @stefdoerr :stuck_out_tongue_winking_eye:

Fixed on: ebce4a093f56f2dbc8f30c29f04cf66b78ae9ee8

GerardBCN commented 7 years ago

Kudos! You can now retire... ;)

stefdoerr commented 7 years ago

Ah yes :P Forgot it when I "cleaned up". Thanks Joao

On Fri, Dec 9, 2016 at 5:22 PM, GerardBCN notifications@github.com wrote:

Kudos! You can now retire... ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Acellera/htmd/issues/201#issuecomment-266055069, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkVgnl7Kv1hHsbbEKseoLSBXfp8FXWLks5rGYAqgaJpZM4LGfAq .