I assume the proposal wouldn't mean that we'd ship a browser with sagemath?
I can see how "Playwright" is an attractive option [...] While currently it is probably well-supported, I could see how longer term this is going to be a rather fragile solution, because we'd be dependent on an interface to communicate with a browser.
As far as I remember from the discussion in https://github.com/sagemath/sage/issues/33513, saving 3d graphics to png files is already possible from the menu "Save as PNG".
For inclusion of 3d graphics as png files to our pdf documentation, one may do it manually by including the png files into the documentation.
If taking screenshots from 3d graphics automatically for pdf documentation is the only reason to consider playwright,
There are tons of png files in the "3d Graphics" section of the documentation:It would be quite a burden to maintain this manually.
The drawback of Jmol-generated png files is that they do not exactly correspond to what the user gets on his/her screen in a Jupyter notebook with the default viewer (threejs).
As a distro package, tachyon is mildly annoying, but all that it really
needs is a sane build system. The existing one is a case study in what
happens when you try to recreate autotools in undocumented Makefile
fragments. Ultimately it's not a complicated program to build.
[...] If we spent a day collectively writing configure.ac and Makefile.am, it
seems to me that we could solve all of the problems shared by Sage,
Debian, Arch, Gentoo, etc.
As an alternative to (automatically) opening a web browser,
perhaps one could automate (three.js) exporting to glTF and a small renderer (raylib?) generating the image.
If taking screenshots from 3d graphics automatically for pdf documentation is the only reason to consider playwright [...]
[...]
As a distro package, tachyon is mildly annoying, but all that it really
needs is a sane build system. The existing one is a case study in what
happens when you try to recreate autotools in undocumented Makefile
fragments. Ultimately it's not a complicated program to build.
The author doesn't have a bug tracking / PR system in place or an
obvious way to accept contributions. Has anyone tried contacting him?
If we spent a day collectively writing configure.ac and Makefile.am, it
seems to me that we could solve all of the problems shared by Sage,
Debian, Arch, Gentoo, etc.
I'll note that playwright can also used by Jupyter to export notebooks in PDF format. (For details, see ticket description of https://github.com/sagemath/sage/pull/38509)
On Tuesday, August 20, 2024 at 7:07:54 PM UTC+9 Eric Gourgoulhon wrote:There are tons of png files in the "3d Graphics" section of the documentation:It would be quite a burden to maintain this manually.Meanwhile I looked into the responsible code and studied how Jmol/Tachyon is used in rendering images from 3d graphics via sphinx_plot() via ".. PLOT::"As generating these images is already automated, I would not advocate for switching to a manual way. Moreover, I now see that the automated way helps in keeping the documentation source small (while compiling the documentation takes longer).I just want to note that maintaining png files is no burden once added (either manually or in bulk using playwright) as the documentation rarely changes.
... maybe we should consider distributing all of the documentation pre-built as a tarball, not just some png files. (I have resisted this in the past, but I am changing my mind.) Packages that are necessary to build the documentation could be "optional," or there could be a new type for them. The standard "make" would use the pre-built tarball, while another "make" target could build the documentation from scratch. This could make the build process faster with fewer associated standard packages.
I just built Sage on an OS X machine with a bunch of homebrew packages installed. It took under 20 minutes to build everything except the documentation, while the file sagemath_doc_html-none.time says real 24m20.264s [...] with "SAGE_DOCBUILD_OPTS=' --no-plot'". If the documentation is taking longer than everything else combined, maybe we should consider distributing all of the documentation pre-built as a tarball [...]
Packages that are necessary to build the documentation could be "optional," or there could be a new type for them.
The standard "make" would use the pre-built tarball, while another "make" target could build the documentation from scratch. This could make the build process faster with fewer associated standard packages.
it is not a bad idea for a non-developer user to install sage from source.
On Tuesday, August 20, 2024 at 8:22:35 PM UTC-5 Kwankyu Lee wrote:it is not a bad idea for a non-developer user to install sage from source.I disagree. It is a bad idea, for so many reasons:* It requires a lot of time and work which is completely unrelated to using Sage.* It will almost certainly fail.* Even if it does succeed, it provides no benefit to a user who only wants to use Sage. But it does have lots of negative side effects, including creating a 10GB subdirectory of the user's home which becomes totally useless if it is moved, and forcing the installation of many packages and, possibly, package managers, which are useless to someone who is not interested in writing code.
Using cython within Sage via the %%cython magic command definitely does not require building Sage from source. That magic command works fine in the Sage_macOS binary distribution of SageMath. The cython pip package is included in that binary distribution, because it gets built and installed as part of the Sage build. Yes, you do need to have a C toolchain installed on your mac. But that requires nothing more than opening the Terminal app and typing "xcode-select --install". That works on a pristine macOS system with no third party packages installed.
what if you have a version mismatch between the toolchain used to build the shipped binary,
and XCode you installed locally? I'd expect trouble, in particular with C++.
it's only if you are on a bad platform to begin with.
I think the clash is much more basic than that.It is developers versus users. Users who hoped to do (some) mathematics with a computer.So far, it seems to me most discussions are developer-centric, Marc being among the exceptions giving another POV.
On Tuesday, August 20, 2024 at 5:42:42 PM UTC-7 John H Palmieri wrote:I just built Sage on an OS X machine with a bunch of homebrew packages installed. It took under 20 minutes to build everything except the documentation, while the file sagemath_doc_html-none.time says real 24m20.264s [...] with "SAGE_DOCBUILD_OPTS=' --no-plot'". If the documentation is taking longer than everything else combined, maybe we should consider distributing all of the documentation pre-built as a tarball [...]This should be possible with https://github.com/sagemath/sage/pull/36730
jupyter-jsmol is the current standard package providing javascript version of Jmol (which I proposed to demote to optional in https://groups.google.com/g/sage-devel/c/qKqTmLzHAbg, https://github.com/sagemath/sage/pull/38504). I propose to demote it to "optional". (In https://groups.google.com/g/sage-devel/c/qKqTmLzHAbg/m/OwGjF4GiBQAJ (2020), Antonio Rojas already asked if there is any reason for not making jsmol optional too because three.js is our default 3d renderer.)tachyon is a standard package providing a raytracer, dating back to 1994. It has a precarious maintenance status. Fedora has orphaned this package, and it is not available in the current release 40 (https://src.fedoraproject.org/rpms/tachyon), Debian has an extensive set of patches that have not been upstreamed (https://sources.debian.org/patches/tachyon/0.99~b6+dsx-12/). The Arch Linux package (https://archlinux.org/packages/extra/x86_64/tachyon/) is maintained by Antonio Rojas; sage is listed as the only package depending on it. I propose to demote this package to optional as well.Jmol (not jupyter-jsmol) and Tachyon serve the purpose of saving 3d graphics as png files, in particular for our PDF documentation.I propose to replace this function (exclusively provided by these two packages in Sage) by using the tool Playwright, which installs a browser such as Chromium and screenshots an arbitrary webpage as a PNG file. By using it on a three.js rendering of 3d graphics, we can thus save the 3d graphics as a PNG file. This is PR https://github.com/sagemath/sage/pull/38509 (needs review). This is much heavier-weight technology than tachyon, but it has excellent mainstream maintenance status.