Skip to content

Commit a7cd5ae

Browse files
Raise exception in unimplemented db methods
Issue #79
1 parent 0efbc2c commit a7cd5ae

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/openlifu/db/database.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ def add_volume(self, subject, volume, on_conflict="error"):
200200

201201
def choose_session(self, subject, options=None):
202202
# Implement the logic to choose a session
203-
pass
203+
raise NotImplementedError("Method not yet implemented")
204204

205205
def choose_subject(self, options=None):
206206
# Implement the logic to choose a subject
207-
pass
207+
raise NotImplementedError("Method not yet implemented")
208208

209209
def get_gridweight_hashes(self, transducer_id):
210210
transducer_dir = os.path.join(self.path, 'transducers', transducer_id)
@@ -213,15 +213,15 @@ def get_gridweight_hashes(self, transducer_id):
213213

214214
def get_session_table(self, subject_id, options=None):
215215
# Implement the logic to get session table
216-
pass
216+
raise NotImplementedError("Method not yet implemented")
217217

218218
def get_subject_table(self, options=None):
219219
# Implement the logic to get subject table
220-
pass
220+
raise NotImplementedError("Method not yet implemented")
221221

222222
def load_session_solutions(self, session, options=None):
223223
# Implement the logic to load session solutions
224-
pass
224+
raise NotImplementedError("Method not yet implemented")
225225

226226
def get_connected_systems(self):
227227
connected_system_filename = self.get_connected_system_filename()
@@ -315,6 +315,7 @@ def get_system_ids(self):
315315
return []
316316

317317
def get_system_info(self, sys_id):
318+
raise NotImplementedError("UltrasoundSystem is not yet implemented")
318319
system_filename = self.get_system_filename(sys_id)
319320

320321
if os.path.isfile(system_filename):
@@ -355,11 +356,13 @@ def load_subject(self, subject_id, options=None):
355356
return subject
356357

357358
def load_volume(self, subject, volume_id):
359+
raise NotImplementedError("Volume is not yet implemented")
358360
volume_filename = self.get_volume_filename(subject.id, volume_id)
359361
volume = Volume.from_file(volume_filename)
360362
return volume
361363

362364
def load_volume_attrs(self, subject, volume_ids=None):
365+
raise NotImplementedError("Volume is not yet implemented")
363366
volume_ids = volume_ids or subject.volumes
364367
attrs = []
365368
for volume_id in volume_ids:
@@ -369,11 +372,13 @@ def load_volume_attrs(self, subject, volume_ids=None):
369372
return attrs
370373

371374
def load_standoff(self, transducer_id, standoff_id="standoff"):
375+
raise NotImplementedError("Standoff is not yet implemented")
372376
standoff_filename = self.get_standoff_filename(transducer_id, standoff_id)
373377
standoff = Standoff.from_file(standoff_filename)
374378
return standoff
375379

376380
def load_system(self, sys_id=None):
381+
raise NotImplementedError("UltrasoundSystem is not yet implemented")
377382
sys_id = sys_id or self.get_connected_systems()
378383
sys_filename = self.get_system_filename(sys_id)
379384
sys = UltrasoundSystem.from_file(sys_filename)
@@ -386,6 +391,7 @@ def load_transducer(self, transducer_id):
386391
return transducer
387392

388393
def load_transducer_standoff(self, trans, coords, options=None):
394+
raise NotImplementedError("Standoff is not yet implemented")
389395
options = options or {}
390396
standoff_filename = self.get_standoff_filename(trans.id, "standoff_anchors")
391397
standoff = Standoff.from_file(standoff_filename)
@@ -419,6 +425,7 @@ def load_all_protocols(self):
419425
raise FileNotFoundError("Protocols file not found.")
420426

421427
def load_session(self, subject, session_id, options=None):
428+
raise NotImplementedError("Session.from_file is not yet implemented")
422429
if options is None:
423430
options = {}
424431
session_filename = self.get_session_filename(subject.id, session_id)

0 commit comments

Comments
 (0)