Skip to content

Conversation

@CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Nov 19, 2025

Checklist:

  • N/a. If this PR should be accompanied by a release, I have updated the CITATION.cff
  • N/a. If this PR edits table definitions, I have included an alter snippet for release notes.
  • N/a. If this PR makes changes to position, I ran the relevant tests locally.
  • N/a. If this PR makes user-facing changes, I have added/edited docs/notebooks to reflect the changes
  • I have updated the CHANGELOG.md with PR number and description.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.13%. Comparing base (b17c225) to head (ee03a16).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1467      +/-   ##
==========================================
- Coverage   71.35%   71.13%   -0.23%     
==========================================
  Files         114      114              
  Lines       13282    13308      +26     
==========================================
- Hits         9477     9466      -11     
- Misses       3805     3842      +37     
Flag Coverage Δ
full-tests 71.13% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CBroz1 CBroz1 marked this pull request as ready for review November 19, 2025 17:39
@edeno edeno requested review from Copilot and edeno November 19, 2025 18:06
Copy link
Collaborator

@edeno edeno left a comment

Choose a reason for hiding this comment

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

Pending conflict resolution

Copilot finished reviewing on behalf of edeno November 19, 2025 18:11
Copy link
Contributor

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.

Pull Request Overview

This PR refactors the ClusterlessDecodingV1.make method into a tripartite structure (make_fetch, make_compute, make_insert) to separate concerns and improve code organization. This pattern allows for better modularity and follows a similar approach used in other Spyglass tables like SpikeSortingRecording.

  • Split the monolithic make method into three focused methods for fetching data, performing computation, and inserting results
  • Improved parameter handling by using .get() with defaults instead of direct dictionary unpacking
  • Simplified interval fetching with the dict(nwb_dict, ...) merging pattern

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/spyglass/decoding/v1/clusterless.py Refactored make into make_fetch, make_compute, and make_insert methods; removed unused copy import; improved parameter handling and interval fetching patterns
CHANGELOG.md Added entry documenting the tripartite make refactoring for ClusterlessDecodingV1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

decoding_kwargs = decoding_kwargs or {}

decoding_params = model_params.get("decoding_params", dict())
decoding_kwargs = model_params.get("decoding_kwargs", dict())
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

Potential bug: Using .get("decoding_kwargs", dict()) will return None if the key exists in model_params but has value None, whereas the original code used decoding_kwargs or {} to convert None to an empty dict. This could cause issues if decoding_kwargs is explicitly None in the database (e.g., when checking if "is_training" not in decoding_kwargs on line 149).

To match the original behavior:

decoding_params = model_params.get("decoding_params") or {}
decoding_kwargs = model_params.get("decoding_kwargs") or {}

Or alternatively:

decoding_kwargs = model_params.get("decoding_kwargs", dict()) or {}
Suggested change
decoding_kwargs = model_params.get("decoding_kwargs", dict())
decoding_kwargs = model_params.get("decoding_kwargs") or {}

Copilot uses AI. Check for mistakes.
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