-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC/BLD: plot directive srcset #25515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
So this builds, with a couple of weird errors that I'll track down. Discussion point:The relatively large change this does is that image files had a funny naming convention using Consider
Here, we had to implement the file copying ourselves, so I chose to do it:
So, this is a breaking change. OTOH I think this is a lot better than putting 1000s of images in a flat directory, all with almost the same names. Not sure what our policy is for breaking changes on the plot directive... |
3bc53a6
to
bfc7dca
Compare
To be clear nothing is changing on the user input side (unless they want to use the new feature) but what is changing in the location of the output files. If the user is letting us / sphinx do everything then they will not notice. If they have hard-coded direct urls to these output files then things might break. However, if I am understanding the previous behavior correctly the name depended on the order in which the files were processed and the number of I am 👍 on making this change (with a note). I am however a bit confused why we need a new |
We don't provide One concern I haven't been brave enough to test yet is that nesting the image files won't work for singlehtml. I don't know who uses that, or why it exists. Another naming convention could be |
I just realized that I think we can keep the old behaviour with minimal complexity by just using a different TEMPLATE if the downstream user isn't using eg The question remains if it should be |
https://output.circle-artifacts.com/output/job/5e6a201b-625c-43f6-b99a-be0272981d5a/artifacts/0/doc/build/html/users/explain/axes/index.html the image links to
|
56c6e07
to
718236e
Compare
I'll agitate for this a bit - it has no downstream user-facing changes unless the user decides to use the srcset option; it also has no internal changes unless that option is specified. So I think this is pretty low risk to put in, for a pretty helpful benefit to making the docs look a lot better. |
f64f5a9
to
ba1f41b
Compare
fd5c9fe
to
8f3d57a
Compare
8f3d57a
to
0abe744
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for your help @QuLogic ! |
Appveyor test failure does appear to be the newly added test. I'm mildly suspicious of the It appears to work on the Azure windows builds (unless it is skipped somehow, but I didn't see it in the list of skipped tests), so not really sure Appveyor log
|
Windows accepts either path separator; this failure indicates either the image isn't created (yet?), is named differently, or the working directory (since this is a relative path) is not the expected one. That being said, we probably don't need to use |
Huh, I've never ever looked at appveyor - sorry I assumed the error was spurious. Sadly I don't have a windows machine to test on. Happy to make any changes suggested by others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got this to work locally on Windows by replacing all of the PurePosixPath
occurrences with PurePath
and the fix below for the directory separation replacement. Hope this helps!
d3683dc
to
56704c6
Compare
The failure on appveyor is real, but I don't have any rational way to debug it :-( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor tweaks, and should fix the tests on Windows.
Some interactive backend tests are failing, which I don't think have to do with this PR... |
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
b1cf88f
to
a4498c0
Compare
I think #25988 is tracking those test failures. |
PR Summary
Closes #25497
The
.. plot::
directive currently makes 100 dpi figures, which don't look good on hiDPI screens.This PR uses a new sphinx directive "figmpl" in the plot-directive to add a
srcset=
entry to the image tag to allow high resolution images (2x in this case).Old
New