Skip to content

minor doc cleanup; parallelize tests#594

Merged
sbailey merged 7 commits intomainfrom
docs
Mar 13, 2026
Merged

minor doc cleanup; parallelize tests#594
sbailey merged 7 commits intomainfrom
docs

Conversation

@sbailey
Copy link
Contributor

@sbailey sbailey commented Mar 12, 2026

This PR started out as a minor cleanup for building docs in prep for a new tag, but morphed into also adding parallelism safety for tests (run with pytest-xdist via pytest -n 8).

Copilot AI review requested due to automatic review settings March 12, 2026 23:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves documentation build reliability and makes several unit tests safe to run in parallel (e.g., under pytest -n 8) by isolating filesystem output and environment variables per test.

Changes:

  • Refactor multiple tests to use per-test (or per-class) temporary directories and restore environment variables in teardown.
  • Fix/cleanup minor doc-build issues (Sphinx Makefile default, additional mocked imports, and an invalid-escape warning in a Matplotlib label).
  • Expand CI docs job to also run make html in addition to a direct sphinx-build invocation.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
py/desisim/test/test_quickgen.py Move test I/O + env setup to per-test temp dirs for parallel safety.
py/desisim/test/test_quickcat.py Write generated FITS files into an isolated temp directory and cleanup via TemporaryDirectory.
py/desisim/test/test_pixsim.py Isolate env + output paths per test using TemporaryDirectory.
py/desisim/test/test_obs.py Isolate env + output paths per test using TemporaryDirectory.
py/desisim/test/test_io.py Create per-test temp dir + unique output filename; restore env in teardown.
py/desisim/test/test_batch.py Generate batch script in a per-test temp dir; restore env reliably.
py/desisim/spec_qa/redshifts.py Use a raw string for a Matplotlib label to avoid invalid escape sequence warnings.
py/desisim/qso_template/desi_qso_templ.py Remove unused imp import.
doc/conf.py Mock additional desitarget submodules during autodoc to avoid doc-build import failures.
doc/changes.rst Update changelog entries/links for unreleased version notes.
doc/Makefile Default SPHINXBUILD to sphinx-build (more portable default).
.github/workflows/python-package.yml Add CI step to verify make html doc build path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@coveralls
Copy link

coveralls commented Mar 12, 2026

Coverage Status

coverage: 44.352% (+0.004%) from 44.348%
when pulling 585dc4d on docs
into b97e17d on main.

@sbailey sbailey requested a review from weaverba137 March 13, 2026 03:05
Copy link
Member

@weaverba137 weaverba137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a few questions that may lead to minor changes, but overall looks good.

@weaverba137
Copy link
Member

One more question: do we know how many cores are available when running GitHub Actions?

@sbailey
Copy link
Contributor Author

sbailey commented Mar 13, 2026

One more question: do we know how many cores are available when running GitHub Actions?

I have not found any specific mention of multiple cores available to GitHub actions; their primary parallelism appears to be splitting the various jobs to e.g. test different versions of python in parallel. Regardless, adding test parallelism safety makes testing locally much much faster even if GitHub remains single-core per pytest invocation. FWIW I've included pytest-xdist in the draft next release of the desi software environment at NERSC (currently "test-main2").

@sbailey sbailey requested a review from weaverba137 March 13, 2026 17:31
Copy link
Member

@weaverba137 weaverba137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready to go. Thanks for the changes.

@sbailey sbailey merged commit fc9d2ea into main Mar 13, 2026
13 of 15 checks passed
@sbailey sbailey deleted the docs branch March 13, 2026 18:01
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.

4 participants