Skip to content

Fix matrix0 documentation reference and compiler warnings - #42629

Open
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:codex/fix-matrix0-doc-reference
Open

Fix matrix0 documentation reference and compiler warnings#42629
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:codex/fix-matrix0-doc-reference

Conversation

@cxzhong

@cxzhong cxzhong commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the unresolved Sphinx method reference to the Cython-only _set_to_product hook with literal documentation
  • initialize the row and column indices used by Matrix.__getitem__ and Matrix.__setitem__

Root cause

_set_to_product is a cdef method and is not exposed as a Python class member, so Sphinx cannot resolve it as a py:meth target. The uninitialized-index warnings are false positives from the generated C control flow, but they fail to prove to the compiler that the variables are assigned whenever their corresponding flags are set.

Validation

  • rebuilt matrix0.pyx with no -Wmaybe-uninitialized warnings
  • python -m sage.doctest --warn-long 60 src/sage/matrix/matrix0.pyx (990 tests passed)
  • rebuilt reference/matrices HTML documentation successfully; the original unresolved-reference warning is gone

@cxzhong
cxzhong marked this pull request as ready for review August 5, 2026 07:25
@cxzhong
cxzhong requested a review from kwankyu August 5, 2026 07:26
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 59a8810; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu kwankyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants