Skip to content

Start testing for documentation building#217

Open
rprospero wants to merge 11 commits into
masterfrom
test_docs_on_ci
Open

Start testing for documentation building#217
rprospero wants to merge 11 commits into
masterfrom
test_docs_on_ci

Conversation

@rprospero

@rprospero rprospero commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The goal for this PR is to resolve #214 and both fix the warnings with the building of the docs and ensure via the CI that the warnings do not return.

The following changes are included in this PR:

  1. Hatch sphinx is configured to convert warnings into errors. As intended, this causes the CI to reject pull requests where the documentation produces warnings. The remaining changes involve fixing the existing warnings.
  2. Hatch now also uses scipy and matplotlib so sphinx can resolve references to those libraries
  3. absolute_temperature.py was removed, as it is part of the deprecated Accessor infrastructure and was not used anywhere.
  4. White space issues with the preformatted strings for the edit warnings in si.py and units.py
  5. Whitespace fixes for docstrings in metadata.py, manipulations.py, binning.py,
  6. Issues with the interplay between sphinx formatting and LaTeX formatting were handled in averaging.py and model_requirements.py. Specifically, sphinx use pipes for keyword substitution while LaTeX uses it for absolute value. Similarly, sphinx uses underscores for hyperlinking while LaTeX uses it for subscripts. I escaped the control characters for sphinx and they should be passed cleanly on to LaTeX, but this is the part of this PR that I'm the least happy with
  7. We make references to the File Converter, Image Viewer, and SANS Calculator in SasData, but those tools are part of SasView. Lines 36-46 of conf.py explicitly ignore error messages when these cannot be found.
  8. When a class contains a member named type, Sphinx seems to have trouble figuring out which class to reference (or whether to reference the builtin function type). Lines 48-54 of conf.py simplify sphinx's resolver so that it doesn't get confused about references to type. I'm also particularly happy about this solution, but it was the only method I could find short of renaming every class member and breaking the readers in SasView.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

The accessors framework is no longer present, so we don't need an absolute_temperature accessor
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

Lines aren't supposed to have unexpected indentation
codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Our agent can fix these. Install it.

No quality gates enabled for this code.

Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@rprospero rprospero marked this pull request as ready for review June 17, 2026 10:13
@rprospero rprospero requested a review from DrPaulSharp June 17, 2026 10:14

@llimeht llimeht left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huge thanks for this work!

A couple of queries - I guess the one about using a dollar-math extension is probably worth fixing within this PR for completeness.

Comment thread sasdata/quantities/absolute_temperature.py
difference between consecutive edges which have been first converted
to $u$. Only $u_j \in [0, \Delta q_\perp]$ are used, which corresponds
to $q_j \in \left[q, \sqrt{q^2 + \Delta q_\perp}\right]$, so
to $u$. Only $u_j \in [0, \Delta q\_\perp]$ are used, which corresponds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I spot checked these ones and found:

Image

(screenshot from downloading the artifact from CI and unzipping the whl)

Looking at the sphinx config, it's not actually loading any sort of dollar-math or mathjax sphinx extension - presumably this has actually been broken in the docs since they separated from sasview (which has its own private dollar-math sphinx extension).

Perhaps also time to add that?

https://github.com/matthew-brett/texext (packaged for Debian and used by a few packages)
https://github.com/sympy/sphinx-math-dollar/ (not packaged for Debian)
https://github.com/SasView/sasview/blob/main/docs/sphinx-docs/source/_extensions/dollarmath.py (sasview version)

Comment thread pyproject.toml
[[tool.hatch.build.targets.wheel.hooks.sphinx.tools]]
tool = "build"
format = "html"
warnings = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Please let me know if any additional hatch-sphinx features are needed for this work!)

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.

Errors and warnings in when building documentation

2 participants