Skip to content

Fix pyparsing deprecation flood without touching matplotlib - #748

Merged
smribet merged 1 commit into
py4dstem:devfrom
cophus:dev
Aug 1, 2026
Merged

Fix pyparsing deprecation flood without touching matplotlib#748
smribet merged 1 commit into
py4dstem:devfrom
cophus:dev

Conversation

@cophus

@cophus cophus commented Aug 1, 2026

Copy link
Copy Markdown
Member

Reverts the matplotlib >= 3.11 requirement: hosted notebook runtimes
(Colab) preimport matplotlib at kernel start, so a mid-session pip
upgrade leaves a broken half-old, half-new install (new
mpl_toolkits.axes_grid1 loaded lazily against the old in-memory
matplotlib._api).

Instead, rebind pyparsing's deprecated camelCase compatibility aliases
(parseString / resetCache, including the parseAll argument) to call the
snake_case API directly with the renamed arguments. matplotlib < 3.11
mathtext calls those aliases once per rendered math label, which floods
plotting output under pyparsing >= 3.3; with the rebind the deprecated
code paths are never executed, in any session, with no install changes.
Verified the rebound aliases give identical parse results and
exceptions, emit no warnings, and are skipped on matplotlib >= 3.11.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

Reverts the matplotlib >= 3.11 requirement: hosted notebook runtimes
(Colab) preimport matplotlib at kernel start, so a mid-session pip
upgrade leaves a broken half-old, half-new install (new
mpl_toolkits.axes_grid1 loaded lazily against the old in-memory
matplotlib._api).

Instead, rebind pyparsing's deprecated camelCase compatibility aliases
(parseString / resetCache, including the parseAll argument) to call the
snake_case API directly with the renamed arguments. matplotlib < 3.11
mathtext calls those aliases once per rendered math label, which floods
plotting output under pyparsing >= 3.3; with the rebind the deprecated
code paths are never executed, in any session, with no install changes.
Verified the rebound aliases give identical parse results and
exceptions, emit no warnings, and are skipped on matplotlib >= 3.11.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@smribet
smribet merged commit 68746cd into py4dstem:dev Aug 1, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants