Skip to content

MNT: Privatize Formatter attributes#31416

Draft
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm:mnt-deprecate-formatter-attrs
Draft

MNT: Privatize Formatter attributes#31416
timhoffm wants to merge 1 commit intomatplotlib:mainfrom
timhoffm:mnt-deprecate-formatter-attrs

Conversation

@timhoffm
Copy link
Copy Markdown
Member

These attributes are internal state and users should not access them:

ScalarFormatter.orderOfMagnitude
ScalarFormatter.format
ConciseDateFormatter.offset_format
Formatter.locs

Making them private will allow rearchitecting the handling of tick context (i.e. information extracted from a group of ticks, that may influence their formatting) in the future.

This works towards #31396.

@timhoffm timhoffm force-pushed the mnt-deprecate-formatter-attrs branch from 7059dc8 to 310092b Compare March 28, 2026 07:18
Copy link
Copy Markdown
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many internal uses are still not fixed and breaking tests/docs, so I'll mark this as draft.

'%Y-%b-%d',
'%Y-%b-%d %H:%M']
self.offset_string = ''
self._offset_string = ''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still all the internal users of this that aren't converted and will raise a warning.

@QuLogic QuLogic marked this pull request as draft March 30, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants