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

From: Shiji Zhao <shijiz.uci.edu>
Date: Thu, 1 Jul 2021 21:26:57 -0700

Hi Dr. Swails,

The suggestion of changing show() to draw() is due to the following error
while I click the "Graph Them!" button:

Exception in Tkinter callback
Traceback (most recent call last):
  File
"/Users/shijizhao/Downloads/amber-bin/miniconda/lib/python3.8/tkinter/__init__.py",
line 1883, in __call__
    return self.func(*args)
  File
"/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/widgets.py",
line 100, in new_fcn
    return fcn(self)
  File
"/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/widgets.py",
line 72, in new_fcn
    if fcn(self, newfig, ax, self.graph_props.nexcl()) == 1:
  File
"/Users/shijizhao/Downloads/amber-bin/lib/python3.8/site-packages/mdoutanalyzer/widgets.py",
line 226, in execute
    fig.show()
AttributeError: 'FigureCanvasTkAgg' object has no attribute 'show'

I didn't show this error in previous emails since another error is more
tricky. The python (version 3.8.5) I am using is the latest one in Amber
repo. Not sure if this error only occurs to me.

I really appreciate your effort on developing this tool and I believe it
deserves more attention :)

Best regards,
Shiji Zhao

On Thu, Jul 1, 2021 at 6:50 PM Jason Swails <jason.swails.gmail.com> wrote:

> On Thu, Jul 1, 2021 at 12:10 AM Shiji Zhao <shijiz.uci.edu> wrote:
>
> > Dear Amber developers,
> >
> > I thought the original email failed to be sent to the maillist. Did you
> all
> > receive the same content three times? That's a little awkward...
> >
> > Dr. Case and Dr. Swails, sorry that I copied the original line 73 of
> > mdoutanalyzer/mdout.py to the previous email.What I mean is change it to:
> >
> > self.num_terms = int(self.num_steps / self.properties['ntpr']) + 1
> >
> > The reason is that the result of self.num_steps / self.properties['ntpr']
> > may
> > not be an integer, so that self.num_terms will be saved as a floating
> > number. Consequently, a TypeError will be thrown when a float number is
> > used to indicate the size of a numpy array.
> >
>
> Yes, this makes sense. This is actually one of those Python 2 -> 3 issues
> where num_steps and ntpr were integers, so this would default to integer
> division in Python 2. But my total number of steps was always set to a
> multiple of ntpr so it also makes sense that I'd never see this issue.
>
> >
> > Regarding the questions of Dr. Swail, I actually use it after every MD
> run
> > to check energy etc.
>
>
> Woah! An actual user! Maybe we'll even hook Gustavo and Carlos ;). FWIW,
> cpptraj can also parse mdout files also.
>
> If enough people find it useful and the occasional bug is easy enough to
> squash there's probably not much harm in keeping it in.
>
> I'll commit your int-casting fix here (not sure about the draw() vs. show()
> change -- I'd be wary of changing that given that show() had always worked
> for me).
>
> 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 Thu Jul 01 2021 - 21:30:02 PDT
Custom Search