Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Nov 20, 2024
1 parent f2b5982 commit e01821d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()
- Improve electrodes import efficiency #1125
- Fix logger method call in `common_task` #1132
- Export fixes #1164
- Allow `get_abs_path` to add selection entry.
- Log restrictions and joins.
- Allow `get_abs_path` to add selection entry. #1164
- Log restrictions and joins. #1164
- Check if querying table inherits mixin in `fetch_nwb`. #XXXX
- Error specificity in `LabMemberInfo` #XXXX

- Decoding
Expand Down
14 changes: 11 additions & 3 deletions src/spyglass/utils/dj_helper_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from datajoint.table import Table
from datajoint.user_tables import TableMeta, UserTable

from spyglass.utils.dj_mixin import SpyglassMixin
from spyglass.utils.logging import logger
from spyglass.utils.nwb_helper_fn import file_from_dandi, get_nwb_file

Expand Down Expand Up @@ -234,11 +235,18 @@ def get_nwb_table(query_expression, tbl, attr_name, *attrs, **kwargs):
}
file_name_str, file_path_fn = tbl_map[which]

# logging arg only if instanced table inherits Mixin
inst = ( # instancing may not be necessary
query_expression()
if isinstance(query_expression, type)
and issubclass(query_expression, dj.Table)
else query_expression
)
arg = dict(log_export=False) if isinstance(inst, SpyglassMixin) else dict()

# TODO: check that the query_expression restricts tbl - CBroz
nwb_files = (
query_expression.join(
tbl.proj(nwb2load_filepath=attr_name), log_export=False
)
query_expression.join(tbl.proj(nwb2load_filepath=attr_name), **arg)
).fetch(file_name_str)

# Disabled #1024
Expand Down

0 comments on commit e01821d

Please sign in to comment.