Skip to content

Fix documentation build and complete API documentation coverage - #632

Merged
julianspeith merged 3 commits into
masterfrom
fix/documentation
Aug 11, 2026
Merged

Fix documentation build and complete API documentation coverage#632
julianspeith merged 3 commits into
masterfrom
fix/documentation

Conversation

@julianspeith

Copy link
Copy Markdown
Contributor

Both documentation builds were broken and the generated output was incomplete and in places actively wrong. This fixes the build, then works through the content.

Doxygen warnings: 295 → 2. Sphinx warnings: 15 → 0.

Build setup

  • Run Sphinx as ${Python3_EXECUTABLE} -m sphinx rather than whichever sphinx-build is first on PATH. hal_py is linked against that interpreter, so an unrelated sphinx-build segfaulted the pydoc target on import. Configure now fails early with an actionable hint that also covers PEP 668 interpreters.
  • Import hal_py in conf.py before autodoc touches a plugin module. Without it the plugin bindings fail with "referenced unknown base type hal::BasePluginInterface", and boolean_influence, dataflow and module_identification produced empty pages.
  • Pass the rst files to cmake -E copy_if_different explicitly; the *.rst glob only worked by accident on shell-based generators.
  • Drop -q from the Sphinx invocation so warnings stop being hidden.
  • Doxyfile: drop 16 obsolete tags; replace the stale INPUT list (which still named a plugin removed years ago while missing 17 existing ones) with the plugin tree plus excludes; remove *.txt from FILE_PATTERNS so every CMakeLists.txt stops being parsed as C; set EXPAND_ONLY_PREDEF with the Qt and visibility macros (Q_DECLARE_METATYPE and __attribute__ were silently swallowing whole classes); derive HAVE_DOT/DOT_PATH from find_package.

Documentation content

  • Every namespace, class and struct now has a full-sentence description of what it is.
  • Fixed parameter names that did not match the code, missing and surplus @param entries, documented return values on void functions, and several doc comments that described an entirely different function.
  • C++ comments and pybind11 docstrings brought in sync, modulo language-appropriate spellings (list/dict vs vector/map, True/False vs true/false, None vs nullptr).
  • true/false/nullptr, None/True/False and file extensions are in code markup, and every @returns `true` if ... states the false case.
  • Added the Sphinx pages that were missing entirely: AsyncSetResetBehavior, MACComponent, LogManager, ProjectDirectory, the base pin classes and the logging functions.

API-visible changes

Needed to make the documentation true — worth a careful look:

Change Note
hal_py.log_trace/debug/info/warning/error/critical New. Channel first, like the C++ macros, so log_info(message)log_info(channel, message). All in-tree callers updated.
hal_py.BooleanFunction.nodes Now a read-only property instead of a method, which is what its docstring always claimed.
GateLibrary.get_gate_location_data_identifiers Was registered under the name of the category getter and therefore unreachable from Python.
Keyword arguments GateType.add_boolean_function(name), GateType.has_property(property), Module.contains_module(recursive), NetlistFactory.load_netlist_from_string(netlist_string).
DotViewerCallFromTread Renamed to DotViewerCallFromThread.
xilinx_toolbox::LOC Members default-initialised; the XDC parser leaves them untouched for pin LOCs.
Parameter renames GateLibrary::add_include, z3_utils::from_bf, z3_utils::value_from_binary_string.

Verification

  • Full build with -DBUILD_ALL_PLUGINS=ON: exit 0, no compile errors.
  • Both doc targets build; the 2 remaining Doxygen warnings are a long-standing typedef-resolution quirk in boolean_function_table_model.cpp.
  • Every one of the 1752 tracked C/C++ files was compared against master with comments and docstring bodies stripped: only the 22 files listed above differ in actual code.

Note: tests/python_binding/test_netlist.py has a pre-existing syntax error and test_gate_library.py references APIs removed long ago; both are untouched here.

Both documentation builds were broken and the generated output was
incomplete and in places actively wrong.

Build setup
-----------
* Run Sphinx as `${Python3_EXECUTABLE} -m sphinx` instead of whichever
  sphinx-build happens to be first on PATH. hal_py is linked against
  that interpreter, so an unrelated sphinx-build crashed the pydoc
  target on import. Configure now fails early with an actionable hint
  that also covers PEP 668 interpreters.
* Import hal_py in conf.py before autodoc touches a plugin module.
  Without it the plugin bindings fail with "referenced unknown base
  type hal::BasePluginInterface" and boolean_influence, dataflow and
  module_identification produced empty pages.
* Pass the rst files to `cmake -E copy_if_different` explicitly; the
  previous '*.rst' glob only worked by accident on shell-based
  generators.
* Drop `-q` from the Sphinx invocation so warnings are no longer hidden.
* Doxyfile: drop 16 obsolete tags, replace the stale INPUT list (which
  still named a plugin removed years ago while missing 17 existing
  ones) with the plugin tree plus excludes, remove *.txt from
  FILE_PATTERNS so CMakeLists.txt is no longer parsed as C, set
  EXPAND_ONLY_PREDEF together with the Qt and visibility macros, and
  derive HAVE_DOT/DOT_PATH from find_package.

Doxygen warnings are down from 295 to 2, Sphinx from 15 to 0.

Documentation content
---------------------
* Every namespace, class and struct now has a full-sentence description
  of what it is.
* Fix parameter names that did not match the code, missing and surplus
  @PARAM entries, documented return values on void functions, and
  several doc comments that described an entirely different function.
* Keep the C++ comments and the pybind11 docstrings in sync, modulo
  language-appropriate spellings (list/dict vs vector/map, True/False
  vs true/false, None vs nullptr).
* Put true/false/nullptr, None/True/False and file extensions in code
  markup, and make every "@returns `true` if ..." state the false case.
* Add the Sphinx pages that were missing entirely, among them
  AsyncSetResetBehavior, MACComponent, LogManager, ProjectDirectory and
  the base pin classes.

API-visible changes
-------------------
These were needed to make the documentation true, and reviewers should
be aware of them:

* hal_py: log_trace/debug/info/warning/error/critical are now available;
  they take the channel first, like the C++ macros, so the previous
  one-argument log_info(message) becomes log_info(channel, message).
  All in-tree callers are updated.
* hal_py.BooleanFunction.nodes is a read-only property instead of a
  method, which is what its docstring always claimed.
* GateLibrary.get_gate_location_data_identifiers was registered under
  the name of the category getter and was therefore unreachable.
* Keyword arguments corrected: GateType.add_boolean_function(name),
  GateType.has_property(property), Module.contains_module(recursive),
  NetlistFactory.load_netlist_from_string(netlist_string).
* Rename DotViewerCallFromTread to DotViewerCallFromThread.
* xilinx_toolbox::LOC members are default-initialised; the XDC parser
  leaves them untouched for pin LOCs.
* GateLibrary::add_include and z3_utils::from_bf /
  value_from_binary_string parameters renamed for consistency.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
julianspeith and others added 2 commits August 11, 2026 18:59
The file had drifted from the tree: two of its rules pointed at directories that
no longer exist and fifteen plugins had no entry at all, so they fell through to
the catch-all rule. Since the code owner mechanism is not used the way it is
meant to be, remove the file rather than maintain a stale mapping.

Note that "Require review from Code Owners" is still enabled in the branch
protection of master. Without a CODEOWNERS file nothing matches, so the setting
has no effect any more and can be switched off separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@julianspeith julianspeith self-assigned this Aug 11, 2026
@julianspeith
julianspeith merged commit daf6337 into master Aug 11, 2026
4 checks passed
@julianspeith
julianspeith deleted the fix/documentation branch August 11, 2026 18:24
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