populate_all_common.py
log_insert_error(table, err, error_constants=None)
¶
Log a given error to the InsertError table.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
table |
str
|
The table name where the error occurred. |
required |
err |
Exception
|
The exception that was raised. |
required |
error_constants |
dict
|
Dictionary with keys for dj_user, connection_id, and nwb_file_name. Defaults to checking dj.conn and using "Unknown" for nwb_file_name. |
None
|
Source code in src/spyglass/common/populate_all_common.py
single_transaction_make(tables, nwb_file_name, raise_err=False, error_constants=None)
¶
For each table, run the make
method directly instead of populate
.
Requires allow_direct_insert
set to True within each method. Uses
nwb_file_name search table key_source for relevant key. Currently assumes
all tables will have exactly one key_source entry per nwb file.
Source code in src/spyglass/common/populate_all_common.py
populate_all_common(nwb_file_name, rollback_on_fail=False, raise_err=False)
¶
Insert all common tables for a given NWB file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nwb_file_name |
str
|
The name of the NWB file to populate. |
required |
rollback_on_fail |
bool
|
If True, will delete the Session entry if any errors occur. Defaults to False. |
False
|
raise_err |
bool
|
If True, will raise any errors that occur during population. Defaults to False. This will prevent any rollback from occurring. |
False
|
Returns:
Type | Description |
---|---|
List
|
A list of keys for InsertError entries if any errors occurred. |