Skip to content

feat: 3-part make for LFP#59

Merged
MilagrosMarin merged 2 commits into
mainfrom
dev_three-part-make-lfp
Jun 6, 2025
Merged

feat: 3-part make for LFP#59
MilagrosMarin merged 2 commits into
mainfrom
dev_three-part-make-lfp

Conversation

@ttngu207
Copy link
Copy Markdown

@ttngu207 ttngu207 commented Jun 6, 2025

This pull request refactors the make method in element_array_ephys/ephys_no_curation.py to improve modularity and readability by splitting it into three distinct methods: make_fetch, make_compute, and make_insert. Additionally, it introduces class-level constants for better code organization and replaces hardcoded values with these constants.

Refactoring for Modularity:

  • Split the original make method 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.

@ttngu207 ttngu207 requested review from MilagrosMarin and Copilot June 6, 2025 17:29
Copy link
Copy Markdown

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 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 MilagrosMarin merged commit 05cd8d9 into main Jun 6, 2025
1 of 6 checks passed
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