feat: 3-part make for LFP#59
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the LFP processing pipeline by splitting the original "make" method into three distinct methods: "make_fetch", "make_compute", and "make_insert".
- Split the original make function into three parts to separate fetching, computing, and inserting operations.
- Replaced usages of local constants with class attributes (e.g., TARGET_SAMPLING_RATE, POWERLINE_NOISE_FREQ, MAX_DURATION_MINUTES).
Comments suppressed due to low confidence (2)
element_array_ephys/ephys_no_curation.py:412
- The variable 'channels' is used in the 'make_insert' method but is not defined or passed as a parameter. Consider passing 'channels' to 'make_insert' or computing it within this method.
for ch_idx, lfp in zip(channels, all_lfps):
element_array_ephys/ephys_no_curation.py:264
- The method now relies on 'self.MAX_DURATION_MINUTES', 'self.TARGET_SAMPLING_RATE', and 'self.POWERLINE_NOISE_FREQ' instead of local constants; ensure these class attributes are defined to prevent runtime errors.
duration <= self.MAX_DURATION_MINUTES
MilagrosMarin
approved these changes
Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
makemethod inelement_array_ephys/ephys_no_curation.pyto improve modularity and readability by splitting it into three distinct methods:make_fetch,make_compute, andmake_insert. Additionally, it introduces class-level constants for better code organization and replaces hardcoded values with these constants.Refactoring for Modularity:
makemethod into three separate methods:make_fetch: Handles fetching data and returns relevant information, such as file paths, LFP indices, probe information, and electrode data. [1] [2]make_compute: Processes the fetched data to compute broadband LFP signals for each electrode, including filtering and downsampling. Returns computed LFP signals and mapping data.make_insert: Inserts computed data and metadata into the database, ensuring separation of concerns.