8000 Event functions are deprecated in Matplotlib 3.6 · Issue #11062 · mne-tools/mne-python · GitHub
[go: up one dir, main page]

Skip to content
Event functions are deprecated in Matplotlib 3.6 #11062
< 8355 /div>
@QuLogic

Description

@QuLogic

Describe the bug

Matplotlib 3.6 deprecated the event functions on the canvas. This causes some number of tests that use fake events to fail.

Steps to reproduce

  1. Install mne dependencies
  2. Update matplotlib to 3.6.0rc1
  3. Run pytest

Expected results

Tests pass.

Actual results

See build log against Matplotlib 3.6

______________________ test_plot_epochs_basic[matplotlib] ______________________
mne/viz/tests/test_epochs.py:62: in test_plot_epochs_basic
    fig._fake_keypress('escape')
mne/viz/_mpl_figure.py:1964: in _fake_keypress
    fig.canvas.key_press_event(key)
/usr/lib64/python3.11/site-packages/matplotlib/_api/deprecation.py:199: in wrapper
    emit_warning()
/usr/lib64/python3.11/site-packages/matplotlib/_api/deprecation.py:193: in emit_warning
    warn_deprecated(
/usr/lib64/python3.11/site-packages/matplotlib/_api/deprecation.py:96: in warn_deprecated
    warn_external(warning, category=MatplotlibDeprecationWarning)
/usr/lib64/python3.11/site-packages/matplotlib/_api/__init__.py:363: in warn_external
    warnings.warn(message, category, stacklevel)
E   matplotlib._api.deprecation.MatplotlibDeprecationWarning: The key_press_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('key_press_event', KeyEvent(...)) instead.

and similar for button_press_event, resize_event

Additional information

Sorry, don't have this in a non-interactive package build, but you can check the top of the above-linked file for installed dependencies.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0