Skip to content

process.py

run(verbose=True, display_progress=True, reserve_jobs=False, suppress_errors=False)

Run all make methods from Element Miniscope

Parameters:

Name Type Description Default
verbose bool

Print which table is in being populated. Default True.

True
display_progress bool

tqdm progress bar. Defaults to True.

True
reserve_jobs bool

Reserves job to populate in asynchronous fashion. Defaults to False.

False
suppress_errors bool

Suppress errors that would halt execution. Defaults to False.

False
Source code in workflow_miniscope/process.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def run(
    verbose: bool = True,
    display_progress: bool = True,
    reserve_jobs: bool = False,
    suppress_errors: bool = False,
):
    """Run all `make` methods from Element Miniscope

    Args:
        verbose (bool, optional): Print which table is in being populated. Default True.
        display_progress (bool, optional): tqdm progress bar. Defaults to True.
        reserve_jobs (bool, optional): Reserves job to populate in asynchronous fashion.
            Defaults to False.
        suppress_errors (bool, optional): Suppress errors that would halt execution.
            Defaults to False.
    """
    populate_settings = {
        "display_progress": display_progress,
        "reserve_jobs": reserve_jobs,
        "suppress_errors": suppress_errors,
    }

    tables = [
        miniscope.RecordingInfo(),
        miniscope.Processing(),
        miniscope.MotionCorrection(),
        miniscope.Segmentation(),
        miniscope.Fluorescence(),
        miniscope.Activity(),
    ]

    with nullcontext() if verbose else QuietStdOut():
        for table in tables:
            logger.info(f"---- Populating {to_camel_case(table.table_name)} ----")
            table.populate(**populate_settings)
        logger.info("---- Successfully completed miniscope/populate.py ----")