Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 12 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,37 +121,22 @@ To ensure Meshroom uses your NVIDIA GPU:
5. Under **Select the preferred graphics processor for this program**, choose **High-performance NVIDIA processor**.
6. Click **Apply**.

Version control of database using DVC (Data Version Control)
-------------------------------------------------------------

Data Version Control (DVC) is a data management tool that is meant to be run alongside Git.
In this project, DVC is used to link changes in the code to specific versions of a sample database containing example project files.
DVC can be used when this project is installed in Dev mode. You can read more about DVC and how to use it `here <https://dvc.org/doc/start>`_.
**Note:** Remote access to the sample database stored on google drive is currently restricted. Access requires a :code:`gdrive_client_secret`
for user access authentication to be shared by developers.

DVC usage
~~~~~~~~~

To download the sample database:

.. code:: sh

git pull
dvc remote modify --local shared_gdrive gdrive_client_secret <client_secret_here> # Contact developers for grive_client_secret
dvc pull # Requires access to remote storage
Getting Sample Data
-------------------

This will download a directory 'db_dvc' in the repo directory that
contains the corresponding version of example database files.
A sample database for testing and examples is maintained in the
`openlifu-sample-database <https://github.com/OpenwaterHealth/openlifu-sample-database>`_
repository. Its files are tracked with Git LFS, so first `install Git LFS
<https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage>`_.

To commit updates to the sample database:
Then check out the tagged version of the sample database that is compatible
with this version of ``openlifu``:

.. code:: sh
.. code:: bash

dvc add db_dvc
git commit -m "Describe updates to database"
git push
dvc push #Requires access to remote storage
git clone --depth 1 --branch openlifu-v0.20.0 https://github.com/OpenwaterHealth/openlifu-sample-database.git
cd openlifu-sample-database
git lfs pull

Disclaimer
----------
Expand Down
11 changes: 3 additions & 8 deletions examples/tools/standardize_database.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""This is a utility script for developers to read in and write back out the dvc database.
It is useful for standardizing the format of the example dvc data, and also for checking that the database
"""This is a utility script for developers to read in and write back out an openlifu database.
It is useful for standardizing the format of the example data, and also for checking that the database
mostly still works.

To use this script, install openlifu to a python environment and then run the script providing the database folder as an argument:

```
python standardize_database.py db_dvc/
python standardize_database.py /path/to/openlifu-sample-database
```

A couple of known issues to watch out for:
Expand All @@ -15,15 +15,13 @@
"""
from __future__ import annotations

import logging
import pathlib
import shutil
import sys
import tempfile

from openlifu.db import Database
from openlifu.db.database import OnConflictOpts
from openlifu.xdc import Transducer

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

Expand Down
Loading