Add and improve Numpydoc-style docstrings across core modules#367
Add and improve Numpydoc-style docstrings across core modules#367lispandfound wants to merge 7 commits intoeven_more_testsfrom
Conversation
lispandfound
commented
Jan 8, 2026
- Add or enhance Numpydoc-style docstrings for public functions, classes, and methods in qcore modules
- Improve parameter, returns, raises, examples, and notes sections for clarity and consistency
- Update XYTSFile and NHMFault class docstrings and attributes for better documentation
- Refine documentation in constants, coordinates, formats, geo, grid, nhm, point_in_polygon, shared, simulation_structure, siteamp_models, src_site_dist, timeseries, uncertainties/distributions, and xyts modules
- Add Numpydoc linting GitHub Actions workflow for automated docstring checks
- Add or enhance Numpydoc-style docstrings for public functions, classes, and methods in qcore modules - Improve parameter, returns, raises, examples, and notes sections for clarity and consistency - Update XYTSFile and NHMFault class docstrings and attributes for better documentation - Refine documentation in constants, coordinates, formats, geo, grid, nhm, point_in_polygon, shared, simulation_structure, siteamp_models, src_site_dist, timeseries, uncertainties/distributions, and xyts modules - Add Numpydoc linting GitHub Actions workflow for automated docstring checks
Summary of ChangesHello @lispandfound, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the documentation of the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request focuses on adding and improving Numpydoc-style docstrings across various core modules, which significantly enhances code clarity and maintainability. The changes are extensive and well-executed. I've identified a few issues, including a high-severity bug in qcore/constants.py where a function's behavior was altered during refactoring, and a couple of medium-severity issues related to incorrect type hints in qcore/formats.py and qcore/geo.py. My review includes specific suggestions to address these points.
qcore/formats.py
Outdated
| @@ -49,34 +56,22 @@ def station_file_argparser() -> argparse.ArgumentParser: ... # numpydoc ignore= | |||
| def station_file_argparser( | |||
| parser: argparse.ArgumentParser | None = None, | |||
| ) -> argparse.ArgumentParser | None: | |||
There was a problem hiding this comment.
The function station_file_argparser is type-hinted to return argparse.ArgumentParser | None, but it never returns None. If no parser is provided, a new one is created and returned. The return type hint should be argparse.ArgumentParser.
| ) -> argparse.ArgumentParser | None: | |
| ) -> argparse.ArgumentParser: |
|
|
||
| def path_from_corners( | ||
| corners: list[tuple[float, float]], | ||
| output: str | None = "sim.modelpath_hr", |
There was a problem hiding this comment.
The return type hint list[tuple[float | int, float | int]] | None seems incorrect. The function populates the list with values from ll_mid, which returns a tuple of floats. Therefore, int is not expected in the return type. The type hint should be list[tuple[float, float]] | None.
| output: str | None = "sim.modelpath_hr", | |
| ) -> list[tuple[float, float]] | None: |