Skip to content

Commit 8cd9f91

Browse files
authored
Small fixes (#1256)
* improve error message for 1253 * fix fetch_nwb in Nwbfile per 1243 * update changelog * lint update
1 parent 770f4cf commit 8cd9f91

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
- Update export process to include `~external` tables #1239
1212
- Only add merge parts to `source_class_dict` if present in codebase #1237
1313
- Remove cli module #1250
14+
- Fix column error in `check_threads` method #1256
1415

1516
### Pipelines
1617

1718
- Common
1819
- Set `probe_id` as `probe_description` when inserting from nwb file #1220
1920
- Default `AnalysisNwbfile.create` permissions are now 777 #1226
21+
- Make `Nwbfile.fetch_nwb` functional # 1256
2022
- Position
2123
- Allow population of missing `PositionIntervalMap` entries during population
2224
of `DLCPoseEstimation` #1208

docs/src/api/make_pages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Generate the api pages and navigation.
2-
"""
1+
"""Generate the api pages and navigation."""
32

43
from pathlib import Path
54

src/spyglass/common/common_nwbfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ def insert_from_relative_file_name(cls, nwb_file_name: str) -> None:
7575
key["nwb_file_abs_path"] = nwb_file_abs_path
7676
cls.insert1(key, skip_duplicates=True)
7777

78+
def fetch_nwb(self):
79+
return [
80+
get_nwb_file(self.get_abs_path(file))
81+
for file in self.fetch("nwb_file_name")
82+
]
83+
7884
@classmethod
7985
def _get_file_name(cls, nwb_file_name: str) -> str:
8086
"""Get valid nwb file name given substring."""

src/spyglass/utils/dj_mixin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ def _nwb_table_tuple(self) -> tuple:
167167
168168
Used to determine fetch_nwb behavior. Also used in Merge.fetch_nwb.
169169
Implemented as a cached_property to avoid circular imports."""
170-
from spyglass.common.common_nwbfile import ( # noqa F401
170+
from spyglass.common.common_nwbfile import (
171171
AnalysisNwbfile,
172172
Nwbfile,
173-
)
173+
) # noqa F401
174174

175175
table_dict = {
176176
AnalysisNwbfile: "analysis_file_abs_path",
@@ -408,7 +408,7 @@ def _check_delete_permission(self) -> None:
408408
if None in experimenters:
409409
raise PermissionError(
410410
"Please ensure all Sessions have an experimenter in "
411-
+ f"SessionExperimenter:\n{sess_summary}"
411+
+ f"Session.Experimenter:\n{sess_summary}"
412412
)
413413

414414
user_name = LabMember().get_djuser_name(dj_user)
@@ -841,8 +841,8 @@ def check_threads(self, detailed=False, all_threads=False) -> DataFrame:
841841
"Connection ID", # t.PROCESSLIST_ID -- User connection ID
842842
"User", # t.PROCESSLIST_USER -- User
843843
"Host", # t.PROCESSLIST_HOST -- User machine
844-
"Process Database", # t.PROCESSLIST_DB -- Thread database
845844
"Time (s)", # t.PROCESSLIST_TIME -- Time in seconds
845+
"Process Database", # t.PROCESSLIST_DB -- Thread database
846846
"Process", # t.PROCESSLIST_COMMAND -- Likely Query
847847
"State", # t.PROCESSLIST_STATE
848848
"Query", # t.PROCESSLIST_INFO -- Actual query

0 commit comments

Comments
 (0)