Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

Render examples using Sphinx-gallery #1621

Closed speth closed 9 months ago

speth commented 9 months ago

Changes proposed in this pull request

Notes:

If applicable, fill in the issue number this pull request is fixing

If applicable, provide an example illustrating new features this pull request is introducing

The page for a Python example:

Screenshot 2023-09-23 at 5 04 55 PM

Part of an index page:

Screenshot 2023-09-23 at 5 20 57 PM

Checklist

codecov[bot] commented 9 months ago

Codecov Report

Merging #1621 (56487cd) into main (329952d) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1621      +/-   ##
==========================================
- Coverage   72.72%   72.71%   -0.01%     
==========================================
  Files         370      370              
  Lines       56287    56286       -1     
  Branches    20369    20369              
==========================================
- Hits        40932    40931       -1     
  Misses      12358    12358              
  Partials     2997     2997              
Files Coverage Δ
interfaces/cython/cantera/_cantera.pyx 100.00% <100.00%> (ø)
samples/clib/demo.c 77.77% <ø> (ø)
samples/cxx/bvp/BoundaryValueProblem.h 86.56% <ø> (ø)
samples/cxx/bvp/blasius.cpp 87.50% <ø> (ø)
samples/cxx/flamespeed/flamespeed.cpp 83.89% <ø> (ø)
samples/cxx/openmp_ignition/openmp_ignition.cpp 82.85% <ø> (ø)
samples/cxx/rankine/rankine.cpp 91.83% <ø> (ø)
samples/f77/demo_ftnlib.cpp 53.84% <ø> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

speth commented 9 months ago

It may make sense to wait what happens with the contribution to the upstream library?

Yes, we can wait to merge this in case there are any API changes requested upstream. I don't think I want to wait for the next release of sphinx-gallery, though. I may start building another PR on top of this one with more documentation updates.

speth commented 9 months ago

The "download all" buttons and corresponding zip files are something I still need to fix upstream.

For the individual examples, the name is the one used by Pygments (first column here), which uses "Fortran" for F90-style "free format" and "FortranFixed" for the older fixed-width format. I think it's a pretty minor wart.

bryanwweber commented 9 months ago

Thanks for doing this Ray! I'm happy we'll be able to link to API docs from the examples, and that you've got all the examples building. Once this goes in, I'll rework the ongoing sphinx migration to use this instead of my bespoke solution.

ischoegl commented 9 months ago

The "download all" buttons and corresponding zip files are something I still need to fix upstream.

Thanks for the upstream fix - I retriggered GH actions, and things are taken care of :tada:

For the individual examples, the name is the one used by Pygments (first column here), which uses "Fortran" for F90-style "free format" and "FortranFixed" for the older fixed-width format. I think it's a pretty minor wart.

Thanks for the explanation. It indeed is a minor wart.

ischoegl commented 9 months ago

🥳 ... sphinx-gallery PR is merged.