Skip to content

Add comprehensive docstrings to enable automatic documentation generation#1

Merged
HernandoMV merged 2 commits intohmv_devfrom
copilot/fix-ff280ec4-8fb7-459b-a2bb-69f28d1d90b5
Aug 21, 2025
Merged

Add comprehensive docstrings to enable automatic documentation generation#1
HernandoMV merged 2 commits intohmv_devfrom
copilot/fix-ff280ec4-8fb7-459b-a2bb-69f28d1d90b5

Conversation

Copy link
Contributor

Copilot AI commented Aug 21, 2025

This PR addresses the issue where automatic documentation generation was failing due to missing or inadequate function docstrings throughout the repository.

Changes Made

Fixed Documentation Infrastructure

  • Corrected API index: Replaced non-existent placeholder modules (math, greetings) with actual modules (utils, df_transforms, plots, figure_maker, generate_fake_dataset)
  • Fixed import issues: Corrected relative import in generate_fake_dataset.py
  • Installed dependencies: Added required packages (numpy, pandas, matplotlib, etc.) for successful module imports
  • Removed non-existent functions: Cleaned up references to functions that don't exist

Added Comprehensive Docstrings

Added detailed NumPy/Google-style docstrings to 25+ key functions across all modules:

utils.py (15 functions):

  • Performance calculation functions (get_session_performance, get_day_performance, etc.)
  • Data validation utilities (column_checker)
  • Text summary generators (get_text_from_subset_df, get_text_from_subject_df)
  • Data loading utilities (load_example_data, get_outpath)
  • Statistical analysis functions (get_right_bias, get_block_size_truncexp_mean30)

df_transforms.py (8 functions):

  • Data preprocessing (fill_missing_data, get_dates_df, get_water_df)
  • Behavioral analysis (get_repeat_or_alternate_series, get_performance_by_difficulty)
  • Data transformation utilities (add_auditory_real_statistics)

plots.py (3 functions):

  • Visualization utilities (training_calendar_plot, rasterize_plot, summary_text_plot)

figure_maker.py (2 functions):

  • High-level figure generation (subject_progress_figure, session_summary_figure)

Documentation Quality

Each docstring now includes:

  • Clear description of function purpose
  • Complete parameter documentation with types
  • Return value specifications
  • Error conditions and exceptions
  • Usage notes and implementation details
  • Professional formatting following NumPy documentation standards

Verification

  • ✅ Sphinx documentation builds successfully with minimal warnings
  • ✅ All modules can be imported without errors
  • ✅ Auto-generated API documentation displays properly
  • ✅ Function signatures and descriptions appear correctly in HTML output

The automatic documentation system now works as intended, providing comprehensive API reference for all public functions in the behavioral analysis package.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@HernandoMV HernandoMV marked this pull request as ready for review August 21, 2025 08:58
Copilot AI review requested due to automatic review settings August 21, 2025 08:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: HernandoMV <6049065+HernandoMV@users.noreply.github.com>
@HernandoMV HernandoMV merged commit 9a2e97f into hmv_dev Aug 21, 2025
Copilot AI changed the title [WIP] I want you to properly document all the functions in this repository so that the automatic documentation works Add comprehensive docstrings to enable automatic documentation generation Aug 21, 2025
Copilot AI requested a review from HernandoMV August 21, 2025 09:10
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.

3 participants