-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Open
Description
Summary
Inspired by #31392 (review)
Should we constrain the public API?
In particular, I don't think
set_locsis needed publically. Callingformat_ticks(values)should be sufficent and it should be possible to make thelocsstate an implementation detail.Additionally, one could check / clarify the relation of
__call__andformat_data. Are both needed publically?
Also #5804 may be considered.
Proposed fix
This is a tracking item for the idea. It's not yet ready to be worked on, because we first need a deeper analysis on the current usage and a discussion on the desired API.
Possible improvements:
- Distinguish between configuration (e.g. base for LogFormatter) and context. Context is information extracted from a set of tick values that may influence how single ticks are rendered (e.g. precision or offset). The context is currently partly public. As a first step, we can make the context private (MNT: Privatize Formatter attributes #31416). This will open up possibilities for re-architecting internal logic: Currently context is stored as persistent state on the Formatter, but we may be able to remove this state (will also require making
set_locs()private. - ...
Reactions are currently unavailable