Skip to content

Conversation

eumiro
Copy link
Contributor

@eumiro eumiro commented Mar 15, 2025

Another bunch of docstrings reviewed.

@eumiro eumiro force-pushed the docstring-generators branch from db9b2a4 to 2caa71d Compare March 15, 2025 18:01
@coveralls
Copy link

coveralls commented Mar 15, 2025

Pull Request Test Coverage Report for Build 13937689195

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.321%

Totals Coverage Status
Change from base Build 13875968017: 0.0%
Covered Lines: 18457
Relevant Lines: 19363

💛 - Coveralls

@IvanIsCoding
Copy link
Collaborator

IvanIsCoding commented Mar 15, 2025

I will review this more carefully either tomorrow or on Monday, but one of the things that I just remembered: we are missing the Karate Club generator in this file! https://github.com/Qiskit/rustworkx/blob/main/docs/source/api/generators.rst

We documented it in the release notes: https://www.rustworkx.org/dev/release_notes.html#relnotes-0-16-0. If you add a line to that file it will include it in the docs.

Thanks again for starting this initiative! Our docstrings are improving a lot. All users will appreciate these changes

@eumiro eumiro force-pushed the docstring-generators branch from 2caa71d to 745f251 Compare March 15, 2025 20:01
Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

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

Two things:

  • Our docstrings are partially correct. I don't think we enforce that it is a list, any sequence works. Moreover, for generators we don't know the type of node/edge objects so it is Any. Here is the "source" of truth: https://github.com/Qiskit/rustworkx/blob/main/rustworkx/generators/__init__.pyi
  • In #1280 I indented the docstring wrong. It was never getting built so it never got caught. But now that it is included CI is failing to build the docs 🤦

@IvanIsCoding
Copy link
Collaborator

IvanIsCoding commented Mar 17, 2025

And again, thanks for highlighting this. I don't think we'd have caught the discrepancy between the type annotations and the docstring.

https://pyo3.rs/v0.23.5/conversions/tables.html is the reference that any typing.Sequence[Any] maps to a Vec<PyObject>, if you were curious about it.

@eumiro eumiro force-pushed the docstring-generators branch from 84f846c to f35fb4a Compare March 17, 2025 19:31
@IvanIsCoding IvanIsCoding enabled auto-merge March 19, 2025 02:41
@IvanIsCoding IvanIsCoding added this pull request to the merge queue Mar 19, 2025
Merged via the queue into Qiskit:main with commit 9b2a9da Mar 19, 2025
31 checks passed
@eumiro eumiro deleted the docstring-generators branch March 19, 2025 19:43
SILIZ4 pushed a commit to SILIZ4/rustworkx that referenced this pull request Jul 4, 2025
* Consolidate docstrings in generators.rs

* Try to fix identation in generators.rs

---------

Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
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.

3 participants