Skip to content

miniscope_report.py

activate(schema_name, miniscope_schema_name, *, create_schema=True, create_tables=True)

Activate this schema.

The "activation" of miniscope_report should be evoked by the miniscope module

Parameters:

Name Type Description Default
schema_name str

schema name on the database server to activate the miniscope_report schema

required
miniscope_schema_name str

schema name of the activated miniscope element for which this miniscope_report schema will be downstream from

required
create_schema bool

when True (default), create schema in the database if it does not yet exist.

True
create_tables str

when True (default), create schema takes in the database if they do not yet exist.

True
Source code in element_miniscope/miniscope_report.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def activate(
    schema_name, miniscope_schema_name, *, create_schema=True, create_tables=True
):
    """Activate this schema.

    The "activation" of miniscope_report should be evoked by the miniscope module

    Args:
        schema_name (str): schema name on the database server to activate the
            `miniscope_report` schema
        miniscope_schema_name (str): schema name of the activated miniscope element for
            which this miniscope_report schema will be downstream from
        create_schema (bool): when True (default), create schema in the database if it
            does not yet exist.
        create_tables (str): when True (default), create schema takes in the database
            if they do not yet exist.
    """
    global miniscope
    miniscope = dj.create_virtual_module("miniscope", miniscope_schema_name)
    schema.activate(
        schema_name,
        create_schema=create_schema,
        create_tables=create_tables,
        add_objects=miniscope.__dict__,
    )