Skip to content

Update docstring format #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

thisisrick25
Copy link
Contributor

@thisisrick25 thisisrick25 commented Jun 4, 2025

closes #582

  • Updated docstrings in the codebase for consistency and building Sphinx documentation.
  • Improved formatting and added missing punctuation.
  • Added module-level docstrings where necessary to provide context for each module's purpose.

Pydocstyle error codes that are fixed in this PR:

  • D100: Missing docstring in public module
  • D102: Missing docstring in public method
  • D105: Missing docstring in magic method
  • D200: One-line docstring should fit on one line
  • D400: First line should end with a period
  • D401: First line of docstring should be in imperative mood
  • D404: First word of the docstring should not be "This"
  • D407: Missing dashed underline after section
  • D406: Section name should end with a newline

Also improved the literature of the docstrings.

- Added module-level docstrings to `bg_atlas.py`, `cli.py`, `core.py`, `descriptors.py`, `list_atlases.py`, `structure_class.py`, `structure_tree_util.py`, `update_atlases.py`, and `utils.py` for better clarity.
- Improved existing docstrings for various methods to follow consistent formatting and provide clearer descriptions.
- Removed unnecessary blank lines in several files to improve code readability.
- Updated docstrings in `annotation_utils.py`, `mesh_utils.py`, `structure_json_to_csv.py`, `structures.py`, `validate_atlases.py`, and `wrapup.py` for consistency and clarity.
- Improved formatting and added missing punctuation to enhance readability.
- Added module-level docstrings where necessary to provide context for each module's purpose.
- Updated docstrings in various atlas generation scripts to improve consistency and clarity.
- Added missing punctuation and standardized return section formatting for better readability.
- Removed unnecessary blank lines to streamline the code structure.
@alessandrofelder
Copy link
Member

Awesome, thank you for this and the updates on your other PRs @thisisrick25 - I will make time to review next week!

@thisisrick25
Copy link
Contributor Author

thisisrick25 commented Jun 5, 2025

Thank you @alessandrofelder
Do you think I should include the pre-commit-config changes related to #581 in this PR?
Both #581 and #582 are interrelated; in fact I am using the new config to find the docstring errors.

carlocastoldi and others added 13 commits June 6, 2025 10:37
* Allows access to additional_references names via additional_references.keys()

* Updated tests

* Checks if key in references list before querying dictionary

* Adds test for fetching keys before additional reference data
…le modules

- Changed "Arguments" to "Parameters" for uniformity in docstring headers.
- Improved descriptions and added missing details in parameter sections for better understanding.
- Enhanced readability by standardizing formatting and punctuation in docstrings across `cli.py`, `structure_class.py`, `structure_tree_util.py`, `update_atlases.py`, and `utils.py`.
- Updated module-level docstrings in `metadata_utils.py`, `stacks.py`, `structure_json_to_csv.py`, `structures.py`, `validate_atlases.py`, and `volume_utils.py` to provide clearer context and purpose.
- Improved parameter descriptions and standardized formatting in function docstrings for better readability.
- Added missing details in return sections and raised exceptions to enhance documentation quality.
- Added module-level docstrings to `bg_atlas.py`, `cli.py`, `core.py`, `descriptors.py`, `list_atlases.py`, `structure_class.py`, `structure_tree_util.py`, `update_atlases.py`, and `utils.py` for better clarity.
- Improved existing docstrings for various methods to follow consistent formatting and provide clearer descriptions.
- Removed unnecessary blank lines in several files to improve code readability.
- Updated docstrings in `annotation_utils.py`, `mesh_utils.py`, `structure_json_to_csv.py`, `structures.py`, `validate_atlases.py`, and `wrapup.py` for consistency and clarity.
- Improved formatting and added missing punctuation to enhance readability.
- Added module-level docstrings where necessary to provide context for each module's purpose.
- Updated docstrings in various atlas generation scripts to improve consistency and clarity.
- Added missing punctuation and standardized return section formatting for better readability.
- Removed unnecessary blank lines to streamline the code structure.
…le modules

- Changed "Arguments" to "Parameters" for uniformity in docstring headers.
- Improved descriptions and added missing details in parameter sections for better understanding.
- Enhanced readability by standardizing formatting and punctuation in docstrings across `cli.py`, `structure_class.py`, `structure_tree_util.py`, `update_atlases.py`, and `utils.py`.
- Updated module-level docstrings in `metadata_utils.py`, `stacks.py`, `structure_json_to_csv.py`, `structures.py`, `validate_atlases.py`, and `volume_utils.py` to provide clearer context and purpose.
- Improved parameter descriptions and standardized formatting in function docstrings for better readability.
- Added missing details in return sections and raised exceptions to enhance documentation quality.
- Clarified the description of the method to enhance understanding of its functionality.
- Updated parameter and return sections for consistency with the rest of the codebase.
- Added details regarding caching behavior and handling of missing references.
- Updated parameter and return sections to use consistent terminology and formatting.
- Improved descriptions for better understanding of function inputs and outputs.
- Clarified behavior when handling lists of structures in both methods.
@thisisrick25
Copy link
Contributor Author

@alessandrofelder can you review this PR?
I'll be happy to make a new PR if there's something wrong with this current docstring.

@alessandrofelder
Copy link
Member

Sorry @thisisrick25 - I'm sure it's a good PR, I just still (😢) haven't managed to make time for this. It's on my list. Thanks for bearing with.

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.

Update docstring format
4 participants