Skip to content

Commit 683855f

Browse files
Include TransducerArrays in standardize_database script (#337)
Removes the stale TransducerArray skip. Since openlifu-python commit cbd521b introduced TransducerArray with its own to_file, and Database.write_transducer is type-agnostic and just calls transducer.to_file(...), the skip is no longer needed.
1 parent 5bcb50b commit 683855f

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

examples/tools/standardize_database.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
"""This is a utility script for developers to read in and write back out the dvc database.
2-
It is useful for standardizing the format of the example dvc data, and also for checking that the database
1+
"""This is a utility script for developers to read in and write back out an openlifu database.
2+
It is useful for standardizing the format of the example data, and also for checking that the database
33
mostly still works.
44
55
To use this script, install openlifu to a python environment and then run the script providing the database folder as an argument:
66
77
```
8-
python standardize_database.py db_dvc/
8+
python standardize_database.py /path/to/openlifu-sample-database
99
```
1010
1111
A couple of known issues to watch out for:
@@ -15,15 +15,13 @@
1515
"""
1616
from __future__ import annotations
1717

18-
import logging
1918
import pathlib
2019
import shutil
2120
import sys
2221
import tempfile
2322

2423
from openlifu.db import Database
2524
from openlifu.db.database import OnConflictOpts
26-
from openlifu.xdc import Transducer
2725

2826
if len(sys.argv) != 2:
2927
raise RuntimeError("Provide exactly one argument: the path to the database folder.")
@@ -38,9 +36,6 @@
3836
db.write_transducer_ids(db.get_transducer_ids())
3937
for transducer_id in db.get_transducer_ids():
4038
transducer = db.load_transducer(transducer_id, convert_array=False)
41-
if not isinstance(transducer, Transducer):
42-
logging.warning(f"Skipping {transducer_id} because TransducerArray writing is not supported.")
43-
continue
4439
assert transducer_id == transducer.id
4540
db.write_transducer(transducer, on_conflict=OnConflictOpts.OVERWRITE)
4641

0 commit comments

Comments
 (0)