Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).
https://gromacswrapper.readthedocs.org
GNU General Public License v3.0
169 stars 53 forks source link

'Logger' object is not callable #173

Closed keisuke-yanagisawa closed 5 years ago

keisuke-yanagisawa commented 5 years ago

Now I'm trying to use it via jupyter-lab (Python 3.7.1), however, it does not work thus far.

import gromacs
itp = gromacs.fileformats.TOP("test.top")

A TypeError happens:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-eb4adf3f7a54> in <module>
----> 1 itp = gromacs.fileformats.TOP("test.top")

~/.local/pyenv/versions/anaconda3-2018.12/envs/md_analysis/lib/python3.7/site-packages/GromacsWrapper-0.7.0-py3.7.egg/gromacs/fileformats/top.py in __init__(self, fname)
     94 
     95         self.molecules = []
---> 96         self._parse(fname)
     97         self.molecules = tuple(self.molecules)
     98 

~/.local/pyenv/versions/anaconda3-2018.12/envs/md_analysis/lib/python3.7/site-packages/GromacsWrapper-0.7.0-py3.7.egg/gromacs/fileformats/top.py in _parse(self, fname)
    250                     assert particletype in ('A', 'S', 'V', 'D')
    251                     if particletype not in ('A',):
--> 252                         self.logger('warning: non-atom particletype: "{0:s}"'.format(line))
    253 
    254                     sig = float(fields[5+shift])

TypeError: 'Logger' object is not callable

Do I have to set specific log file name before beginning?

keisuke-yanagisawa commented 5 years ago

My top file has virtual interaction sites thus it is possible a bug overlooked.

keisuke-yanagisawa commented 5 years ago

Thank you for fixing the issue!