Skip to content

Commit 16edf45

Browse files
committed
Fix black formatting in dataset and test files
https://claude.ai/code/session_01ManyQhMJJszw7Euj7V31Z1
1 parent ad245e7 commit 16edf45

2 files changed

Lines changed: 10 additions & 21 deletions

File tree

src/ndi/dataset/_dataset.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ def add_linked_session(self, session: Any) -> Dataset:
115115
existing = self._find_session_doc(session.id())
116116
if existing is not None:
117117
raise ValueError(
118-
f"Session with id {session.id()} is already part of "
119-
f"dataset {self.id()}."
118+
f"Session with id {session.id()} is already part of " f"dataset {self.id()}."
120119
)
121120

122121
# Create session_in_a_dataset document
@@ -148,8 +147,7 @@ def add_ingested_session(self, session: Any) -> Dataset:
148147
existing = self._find_session_doc(session.id())
149148
if existing is not None:
150149
raise ValueError(
151-
f"Session with id {session.id()} is already part of "
152-
f"dataset {self.id()}."
150+
f"Session with id {session.id()} is already part of " f"dataset {self.id()}."
153151
)
154152

155153
# Check if session is fully ingested
@@ -206,10 +204,7 @@ def unlink_session(
206204

207205
doc = self._find_session_doc(session_id)
208206
if doc is None:
209-
raise ValueError(
210-
f"Session with ID {session_id} not found in "
211-
f"dataset {self.id()}."
212-
)
207+
raise ValueError(f"Session with ID {session_id} not found in " f"dataset {self.id()}.")
213208

214209
props = doc.document_properties.get("session_in_a_dataset", {})
215210
if not props.get("is_linked", False):
@@ -292,16 +287,12 @@ def session_list(
292287

293288
# Find the dataset's own session document
294289
dataset_session_doc_id = ""
295-
q_ds = Query("").isa("session") & (
296-
Query("base.session_id") == self.id()
297-
)
290+
q_ds = Query("").isa("session") & (Query("base.session_id") == self.id())
298291
ds_docs = self._session.database_search(q_ds)
299292
if len(ds_docs) == 1:
300293
dataset_session_doc_id = ds_docs[0].id
301294
elif len(ds_docs) > 1:
302-
raise ValueError(
303-
"More than 1 session document for the dataset session found."
304-
)
295+
raise ValueError("More than 1 session document for the dataset session found.")
305296

306297
return ref_list, id_list, session_doc_ids, dataset_session_doc_id
307298

@@ -392,9 +383,7 @@ def delete_ingested_session(
392383

393384
doc = self._find_session_doc(session_id)
394385
if doc is None:
395-
raise ValueError(
396-
f"Session {session_id} not found in dataset."
397-
)
386+
raise ValueError(f"Session {session_id} not found in dataset.")
398387

399388
props = doc.document_properties.get("session_in_a_dataset", {})
400389
if props.get("is_linked", False):

tests/matlab_tests/test_dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,7 @@ def test_session_list_outputs(self, build_dataset):
180180
assert refs[0] == "exp_demo", "Session reference should match expected value"
181181

182182
# 2. Verify session_id
183-
assert (
184-
session_ids[0] == session.id()
185-
), "Session ID should match the ingested session ID"
183+
assert session_ids[0] == session.id(), "Session ID should match the ingested session ID"
186184

187185
# 3. Verify the session_in_a_dataset document exists and is correct
188186
q = Query("").isa("session_in_a_dataset")
@@ -261,7 +259,9 @@ def test_delete_not_confirmed(self, build_dataset):
261259

262260
# Verify session still exists
263261
refs, session_ids, *_ = dataset.session_list()
264-
assert session_id in session_ids, "Session ID should still be in dataset after failed delete"
262+
assert (
263+
session_id in session_ids
264+
), "Session ID should still be in dataset after failed delete"
265265

266266
def test_delete_linked_session_error(self, build_dataset, tmp_path):
267267
"""Deleting a linked session raises ValueError.

0 commit comments

Comments
 (0)