|
| 1 | +`t4sanity` performs sanity checks on T4 datasets, reporting any issues in a structured format. |
| 2 | +It checks the dataset directories and versions, tries to load them using the `Tier4` library, and reports any exceptions or warnings. |
| 3 | + |
| 4 | +```shell |
| 5 | +$ t4sanity -h |
| 6 | + |
| 7 | + Usage: t4sanity [OPTIONS] DB_PARENT |
| 8 | + |
| 9 | +╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 10 | +│ * db_parent TEXT Path to parent directory of the databases [default: None] [required] │ |
| 11 | +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 12 | +╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ |
| 13 | +│ --version -v Show the application version and exit. │ |
| 14 | +│ --include-warning -iw Indicates whether to report any warnings. │ |
| 15 | +│ --install-completion Install completion for the current shell. │ |
| 16 | +│ --show-completion Show completion for the current shell, to copy it or customize the installation. │ |
| 17 | +│ --help -h Show this message and exit. │ |
| 18 | +╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
| 19 | +``` |
| 20 | + |
| 21 | +## Shell Completion |
| 22 | + |
| 23 | +Run the following command to install completion, and reload shell. |
| 24 | + |
| 25 | +```{ .shell .copy } |
| 26 | +t4sanity --install-completion |
| 27 | +``` |
| 28 | + |
| 29 | +## Usages |
| 30 | + |
| 31 | +As an example, we have the following the dataset structure: |
| 32 | + |
| 33 | +```shell |
| 34 | +<DATA_ROOT> |
| 35 | +├── dataset1 |
| 36 | +│ └── <VERSION> |
| 37 | +│ ├── annotation |
| 38 | +│ ├── data |
| 39 | +| ... |
| 40 | +├── dataset2 |
| 41 | +│ ├── annotation |
| 42 | +│ ├── data |
| 43 | +| ... |
| 44 | +... |
| 45 | +``` |
| 46 | + |
| 47 | +### Exclude Warnings |
| 48 | + |
| 49 | +To run sanity check ignoring warnings, providing the path to the parent directory of the datasets: |
| 50 | + |
| 51 | +```shell |
| 52 | +$ t4sanity <DATA_ROOT> |
| 53 | + |
| 54 | +>>> Sanity checking...: 97it [00:03, 26.60it/s] |
| 55 | ++--------------------------------------+---------+------------------------------------------------------------------------------------------------+ |
| 56 | +| DatasetID | Version | Message | |
| 57 | ++--------------------------------------+---------+------------------------------------------------------------------------------------------------+ |
| 58 | +| 96200480-ae59-44cb-9e4e-dd9021e250e8 | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) | |
| 59 | +| ca346afb-ea1a-4c5c-8117-544bd9ff6aca | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222) | |
| 60 | +... |
| 61 | +``` |
| 62 | + |
| 63 | +### Include Warnings |
| 64 | + |
| 65 | +To run sanity check and report any warnings, use the `-iw; --include-warning` option: |
| 66 | + |
| 67 | +```shell |
| 68 | +$ t4sanity <DATA_ROOT> -iw |
| 69 | + |
| 70 | +>>> Sanity checking...: 97it [00:03, 29.31it/s] |
| 71 | ++--------------------------------------+---------+------------------------------------------------------------------------------------------------+ |
| 72 | +| DatasetID | Version | Message | |
| 73 | ++--------------------------------------+---------+------------------------------------------------------------------------------------------------+ |
| 74 | +| 96200480-ae59-44cb-9e4e-dd9021e250e8 | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) | |
| 75 | +| ca346afb-ea1a-4c5c-8117-544bd9ff6aca | 2 | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222) | |
| 76 | +| ed96b707-e7f4-4a71-9e6b-571ffd56c4c4 | 2 | level: Not available is not supported, Visibility.UNAVAILABLE will be assigned. | |
| 77 | +... |
| 78 | +``` |
0 commit comments