Updating docstrings so that sphinx will build the documentation.#581
Updating docstrings so that sphinx will build the documentation.#581
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Pull request overview
This PR updates docstrings to improve Sphinx documentation generation. The changes focus on correcting type hints and formatting docstrings to comply with Sphinx/NumPy documentation standards.
- Updates type hints in docstrings to use more precise Python module references (e.g.,
pathlib.Path,collections.abc.Callable) - Improves docstring formatting with proper section headers (Note, Examples) and indentation for nested lists
- Suppresses autoapi import warnings in Sphinx configuration and removes
-W(warnings-as-errors) flag from pre-commit hooks to allow documentation to build despite import issues with_version.py
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/hyrax/pytorch_ignite.py |
Updated type hints in docstrings to use full module paths for dataset and Engine types |
src/hyrax/plugin_utils.py |
Updated type hints from generic "function" and "str" to more precise collections.abc.Callable and pathlib.Path |
src/hyrax/model_exporters.py |
Updated type hints from "NumPy array" and "Path" to np.ndarray and pathlib.Path |
src/hyrax/data_sets/random/hyrax_random_dataset.py |
Fixed indentation and formatting for nested list items in docstrings |
src/hyrax/data_sets/hyrax_csv_dataset.py |
Improved documentation structure with proper Note and Examples sections using reST formatting |
docs/pre_executed/hyraxql_iterable_demo.ipynb |
Removed notebook file (no longer needed or referenced in docs) |
docs/conf.py |
Added suppression of autoapi import resolution warnings |
.pre-commit-config.yaml |
Removed -W flag to allow docs to build with warnings instead of treating them as errors |
| validation_data_loader : DataLoader | ||
| The data loader for the validation data | ||
| trainer : Engine | ||
| trainer : pytorch-ignite.Engine |
There was a problem hiding this comment.
The type hint format "pytorch-ignite.Engine" is non-standard and may not be recognized by Sphinx or static type checkers. It should be "ignite.engine.Engine" or just "Engine" (since Engine is already imported from ignite.engine at the top of the file).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #581 +/- ##
=======================================
Coverage 55.28% 55.28%
=======================================
Files 53 53
Lines 5256 5256
=======================================
Hits 2906 2906
Misses 2350 2350 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mtauraso
left a comment
There was a problem hiding this comment.
Minor nit we probably want to turn back on "-W" since it protects us from broken internal links.
Otherwise this looks reasonable.
Click here to view all benchmarks. |
Add command to prune UV cache before installing dependencies.
Small edits to docstrings:
Autoapi was trying and failing to import _version.py. I was unable to instruct it to ignore that file, so instead I have suppressed that warning. Which may or may not be a great thing.