molPX icon indicating copy to clipboard operation
molPX copied to clipboard

AttributeError: 'Canvas' object has no attribute 'set_window_title'

Open sbhakat opened this issue 3 years ago • 5 comments

I am trying to execute the following part in BPTI TICA example

mpx_wdg_box = molpx.visualize.FES(MD_list,
                                 #MD_trajfiles,
                                 top,
                                 Y_filenames,
                                 #Y,
                                 nbins=50,
                                 #proj_idxs=[1,2],
                                 proj_labels='TIC',
                                 #n_overlays=5,
                                )
mpx_wdg_box

However I am getting the following error

AttributeError                            Traceback (most recent call last)
Cell In [4], line 1
----> 1 mpx_wdg_box = molpx.visualize.FES(MD_list,
      2                                  #MD_trajfiles,
      3                                  top,
      4                                  Y_filenames,
      5                                  #Y,
      6                                  nbins=50,
      7                                  #proj_idxs=[1,2],
      8                                  proj_labels='TIC',
      9                                  #n_overlays=5,
     10                                 )
     11 mpx_wdg_box

File ~/opt/anaconda3/envs/msmbuilder2022/lib/python3.9/site-packages/molpx/visualize.py:218, in FES(MD_trajectories, MD_top, projected_trajectories, proj_idxs, nbins, n_sample, proj_stride, weights, proj_labels, n_overlays, atom_selection, **sample_kwargs)
    216 ngl_wdg._set_size(*['%fin' % inches for inches in ax.get_figure().get_size_inches()])
    217 ax.figure.tight_layout()
--> 218 axes_wdg.canvas.set_window_title("FES")
    219 outbox = _linkutils.MolPXHBox([ngl_wdg, axes_wdg.canvas])
    220 _linkutils.auto_append_these_mpx_attrs(outbox, geoms, ax, _plt.gcf(), ngl_wdg, axes_wdg, data_sample)

AttributeError: 'Canvas' object has no attribute 'set_window_title'

Is it some version problem? Any help will be highly appreciated?

sbhakat avatar Oct 31 '22 17:10 sbhakat

It is likely that the current matplotlib/mpl packages are too modern or molpx is too outdated.

The set_window_title function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use manager.set_window_title or GUI-specific methods instead.

So it might seem, you would need to downgrade to matplotlib < 3.5

marscher avatar Nov 01 '22 15:11 marscher

I can take a look at this, perhaps is time for another release?

Sent from my Galaxy

-------- Original message -------- From: "Martin K. Scherer" @.> Date: 11/1/22 16:42 (GMT+01:00) To: markovmodel/molPX @.> Cc: Subscribed @.***> Subject: [ext] Re: [markovmodel/molPX] AttributeError: 'Canvas' object has no attribute 'set_window_title' (Issue #52)

It is likely that the current matplotlib/mpl packages are too modern or molpx is too outdated.

The set_window_title function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use manager.set_window_title or GUI-specific methods instead.

So it might seem, you would need to downgrade to matplotlib < 3.5

— Reply to this email directly, view it on GitHubhttps://github.com/markovmodel/molPX/issues/52#issuecomment-1298728621, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZLONCJHDVMMJR6YOSLFOLWGE26HANCNFSM6AAAAAARTI7H3M. You are receiving this because you are subscribed to this thread.Message ID: @.***>

gph82 avatar Nov 01 '22 15:11 gph82

Hey :) I think if you fixed it for modern mpl versions it's def time for another release! Also the conda-forge feedstock seems a bit dated. Happy to help as well

clonker avatar Nov 01 '22 15:11 clonker

Let's dooooooo this. Give me a some days, please

Sent from my Galaxy

-------- Original message -------- From: Moritz Hoffmann @.> Date: 11/1/22 16:57 (GMT+01:00) To: markovmodel/molPX @.> Cc: "Pérez Hernández, Guillermo" @.>, Comment @.> Subject: [ext] Re: [markovmodel/molPX] AttributeError: 'Canvas' object has no attribute 'set_window_title' (Issue #52)

Hey :) I think if you fixed it for modern mpl versions it's def time for another release! Also the conda-forge feedstock seems a bit dated. Happy to chime in

— Reply to this email directly, view it on GitHubhttps://github.com/markovmodel/molPX/issues/52#issuecomment-1298752470, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZLONHVAZRBWSW7MEDVAR3WGE4X3ANCNFSM6AAAAAARTI7H3M. You are receiving this because you commented.Message ID: @.***>

gph82 avatar Nov 01 '22 16:11 gph82

Thanks @gph82 . It definitely needs a new release. It will be great to have an .yml file which contains the information about software versions so that the users doesn't suffer from compatibility issues. Happy to help. Looking forward to a new release.

sbhakat avatar Nov 03 '22 16:11 sbhakat