Skip to content

Fix docstring inconsistencies and add type annotations#2

Open
antoinegaston wants to merge 6 commits intomasterfrom
fix-docstring-inconsistencies
Open

Fix docstring inconsistencies and add type annotations#2
antoinegaston wants to merge 6 commits intomasterfrom
fix-docstring-inconsistencies

Conversation

@antoinegaston
Copy link
Copy Markdown
Collaborator

@antoinegaston antoinegaston commented Jun 4, 2025

Fix docstring inconsistencies and add type annotations across InMoose codebase

This PR addresses several docstring inconsistencies found in the InMoose codebase and adds comprehensive type annotations to improve documentation quality and ensure consistency between function signatures and docstrings.

Changes Made

1. Fixed inmoose/pycombat/pycombat_seq.py

  • Parameter name consistency: Fixed docstring to refer to counts parameter instead of the incorrect data parameter
  • Return type description: Corrected the return type description to properly reference the input parameter name
  • Parameter descriptions: Added missing default values and improved parameter descriptions
  • Type annotations: Added comprehensive type annotations using typing.Union, typing.Optional, and typing.Any

2. Fixed inmoose/diffexp/meta.py

  • Parameter types: Added "optional" specification to optional parameters
  • Default values: Clarified default value documentation
  • Return type consistency: Improved return type descriptions to match actual function behavior
  • Type annotations: Added type annotations for all parameters and return types using typing.List, typing.Optional

3. Fixed inmoose/utils/factor.py

  • Missing parameters: Added missing parameter documentation for the __init__ method
  • Docstring formatting: Improved overall formatting and consistency of docstrings
  • Method descriptions: Enhanced method descriptions to be more precise and informative
  • Type annotations: Added comprehensive type annotations for all methods including forward references for self-referencing types

Technical Improvements

Type Annotations Added

  • Function signatures: All public functions now have proper type annotations
  • Parameter types: Clear typing for complex parameter types (Union, Optional, List, etc.)
  • Return types: Explicit return type annotations
  • Import statements: Added necessary typing imports

Documentation Quality

  • Consistency: All docstrings now follow consistent formatting
  • Completeness: All parameters are documented with their types and default values
  • Accuracy: Parameter names in docstrings match actual function signatures

Impact

These changes improve:

  • Code readability: Better type hints for IDE support and developer experience
  • Documentation quality: Consistent and accurate docstrings
  • Maintainability: Clear parameter and return types reduce confusion
  • Development experience: Better IDE autocomplete and type checking support

Testing

The changes maintain backward compatibility as they only update documentation and add type annotations without changing functionality. All existing code should continue to work as expected.


This PR is part of ongoing efforts to improve the InMoose codebase documentation and developer experience.

@antoinegaston antoinegaston changed the title Fix docstring inconsistencies across InMoose codebase Fix docstring inconsistencies and add type annotations Jun 4, 2025
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