Skip to content

Conversation

@lucasb-eyer
Copy link

It is impossible for exported plot to ever call the python function, so we need to decide what to do when the user uses a FuncFormatter.

I decide that it's most meaningful to convert it to "fixed" ticks at export-time, which is what this code does. However, it still keeps the type as "func" so the consumer of export may choose what to do.

mpld3 just treats "func" and "fixed" identically. We could argue about changing to "fixed" here at export-time; I think keeping "func" conveys more information, but I don't feel strongly about it.

The current state for FuncFormatter is that it does convert the labels at export-time only if locator is fixed. I argue this is strictly worse.

At the same time, I also made the unit-test assert util print much more human interpretable test failure outputs, see comment.

PS: I used gpt5-codex-high to help me locate and understand the issue, but I implemented the fix myself.

It is impossible for exported plot to ever call the python function, so
we need to decide what to do when the user uses a FuncFormatter.

I decide that it's most meaningful to convert it to "fixed" ticks at
export-time, which is what this code does. However, it still keeps the
type as "func" so the consumer of export may choose what to do.

mpld3 just treats "func" and "fixed" identically. We could argue about
changing to "fixed" here at export-time; I think keeping "func" conveys
more information, but I don't feel strongly about it.

The current state for FuncFormatter is that it does convert the labels
at export-time only if locator is fixed. I argue this is strictly worse.

At the same time, I also made the unit-test assert util print much more
human interpretable test failure outputs, see comment.
@lucasb-eyer
Copy link
Author

ping

@vladh
Copy link
Member

vladh commented Nov 21, 2025

Have been sick, but will take a look at this ASAP!

@lucasb-eyer
Copy link
Author

oh no rush sorry, get well first!

@vladh
Copy link
Member

vladh commented Nov 28, 2025

Should be able to get to this next week, thanks for waiting! 🙏🏻

@lucasb-eyer
Copy link
Author

no rush, I only pinged to avoid it getting forgotten, not to pressure!

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