Re: [AMBER-Developers] Two fixes for mdout_analyzer.py

From: Shiji Zhao <shijiz.uci.edu>
Date: Wed, 30 Jun 2021 21:38:28 -0700

Hi Dr. Swails,

Sorry I mistakenly copied the original line 73 of mdout.py in the previous
email.

Please see another thread for the corrected version.

Thanks,
Shiji Zhao

On Wed, Jun 30, 2021 at 7:39 PM Jason Swails <jason.swails.gmail.com> wrote:

> On Wed, Jun 30, 2021 at 6:05 PM Shiji Zhao <shijiz.uci.edu> wrote:
>
> > Hi all,
> >
> > I encountered this error while using mdout_analyzer.py recently:
> >
> >
> > Traceback (most recent call last):
> > File "/Users/shijizhao/Downloads/amber-bin/bin/mdout_analyzer.py", line
> > 59, in <module>
> > mdout += MdoutClass(f)
> > NameError: name 'mdout' is not defined
> >
> > During handling of the above exception, another exception occurred:
> >
> > Traceback (most recent call last):
> > File
> >
> >
> "/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/mdout.py",
> > line 221, in get_data
> > self.data[term].add_value(float(term_val))
> > KeyError: 'NSTEP'
> >
> > During handling of the above exception, another exception occurred:
> >
> > Traceback (most recent call last):
> > File "/Users/shijizhao/Downloads/amber-bin/bin/mdout_analyzer.py", line
> > 61, in <module>
> > mdout = MdoutClass(f)
> > File
> >
> >
> "/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/mdout.py",
> > line 87, in __init__
> > self.get_data()
> > File
> >
> >
> "/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/mdout.py",
> > line 223, in get_data
> > self.data[term] = np.zeros(self.num_terms).view(DataSet)
> > TypeError: 'float' object cannot be interpreted as an integer
> >
> >
> > This error never occurred while I was using Amber18, so I guess it may
> have
> > something to do with the latest python version. After briefly analyzing
> the
> > source code of mdout_analyzer.py, I hereby propose 2 changes that fix
> > mdout_analyzer.py.
> >
> >
> > - Change line 73 of mdoutanalyzer/mdout.py to:
> > self.num_terms = self.num_steps / self.properties['ntpr'] + 1
> >
> > - Change line 226 of mdoutanalyzer/widgets.py to:
> > fig.draw()
> >
>
> Just based on the exceptions I don't see how either of these changes would
> resolve those issues? (Also, as Dave mentioned, mdout.py line 73 already
> looks like that as far as I can tell.)
>
> Thanks,
> Jason
>
> --
> Jason M. Swails
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Wed Jun 30 2021 - 22:00:02 PDT
Custom Search