Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sbhakat opened this issue Oct 31, 2022 · 5 comments
Open

Comments

@sbhakat
Copy link

sbhakat commented Oct 31, 2022

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?

@marscher
Copy link
Member

marscher commented Nov 1, 2022

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

@gph82
Copy link
Collaborator

gph82 commented Nov 1, 2022 via email

@clonker
Copy link
Member

clonker commented Nov 1, 2022

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

@gph82
Copy link
Collaborator

gph82 commented Nov 1, 2022 via email

@sbhakat
Copy link
Author

sbhakat commented Nov 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants