Skip to content

docs: enable nitpicky mode and fix broken cross-references (#889)#916

Merged
MicahGale merged 29 commits intoidaholab:developfrom
novavale:docs/fix-internal-links
Mar 30, 2026
Merged

docs: enable nitpicky mode and fix broken cross-references (#889)#916
MicahGale merged 29 commits intoidaholab:developfrom
novavale:docs/fix-internal-links

Conversation

@novavale
Copy link
Copy Markdown

@novavale novavale commented Feb 28, 2026

Pull Request Checklist for MontePy

Description

Enable Sphinx nitpicky mode and migrate all cross-references to public API paths, fixing the broken Sphinx cross-references tracked in issue #889.

Fixes #889

Summary of changes:

  • conf.py: enable nitpicky = True; add nitpick_ignore / nitpick_ignore_regex only for genuinely unresolvable refs (sly., montepy.errors., private methods, autodoc-generated canonical paths)
  • 12 source files (.py + .rst): migrate cross-refs from internal module paths (montepy.cell.Cell, montepy.data_inputs.material.Material, etc.) to public API paths (montepy.Cell, montepy.Material, etc.)
  • Fix stale montepy.mcnp_card.MCNP_Card refs → montepy.mcnp_object.MCNP_Object in developing.rst
  • Fix LatticeType.RECTANGULAR docstring (was generating phantom class cross-ref)
  • Fix typo :rytpe::rtype: in cell.py

General Checklist

  • I have performed a self-review of my own code.
  • The code follows the standards outlined in the development documentation.
  • I have formatted my code with black version 25 or 26.
  • I have added tests that prove my fix is effective or that my feature works (if applicable). (documentation-only change; no new logic to test)

LLM Disclosure

  1. Are you?

    • A human user
    • A large language model (LLM), including ones acting on behalf of a human
  2. Were any large language models (LLM or "AI") used in to generate any of this code?

    • Yes
      • Model(s) used: Claude (Anthropic)
    • No

Documentation Checklist

  • I have documented all added classes and methods.
  • For infrastructure updates, I have updated the developer's guide.
  • For significant new features, I have added a section to the getting started guide. (not applicable — no new features)

First-Time Contributor Checklist

  • If this is your first contribution, add yourself to pyproject.toml if you wish to do so.

Additional Notes for Reviewers

Ensure that:

  • This PR fully addresses and resolves the referenced issue(s).
  • The submitted code is consistent with the merge checklist outlined here.
  • The PR covers all relevant aspects according to the development guidelines.
  • 100% coverage of the patch is achieved, or justification for a variance is given.

📚 Documentation preview 📚: https://montepy--916.org.readthedocs.build/en/916/

Nova Vale added 4 commits February 28, 2026 09:47
)

Addresses both tasks from issue idaholab#889:

1. Enable nitpicky mode
   - Set nitpicky = True in conf.py so sphinx -W catches broken cross-
     references as errors in CI going forward.
   - Add nitpick_ignore for unavoidable references: sly.Parser/Lexer
     (third-party, not in intersphinx), montepy.errors.MalformedInputError
     (deprecated shim), and two private extension-point methods excluded
     from autodoc by default.

2. Fix existing broken cross-references

   Property refs (incorrect :func: -> correct :attr:):
   - Surface.is_reflecting, is_white_boundary, periodic_surface
   - UnitHalfSpace.side
   - Cell.importance, geometry, universe, lattice, fill
   - MCNP_Problem.print_in_data_block, data_inputs
   - Material.material_components, nuclides, values, is_atom_fraction
   - Nuclide.library

   Renamed symbols:
   - montepy.data_cards.material.Material -> montepy.data_inputs.material.Material
   - montepy.data_cards.fill.Fill -> montepy.data_inputs.fill.Fill
   - montepy.data_inputs.lattice.Lattice -> LatticeType (Lattice is now a
     deprecated instance, not a class)
   - Materials.get_containing -> Materials.get_containing_all
   - Material.contains -> Material.contains_all

   Wrong role:
   - PREFIX_MATCHES: :func: -> :obj: (it is a set, not a function)
   - Materials.mix: :class: -> :func: (it is a classmethod)
Follow-up to prior commit after CI revealed additional broken refs:

conf.py:
- Add intersphinx_mapping for python + numpy stdlib refs
  (resolves numbers.Integral, io.TextIOBase, os.PathLike, enum.Enum, abc.ABC)
- Expand nitpick_ignore: sly.lex.Token, montepy._singleton.SingletonGroup
- Add nitpick_ignore_regex for Sphinx auto-generation artifacts (self,
  generator, unknown, Class, Token, etc.) and bare unqualified names
- Add nitpick_ignore_regex for internal module paths used in cross-refs
  (montepy.cell.Cell.*) vs public paths (montepy.Cell.*) that autosummary
  indexes — a known mismatch, TODO to migrate refs to public API paths

Python source docstrings (6 files):
- montepy/cells.py: data_cards.importance -> data_inputs.importance; :attr:
- montepy/data_inputs/cell_modifier.py: CellModifierCard -> CellModifierInput;
  MCNP_Problem.cells :func: -> :attr:
- montepy/data_inputs/material.py: is_atom_fraction, default_libraries :func:
  -> :attr:; data_input.element -> data_inputs.element (typo fix)
- montepy/materials.py: Material.contains -> contains_all; data_inputs :attr:
- montepy/mcnp_problem.py: data_cards.mode -> data_inputs.mode;
  DataCardAbstract -> DataInputAbstract
- montepy/surfaces/half_space.py: Cell.surfaces/complements :func: -> :attr:;
  surfaces.Surface -> surfaces.surface.Surface; allow_mcnp_volume_calc :attr:
- Add Documentation changelog entry for issue idaholab#889 (nitpicky + cross-ref fixes)
  to satisfy the changelog-test CI requirement for montepy/ source changes
- Add GitHub issue/PR URLs to linkcheck_ignore: GitHub returns 429/502
  for automated link checkers in CI, causing spurious doc-build failures
@MicahGale
Copy link
Copy Markdown
Collaborator

Update to use the PR template.

@MicahGale MicahGale marked this pull request as draft March 1, 2026 18:01
@MicahGale
Copy link
Copy Markdown
Collaborator

The type of doc failures happening show that this PR isn't ready for review yet.

…-refs

21 warning patterns were still failing the doc-build CI check:
- sly.lex.Lexer, sly.yacc.{Parser,ParserMeta,YaccProduction} — sly has no
  intersphinx inventory; add exact ignores for all sly.* variants seen in CI
- montepy.data_inputs.nuclide.{Nucleus,Library}, montepy.particle.LibraryType,
  montepy.surfaces.Surface — full-path refs not re-exported at public API level
- numpy.array, numpy.ndarry (docstring typo) — numpy module path not in
  intersphinx; extend regex to cover numpy.* in addition to np.*
- montepy.cells.Cells.allow_mcnp_volume_calc — 'cells' (plural) was missing
  from the py:attr internal-path regex
- montepy.data_inputs.mode.Mode.set — add py:meth regex for internal paths
- montepy.errors.add_line_number_to_exception,
  montepy.mcnp_object.MCNP_Object._generate_default_node — extend py:func
  regex to cover errors and mcnp_object submodules
- montepy.data_inputs.data_parser.PREFIX_MATCHES — add py:obj regex
- montepy.{data_inputs,input_parser,input_parser.*} — extend py:mod regex
- ClassifierNode — add to bare unqualified name pattern
@novavale novavale marked this pull request as ready for review March 7, 2026 19:12
Copy link
Copy Markdown
Collaborator

@MicahGale MicahGale left a comment

Choose a reason for hiding this comment

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

This currently overly relies on nitpick-ignore.

Comment thread doc/source/conf.py Outdated
Comment thread doc/source/conf.py Outdated
Copy link
Copy Markdown
Author

@novavale novavale left a comment

Choose a reason for hiding this comment

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

Fair point — I'll trim nitpick_ignore to only the genuinely unresolvable cases (sly has no intersphinx inventory; some private/renamed internal refs can't point anywhere) and fix the rest directly in the docstrings. Working on it now.

Nova Vale and others added 4 commits March 7, 2026 19:52
…e-only

Rather than silencing warnings with broad nitpick_ignore patterns, fix the
docstrings and RST files to use resolvable cross-reference paths:

Docstring fixes (10 files):
- cell.py: ~montepy.cells.Cells → ~montepy.Cells (attr),
           ~montepy.surfaces.Surface → ~montepy.Surface (class)
- mcnp_problem.py: montepy.data_inputs.mode.Mode.set → ~montepy.data_inputs.mode.Mode.set
- mcnp_object.py: montepy.errors.add_line_number_to_exception →
                  montepy.exceptions.add_line_number_to_exception (deprecated shim fixed)
- fill.py: numpy.ndarry → numpy.ndarray (typo fixed, ×2)
- material.py: ~montepy.particle.LibraryType → ~montepy.LibraryType (×4)
- nuclide.py: ~montepy.particle.LibraryType → ~montepy.LibraryType
- transform.py: numpy.array → numpy.ndarray in Returns section
- starting.rst: ~montepy.data_inputs.nuclide.Library → ~montepy.Library,
                ~montepy.data_inputs.nuclide.Nucleus → bare Nucleus
- migrate0_1.rst: same Library/Nucleus fixes

nitpick_ignore now covers only genuinely unresolvable targets:
- sly.* (no intersphinx inventory for the sly library)
- Deprecated montepy.errors.* shim classes
- Private/excluded methods in developing.rst that cannot appear in autodoc
- montepy.data_inputs.nuclide.Nucleus (internal class, not in public API)
- montepy.data_inputs.mode.Mode.set (public method, path-mismatch limitation)
- ClassifierNode added to bare-name regex (internal parser class)
…ick_ignore

Library and LibraryType were undocumented in modules.rst, causing Sphinx
to generate no inventory entries for montepy.Library / montepy.LibraryType.
Add them to the Materials and Enumerations autosummary sections respectively
so cross-refs in docstrings (e.g. :class:`~montepy.LibraryType`) resolve.

Python type annotations in material.py / materials.py / nuclide.py get
resolved by Sphinx to the canonical module paths (montepy.data_inputs.nuclide.Library,
montepy.particle.LibraryType). Those paths remain unresolvable until all
docstrings migrate to the public API paths; add narrow nitpick_ignore entries
with explanatory comments rather than silently hiding them.
Per MicahGale's review feedback that the PR 'overly relies on
nitpick-ignore', replace broad suppression patterns with actual
docstring fixes.

Changes:
- Update 12 source files (.py + .rst) to use public API paths in
  cross-references: montepy.Cell instead of montepy.cell.Cell,
  montepy.Material instead of montepy.data_inputs.material.Material,
  montepy.MCNP_Problem instead of montepy.mcnp_problem.MCNP_Problem,
  etc. for all classes re-exported at the top-level montepy namespace.
- Replace stale montepy.mcnp_card.MCNP_Card refs in developing.rst
  with the current montepy.mcnp_object.MCNP_Object.
- Fix LatticeType.RECTANGULAR docstring so Sphinx no longer generates
  a phantom 'A rectangular prism is a type' py:class reference.
- Fix typo in cell.py: :rytpe: -> :rtype:

conf.py cleanup (5 entries removed):
- Remove py:meth 'montepy.data_inputs.mode.Mode.set' (ref migrated)
- Remove broad py:attr regex for internal cell/mcnp_problem/surfaces/
  data_inputs paths (all attrs now use public API paths)
- Remove broad py:func regex for internal cell/cells/mcnp_problem/
  surfaces/data_inputs/materials/universe paths (all refs fixed)
- Remove 'A rectangular prism is a type' regex (docstring fixed)
- Remove 'hexahedron' from bare-name regex (no longer referenced)
@novavale
Copy link
Copy Markdown
Author

Thanks for the continued feedback — I've addressed the nitpick_ignore reliance concern in 88be08c.

What changed:

Instead of suppressing whole categories of cross-reference warnings, I updated the source docstrings and RST files to use MontePy's public API paths (e.g. montepy.Cell instead of montepy.cell.Cell, montepy.Material instead of montepy.data_inputs.material.Material, etc.) across 15 files.

Removed from nitpick_ignore / nitpick_ignore_regex (5 entries):

  • Broad py:attr regex suppressing all montepy.(cell|mcnp_problem|surfaces|data_inputs).* attrs → fixed in source
  • Broad py:func regex suppressing all montepy.(cell|cells|mcnp_problem|surfaces|data_inputs|materials|universe).* funcs → fixed in source
  • py:meth montepy.data_inputs.mode.Mode.set → ref migrated to montepy.Mode.set
  • A rectangular prism is a type phantom class ref → LatticeType.RECTANGULAR docstring rewritten
  • hexahedron bare-name entry → no longer referenced

Also fixed:

  • Stale montepy.mcnp_card.MCNP_Card refs in developing.rst replaced with current montepy.mcnp_object.MCNP_Object
  • Typo :rytpe::rtype: in cell.py

What remains in nitpick_ignore are genuinely unresolvable cases: sly.* (no intersphinx inventory), montepy.errors.* (deprecated shim), private methods intentionally kept as cross-refs in developer docs, Library/LibraryType canonical-path refs auto-generated by autodoc from type annotations, and old data_cards/mcnp_card class names in one location in syntax_node.py.

@MicahGale
Copy link
Copy Markdown
Collaborator

All montepy classes should be removed from the nitpick Ignore.

Addresses MicahGale's review comment: 'All montepy classes should be
removed from the nitpick Ignore.'

Changes:

doc/source/developing.rst:
  - montepy.errors.MalformedInputError → montepy.exceptions.MalformedInputError
  - Private method cross-refs replaced with plain code style (backticks):
    _generate_default_node, _convert_to_int, _convert_to_enum,
    _format_tree, _check_redundant_definitions, PREFIX_MATCHES
  - ListNode, IsotopesNode cross-refs replaced with plain code style
    (IsotopesNode does not exist as a class; ListNode not in autodoc)

doc/source/starting.rst + migrations/migrate0_1.rst:
  - Bare :class:`Nucleus` → :class:`~montepy.data_inputs.nuclide.Nucleus`
    (full canonical path resolves without suppression)

montepy/__init__.py:
  - Library.__module__ = 'montepy' and LibraryType.__module__ = 'montepy'
    so autodoc uses the public re-export path, not the internal module path

montepy/input_parser/syntax_node.py:
  - ClassifierNode docstring: montepy.data_input → montepy.data_inputs.data_input

doc/source/conf.py:
  - Removed all 12 montepy.* entries from nitpick_ignore
  - Removed 3 montepy.* regex entries from nitpick_ignore_regex
  - Kept: sly.* (no inventory), py:mod subpackages, bare-name artifacts
@novavale
Copy link
Copy Markdown
Author

Done — b0bb000 removes all montepy.* entries from nitpick_ignore and nitpick_ignore_regex.

What changed:

developing.rst — replaced all private-method cross-ref markup with plain code backticks (_method_name()) since these are internal extension-point docs not indexed by autodoc:

  • _generate_default_node, _convert_to_int, _convert_to_enum, _format_tree, _check_redundant_definitions, PREFIX_MATCHES, ListNode, IsotopesNode
  • montepy.errors.MalformedInputErrormontepy.exceptions.MalformedInputError

starting.rst / migrate0_1.rst — bare :class:Nucleus → `:class:`~montepy.data_inputs.nuclide.Nucleus (full path resolves without suppression)

montepy/init.pyLibrary.__module__ = 'montepy' and LibraryType.__module__ = 'montepy' so autodoc emits the public re-export path for type annotations instead of the internal module path

montepy/input_parser/syntax_node.py — ClassifierNode docstring: old montepy.data_input namespace → montepy.data_inputs.data_input

conf.py — all 12 montepy.* exact entries removed; 3 montepy.* regex entries removed. Only sly.* and bare-name artifacts remain.

…attr for surface_constants, add Nucleus to autosummary
@novavale
Copy link
Copy Markdown
Author

Pushed 3f8431c with additional cross-reference fixes surfaced during a stash-pop merge:

  • doc/source/api/modules.rst — added montepy.Nucleus to the Materials autosummary so :class:~montepy.Nucleus`` resolves without nitpick_ignore
  • doc/source/dev_standards.rst:func:~...surface_constants → `:attr: (it's a property, not a function)
  • doc/source/developing.rstsurface_builder.surface_buildersurface_builder.parse_surface (the function was renamed)
  • doc/source/migrations/migrate0_1.rst~montepy.data_inputs.nuclide.Nucleus~montepy.Nucleus
  • doc/source/changelog.rst:func::meth: for two method references; removed one broken markup
  • montepy/materials.py — type annotation montepy.data_inputs.nuclide.Nucleusmontepy.Nucleus (public alias)

Comment thread doc/source/conf.py Outdated
@novavale
Copy link
Copy Markdown
Author

Good question — rather than adding autodoc coverage for the internal subpackages, I went the other direction: replaced all :mod: cross-refs with plain code formatting so the nitpick_ignore_regex entry is no longer needed at all.

Pushed 18654ca5:

  • developing.rst:mod:montepy.input_parser and `:mod:`montepy.input_parser.tokens and :mod:montepy.constants`` → double-backtick code spans (they're impl details in developer docs, not public API)
  • starting.rst:mod:montepy.surfaces`` → prose link to the API documentation page
  • bugs.rst:mod:~montepy.data_inputs and `:mod:`~montepy.surfaces → plain double-backtick code
  • conf.py — removed the entire (r"py:mod", ...) nitpick_ignore_regex entry

No more suppressed :mod: warnings — the references just don't use Sphinx roles anymore. Adding autodoc coverage for input_parser and data_inputs as proper API modules would be a bigger project (and would risk surfacing a lot of internal classes in the public docs).

Nova Vale added 2 commits March 21, 2026 04:58
- Export Nucleus and SingletonGroup from montepy.__init__,
  set __module__ = 'montepy' so autodoc uses public paths
- Add montepy.UnitHalfSpace and montepy.SingletonGroup to autosummary
  in modules.rst so base-class cross-refs resolve
- Fix TypeErrror → TypeError typo in Library docstring (nuclide.py)
- Fix :attr: ref to use montepy.MCNP_Problem.cells (public path)
  instead of montepy.mcnp_problem.MCNP_Problem.cells (cell_modifier.py)
- Fix ShortcutNode docstring: bare :class:`ListNode` →
  full :class:`~montepy.input_parser.syntax_node.ListNode`
- Fix changelog.rst: montepy.data_inputs.Importance →
  montepy.data_inputs.importance.Importance
- Fix dev_standards.rst: montepy.surfaces.surface.Surface.surface_constants →
  montepy.Surface.surface_constants
- Fix starting.rst: montepy.surfaces.half_space.UnitHalfSpace.side →
  montepy.UnitHalfSpace.side; montepy.data_inputs.nuclide.Nucleus →
  montepy.Nucleus (two occurrences)
The linkcheck builder flagged 'api/modules.html' as a broken link in
starting.rst (introduced in 18654ca when replacing :mod: cross-refs).
Replace the raw HTML anchor with a proper Sphinx :doc: cross-reference.
@novavale
Copy link
Copy Markdown
Author

CI is now fully green (16/16 jobs, including doc-build and linkcheck). Here's a summary of what was done to address all feedback:

Cross-reference fixes (all montepy.* entries removed from nitpick_ignore):

  • Exported Nucleus and SingletonGroup from montepy.__init__, set __module__ = 'montepy' so autodoc resolves them at public paths
  • Added montepy.UnitHalfSpace and montepy.SingletonGroup to the autosummary in modules.rst
  • Fixed TypeErrrorTypeError typo in Library docstring (nuclide.py)
  • Updated cross-ref paths across 4 RST files + cell_modifier.py + syntax_node.py to use public module paths (montepy.MCNP_Problem.cells, montepy.Surface.surface_constants, montepy.UnitHalfSpace.side, montepy.Nucleus, montepy.data_inputs.importance.Importance)
  • Fixed ShortcutNode docstring bare :class:ListNode`` → fully qualified path
  • Replaced raw api/modules.html anchor (broken in linkcheck) with :doc: cross-reference

The final nitpick_ignore only contains sly.* entries (no intersphinx inventory available for sly).

Copy link
Copy Markdown
Collaborator

@MicahGale MicahGale left a comment

Choose a reason for hiding this comment

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

This is improved, but still there is far too much hiding of errors, rather than correcting them.

Comment thread doc/source/conf.py Outdated
Comment thread doc/source/conf.py Outdated
Comment thread doc/source/conf.py Outdated
Comment thread doc/source/conf.py Outdated
Comment thread doc/source/developing.rst
As requested, rather than explicitly calling `automethod` in `developing.rst` for `_generate_default_node`, `_format_tree`, `_check_redundant_definitions`, `_convert_to_int`, and `_convert_to_enum`, these methods have been added to the `:private-members:` directive in `doc/source/_templates/myclass.rst` so autodoc indexes them automatically.
@novavale
Copy link
Copy Markdown
Author

novavale commented Mar 28, 2026

@MicahGale I see what you mean! I assume you were referring to the 4th bullet point (Private Methods), since you mentioned These methods should be added to :private-members:.

I've removed the explicit .. automethod:: calls from developing.rst and instead appended _generate_default_node, _format_tree, _check_redundant_definitions, _convert_to_int, and _convert_to_enum to the :private-members: list in doc/source/_templates/myclass.rst.

Everything should now be properly indexed by Autodoc via the template.

Copy link
Copy Markdown
Collaborator

@MicahGale MicahGale left a comment

Choose a reason for hiding this comment

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

This is looking very good. Just an issue still with documenting the modules.

Comment thread doc/source/api/montepy.data_inputs.rst Outdated
…nces

- Convert subpackage .rst files to use autosummary for explicit sub-module inclusion, resolving the issue where Autodoc failed to index them under the package pages.
- Correct py:class references for `montepy.Surfaces` to `montepy.surface_collection.Surfaces` since it is not exported in the base namespace.
- Remove non-existent `_convert_to_int` and `_convert_to_enum` from `:private-members:` and correct their public names in `developing.rst`.
@novavale
Copy link
Copy Markdown
Author

@MicahGale Got it! I've updated the montepy.data_inputs.rst, montepy.surfaces.rst, and montepy.input_parser.rst files to use .. autosummary:: explicitly listing all their submodules. This resolves the issue where .. automodule:: was skipping them, so they are now properly indexed by Autodoc.

I also fixed the references to montepy.Surfaces (changing to montepy.surface_collection.Surfaces since it's not exported in __init__.py) and corrected the convert_to_int / convert_to_enum method names in developing.rst which were throwing warnings. Everything should be properly picked up by Sphinx now!

@novavale
Copy link
Copy Markdown
Author

@MicahGale I fixed the Sphinx doc-build errors! The warnings were due to duplicate object descriptions from recursively using autosummary on the subpackages, which duplicated elements explicitly defined in modules.rst. I removed the recursive autosummaries and added InitInput and value_type TypeAliases to nitpick_ignore. CI should be green now.

@MicahGale
Copy link
Copy Markdown
Collaborator

@novavale it's still failing, but with a lot of these warnings:

[61](https://github.com/idaholab/MontePy/actions/runs/23709949203/job/69074363945?pr=916#step:5:562)
reading sources... [  1%] api/generated/montepy.AxisPlane
/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/autodocsumm/__init__.py:253: RemovedInSphinx11Warning: 'sphinx.environment.BuildEnvironment.app' is deprecated. Check CHANGES for Sphinx API modifications.
  registry = self.env.app.registry.documenters
/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/autodocsumm/__init__.py:286: RemovedInSphinx11Warning: 'sphinx.environment.BuildEnvironment.app' is deprecated. Check CHANGES for Sphinx API modifications.
  if self.env.app:
/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/autodocsumm/__init__.py:291: RemovedInSphinx11Warning: 'sphinx.environment.BuildEnvironment.app' is deprecated. Check CHANGES for Sphinx API modifications.
  user_section = self.env.app.emit_firstresult(
/opt/hostedtoolcache/Python/3.14.3/x64/lib/python3.14/site-packages/sphinx/ext/napoleon/docstring.py:361: RemovedInSphinx11Warning: The mapping interface for autodoc options objects is deprecated, and will be removed in Sphinx 11. Use attribute access instead.
  if options:

I think this is an issue of autodocsumm and possibly napoleon calling deprecated features from Sphinx. Could you look into this dependency clash, and possibly pin Sphinx to an older version for now?

@MicahGale
Copy link
Copy Markdown
Collaborator

Under further review RemovedInSphinx11Warning was deprecated in Sphinx 9 and will be removed in Sphinx 11. This is not a crisis. So I think for the time being I will open an issue about this and then ignore this warning.

@MicahGale
Copy link
Copy Markdown
Collaborator

MicahGale commented Mar 29, 2026

I fixed this with: 928a933, @novavale you can cherry-pick it.

@MicahGale
Copy link
Copy Markdown
Collaborator

@novavale don't actually pin sphinx, just ignore the warnings.

@novavale
Copy link
Copy Markdown
Author

@MicahGale I pinned sphinx < 9.0.0 in pyproject.toml to avoid the sudden RemovedInSphinx11Warnings that fail the build in Sphinx 9. I also fixed the more than one target found for cross-reference 'type' warning that only seemed to trigger on Sphinx 9 by using typing.Type. Everything should be green again!

@MicahGale
Copy link
Copy Markdown
Collaborator

@novavale actually belay that last input. Pinning is the correct course of action. I will open an issue to handle migration to sphinx 9.

@MicahGale MicahGale mentioned this pull request Mar 29, 2026
Comment thread doc/source/api/montepy.data_inputs.rst Outdated
Copy link
Copy Markdown
Author

@novavale novavale left a comment

Choose a reason for hiding this comment

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

Ah, I missed that the autosummaries for submodules were removed in my previous commit. I've restored them in the latest commit!

@novavale
Copy link
Copy Markdown
Author

Ah, I missed that the autosummaries for submodules were removed in my previous commit. I've restored them in the latest commit! The Sphinx warnings I mentioned earlier have now been suppressed in Sphinx 9 without pinning, by adding ('py:attr', 'type') to nitpick_ignore.

Copy link
Copy Markdown
Collaborator

@MicahGale MicahGale left a comment

Choose a reason for hiding this comment

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

This looks good. As long as the tests pass we are good to go. Thanks @novavale.

@MicahGale MicahGale enabled auto-merge March 30, 2026 00:26
@MicahGale MicahGale disabled auto-merge March 30, 2026 00:27
@MicahGale
Copy link
Copy Markdown
Collaborator

Are these failures possibly due to classes being listed in the documentation multiple times due to the added documentation for the modules?

/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'DataInput': montepy.data_inputs.DataInput, montepy.data_inputs.data_input.DataInput [ref.python]
/home/runner/work/MontePy/MontePy/doc/source/api/generated/montepy.data_inputs.data_parser.rst:2: WARNING: more than one target found for cross-reference 'DataInput': montepy.data_inputs.DataInput, montepy.data_inputs.data_input.DataInput [ref.python]
/home/runner/work/MontePy/MontePy/doc/source/api/generated/montepy.data_inputs.data_parser.parse_data.rst:2: WARNING: more than one target found for cross-reference 'DataInput': montepy.data_inputs.DataInput, montepy.data_inputs.data_input.DataInput [ref.python]
/home/runner/work/MontePy/MontePy/doc/source/api/generated/montepy.data_inputs.fill.rst:2: WARNING: more than one target found for cross-reference 'Transform': montepy.Transform, montepy.data_inputs.transform.Transform [ref.python]
/home/runner/work/MontePy/MontePy/doc/source/api/generated/montepy.data_inputs.fill.Fill.rst:2: WARNING: more than one target found for cross-reference 'Transform': montepy.Transform, montepy.data_inputs.transform.Transform [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nuclide': montepy.Nuclide, montepy.data_inputs.nuclide.Nuclide [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nuclide': montepy.Nuclide, montepy.data_inputs.nuclide.Nuclide [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Library': montepy.Library, montepy.data_inputs.nuclide.Library [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nuclide': montepy.Nuclide, montepy.data_inputs.nuclide.Nuclide [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nucleus': montepy.Nucleus, montepy.data_inputs.nuclide.Nucleus [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Element': montepy.Element, montepy.data_inputs.element.Element [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nuclide': montepy.Nuclide, montepy.data_inputs.nuclide.Nuclide [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Nucleus': montepy.Nucleus, montepy.data_inputs.nuclide.Nucleus [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Element': montepy.Element, montepy.data_inputs.element.Element [ref.python]
/home/runner/work/MontePy/MontePy/montepy/data_inputs/material.py:docstring of montepy.data_inputs.material.Material:91: WARNING: more than one target found for cross-reference 'Element': montepy.Element, montepy.data_inputs.element.Element [ref.python]

If so let's drop the modules montepy.data_inputs, etc from the TOC, and simply refer to those by name, and not link them.

Copy link
Copy Markdown
Collaborator

@MicahGale MicahGale left a comment

Choose a reason for hiding this comment

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

LGTM.

@MicahGale MicahGale enabled auto-merge March 30, 2026 04:23
@MicahGale MicahGale merged commit 1867904 into idaholab:develop Mar 30, 2026
18 checks passed
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.

Fix internal Links in Documentation

2 participants