-
Notifications
You must be signed in to change notification settings - Fork 52
Make sure parent directory exists in decoding #1362
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1362 +/- ##
==========================================
+ Coverage 69.66% 69.71% +0.05%
==========================================
Files 103 103
Lines 12532 12539 +7
==========================================
+ Hits 8730 8742 +12
+ Misses 3802 3797 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where decoding operations could fail if the results directory doesn't exist by ensuring parent directories are created before saving output files. This addresses issue #1358 and improves the reliability of the decoding modules.
Key changes:
- Added directory creation logic in both clusterless and sorted spikes decoding modules
- Refactored path construction to use a shared
results_dirvariable for better maintainability - Updated changelog to document the fix
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/spyglass/decoding/v1/sorted_spikes.py | Added results directory creation and refactored path construction in the make method |
| src/spyglass/decoding/v1/clusterless.py | Added results directory creation and refactored path construction in the make method |
| CHANGELOG.md | Added entry documenting the decoding directory creation fix |
Description
Fixes #1358
This pull request ensures that the results directory is created if it doesn't already exist before saving output files in both the clusterless and sorted spikes decoding modules. This change improves reliability by preventing errors when writing results to non-existent directories.
Directory creation improvements:
src/spyglass/decoding/v1/clusterless.py, themakemethod now creates the results directory usingPath(config["SPYGLASS_ANALYSIS_DIR"]) / nwb_file_namebefore generating and saving results files.src/spyglass/decoding/v1/sorted_spikes.py, themakemethod similarly ensures the results directory exists before saving results.Checklist:
CITATION.cffaltersnippet for release notes.CHANGELOG.mdwith PR number and description.