Skip to content

Cache documentation build - #2553

Closed
namurphy wants to merge 7 commits into
PlasmaPy:mainfrom
namurphy:cache-sphinx-build-pr
Closed

namurphy wants to merge 7 commits into
PlasmaPy:mainfrom
namurphy:cache-sphinx-build-pr

Conversation

@namurphy

@namurphy namurphy commented Mar 2, 2024 •

Copy link
Copy Markdown
Member

Closes #2258. At least, assuming I can get it to work!

The way it is set up now, I don't think the artifacts in docs/_build are being used when regenerating the documentation. I think the speedup is just from caching .tox.

@github-actions github-actions Bot added CI Related to continuous integration GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) labels Mar 2, 2024
@namurphy

namurphy commented Mar 2, 2024

Copy link
Copy Markdown
Member Author

Without caching, the doc build with CI takes 5:51.

  • 5:21 on "Build docs" step
    build_docs_pins: OK (321.29=setup[95.52]+cmd[225.76] seconds)
    congratulations :) (321.38 seconds)
    

@namurphy

namurphy commented Mar 2, 2024

Copy link
Copy Markdown
Member Author

These were the warnings that popped up when building the docs from the cache:

/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.analysis.time_series.conditional_averaging.ConditionalEvents.rst: WARNING: Could not match transformation of `ConditionalEvents` on source lines 1-3, source:
>>> from plasmapy.analysis.time_series.conditional_averaging import (
...     ConditionalEvents,
... )
>>> cond_events = ConditionalEvents(
...     signal=[1, 2, 1, 1, 2, 1],
...     time=[1, 2, 3, 4, 5, 6],
...     lower_threshold=1.5,
... )
>>> cond_events.time
array([-1.0, 0.0, 1.0])
>>> cond_events.average
array([1., 2., 1.])
>>> cond_events.variance
array([1., 1., 1.])
>>> cond_events.peaks
array([2, 2])
>>> cond_events.waiting_times
array([3])
>>> cond_events.arrival_times
array([2, 5])
>>> cond_events.number_of_events
2
/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.formulary.braginskii.ClassicalTransport.rst: WARNING: Could not match a code example to HTML, source:
>>> import astropy.units as u
>>> t = ClassicalTransport(1 * u.eV, 1e20 / u.m**3, 1 * u.eV, 1e20 / u.m**3, "p")
>>> t.resistivity  # doctest: +SKIP
<Quantity 0.0003670... Ohm m>
>>> t.thermoelectric_conductivity
<Quantity 0.71108...>
>>> t.ion_thermal_conductivity
<Quantity 0.01552... W / (K m)>
>>> t.electron_thermal_conductivity
<Quantity 0.38064... W / (K m)>
>>> t.ion_viscosity
<Quantity [4.621297...e-07, 4.607248...e-07, 4.607248...e-07, 0.000000...e+00,
           0.000000...e+00] Pa s>
>>> t.electron_viscosity
<Quantity [5.822738...e-09, 5.820820...e-09, 5.820820...e-09, 0.000000...e+00,
           0.000000...e+00] Pa s>
/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.formulary.collisions.misc.Spitzer_resistivity.rst: WARNING: Could not match a code example to HTML, source:
>>> import astropy.units as u
>>> n = 1e19 * u.m**-3
>>> T = 1e6 * u.K
>>> species = ("e", "p")
>>> Spitzer_resistivity(T, n, species)  # doctest: +SKIP
<Quantity 2.4915...e-06 Ohm m>
>>> Spitzer_resistivity(T, n, species, V=1e6 * u.m / u.s)  # doctest: +SKIP
<Quantity 0.000324... Ohm m>
/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.formulary.collisions.misc.mobility.rst: WARNING: Could not match a code example to HTML, source:
>>> import astropy.units as u
>>> n = 1e19 * u.m**-3
>>> T = 1e6 * u.K
>>> species = ("e", "p")
>>> mobility(T, n, species)  # doctest: +SKIP
<Quantity 250505... m2 / (V s)>
>>> mobility(T, n, species, V=1e6 * u.m / u.s)  # doctest: +SKIP
<Quantity 1921.2784... m2 / (V s)>
/home/runner/work/PlasmaPy/PlasmaPy/docs/api/plasmapy.utils.decorators.lite_func.bind_lite_func.rst: WARNING: Could not match a code example to HTML, source:
>>> foo(5)  # doctest: +SKIP
5
>>> foo.lite(5)  # doctest: +SKIP
5
>>> foo.bar()  # doctest: +SKIP

@github-actions github-actions Bot added the requirements Related to updating requirements label Mar 2, 2024
@github-actions github-actions Bot added docs PlasmaPy Docs at http://docs.plasmapy.org contributor guide labels Mar 2, 2024
@namurphy

Copy link
Copy Markdown
Member Author

Closing this since I've found that caching the doc build hasn't effectively sped things up when building the docs locally.

Also the problems with rebuilds were associated with using sphinx-codeautolink.

@namurphy namurphy closed this Mar 11, 2024
@namurphy
namurphy deleted the cache-sphinx-build-pr branch March 11, 2024 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to continuous integration contributor guide docs PlasmaPy Docs at http://docs.plasmapy.org GitHub Actions A continuous integration platform for automating tests and other tasks (see .github/ directory) requirements Related to updating requirements testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up documentation builds done via GitHub Actions in CI by caching previous build

1 participant