Skip to content
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

Reduce duplication 2 #1053

Merged
merged 7 commits into from
Aug 9, 2024
Merged

Reduce duplication 2 #1053

merged 7 commits into from
Aug 9, 2024

Conversation

CBroz1
Copy link
Member

@CBroz1 CBroz1 commented Aug 5, 2024

Description

This PR builds on #1050 after confirmation from @khl02007 that the variable name change of amplitude_thresh -> amplitude_thresh_uV was not due to underlying packages. This moves the following funcs to a utils file...

  • _check_artifact_thresholds
  • _compute_artifact_chunk
  • _init_artifact_worker

This also reduces the line count for both clusterless and spiked versions of get_decoding_data_for_epoch in decoding.v0

I was also able to move the following to utils...

  • git_interval_range - from decoding.v1
  • the majority of get_firing_rate save for the piece that depends on another class method (a good candidate for round 3)

Do the following need to be public functions? If not, I think they can be removed, as they are not called within the codebase

  • spikesorting_merge.get_spike_indicator
  • spikesorting.vX.recording._get_recording_timestamps
  • decoding.v1.X.get_firing_rate
  • Relatedly: linearization.vX.TrackGraph.get_networkx_track_graph: this is a relatively simple func that, if it doesn't need to be public, can probably be merged into calling functions

Checklist:

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

@CBroz1 CBroz1 changed the title Reduce duplication 2: spikesort utils Reduce duplication 2 Aug 8, 2024
@CBroz1 CBroz1 marked this pull request as ready for review August 9, 2024 13:48
@@ -542,24 +503,12 @@ def get_firing_rate(
np.ndarray
time-dependent firing rate with shape (len(time), n_units)
"""
spike_indicator = cls.get_spike_indicator(key, time)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would leave this as it is useful to get the array.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure - I'll remove the comment. Do you feel the same about the others listed in the description?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I would leave them in for now.

@edeno edeno merged commit 04b4995 into LorenFrankLab:master Aug 9, 2024
6 checks passed
CBroz1 added a commit to CBroz1/spyglass that referenced this pull request Aug 12, 2024
CBroz1 added a commit that referenced this pull request Aug 12, 2024
@CBroz1 CBroz1 deleted the sdp branch September 5, 2024 19:21
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.

2 participants