Skip to content

Conversation

tlambert03
Copy link
Member

this PR adds a new command just add-docs, backed by scripts/add_docstrings.py that:

  1. Uses Doxygen to parse C++ source files and output structured XML containing all documentation
  2. Parses the Doxygen XML to create a mapping of ClassName::MethodName to docstring content
  3. Scans the nanobind C++ file for .def() calls and adds missing docstrings
  4. The updated bindings automatically propagate docstrings to the generated .pyi type stubs

I must be manually run, since i'm not 100% certain that it will always work... (uses some rather manual regexes). But it seems to be working well at the moment and definitely saves a lot of time in any case, leaving it only up to the reviewer to double check.

@tlambert03 tlambert03 changed the title auto-add docstrings from MMCore.cpp docs: auto-add docstrings from MMCore.cpp Jul 13, 2025
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

Attention: Patch coverage is 89.35185% with 23 lines in your changes missing coverage. Please review.

Project coverage is 31.53%. Comparing base (9b9cd81) to head (47bf149).

Files with missing lines Patch % Lines
src/_pymmcore_nano.cc 89.35% 0 Missing and 23 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main      #59     +/-   ##
=========================================
  Coverage   31.53%   31.53%             
=========================================
  Files         138      138             
  Lines       18211    18211             
  Branches     7857     7857             
=========================================
  Hits         5743     5743             
+ Misses      10480     8450   -2030     
- Partials     1988     4018   +2030     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant