Document CLI and harden parsing behaviors#14
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
This PR documents the CLI entrypoint, hardens parsing behaviors, and aligns package metadata with Python 3.9+ requirements. It includes a critical bug fix for mouse exclusion logic and introduces robust path/filename parsing utilities.
Changes:
- Added CLI module with basic entrypoint structure for future expansion
- Refactored path parsing to use regex-based pattern matching instead of brittle index-based splitting
- Fixed critical bug where
mouse_ids_to_removeparameter kept excluded mice instead of removing them - Hardened SEM calculation to return NaN for edge cases (arrays with ≤1 elements)
- Updated Python version requirement to 3.9+ and modernized type hints to use PEP 585 style
- Cleaned up package exports in
__all__and moved pytest-mock to dev dependencies - Added comprehensive test coverage for new and modified functionality
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_package_exports.py |
New tests validating __all__ exports exist and are unique |
tests/test_fiber_photometry.py |
Added tests for process_block_path and process_all_blocks with improved mocking |
tests/test_data_processing.py |
Added tests for mouse exclusion, filename parsing validation, and path parsing errors |
tests/test_data_loading.py |
Added tests for absolute path handling and missing day/cohort validation |
tests/test_cli.py |
New tests for CLI help output and invalid argument handling |
spout_mouse/cli.py |
New CLI module with basic argument parser and main entrypoint |
spout_mouse/data_loading.py |
Refactored to use regex-based extract_day_and_cohort_from_path() function |
spout_mouse/data_processing.py |
Fixed mouse exclusion bug, added _extract_mouse_id_from_filename() with validation |
spout_mouse/analysis.py |
Added edge case handling for SEM calculation when array length ≤1 |
spout_mouse/__init__.py |
Removed internal API functions and GOOGLE_SHEET_URL from __all__ exports |
setup.cfg |
Updated Python version classifiers to 3.9-3.11, moved pytest-mock to dev extras |
requirements.txt |
Removed pytest-mock (now in dev dependencies only) |
.github/workflows/pytest.yml |
Updated to Python 3.11 and install dev dependencies with editable mode |
README.md |
Added CLI section, updated get_experiment_data example, removed non-existent function references |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex fix failing tests |
|
To use Codex here, create an environment for this repo. |
1 similar comment
|
To use Codex here, create an environment for this repo. |
Fix failing tests: normalize group dtype and add local `mocker` fixture
Codex-generated pull request
Summary
Testing