Skip to content

feat: add CLI for sanity check#155

Merged
ktro2828 merged 7 commits into
mainfrom
feat/cli/sanity-check
May 26, 2025
Merged

feat: add CLI for sanity check#155
ktro2828 merged 7 commits into
mainfrom
feat/cli/sanity-check

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

What

This PR adds CLI that performs sanity check and reports exceptions and warnings encountered while loading T4 dataset.

Sample

$ t4sanity <DATA_ROOT>

>>> Sanity checking...: 97it [00:03, 26.60it/s]
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
|              DatasetID               | Version |                                            Message                                             |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| 96200480-ae59-44cb-9e4e-dd9021e250e8 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) |
| ca346afb-ea1a-4c5c-8117-544bd9ff6aca |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222)  |
| 7a095434-2916-4533-9c1b-01965fabe9cd |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1649, 628, 1440, 752) |
| 513da928-ae1c-4629-85b5-a9bf34169a0a |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1537, 159, 1440, 208) |
| e9f6ab6b-f779-4dd5-9fc5-14e5fabd265c |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1450, 162, 1440, 308) |
| 44bdcf66-c35e-430f-af34-70c503ecf62c |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1442, 186, 1440, 471) |
| 4ea652e7-76d5-4240-adb5-9d4ecac25eae |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1532, 198, 1440, 265) |
| 6d038cea-92df-43a5-a805-febf74086a57 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1899, 130, 1440, 197) |
| 6640582e-5d08-4e06-8ea2-d764b443a3c6 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1477, 205, 1440, 345) |
| a81a5d0a-e7c3-4ace-a331-94656a84214f |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1761, 824, 1440, 902) |
| 8034d7b5-df2f-442e-a7be-da984c6e0c2e |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1593, 154, 1440, 274) |
| 53d20443-cfaf-4199-be9a-e941f2f47e6f |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1685, 582, 1440, 730) |
| 40efb087-083c-48ec-885a-14991598b551 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1546, 645, 1440, 771) |
| d0c20918-dc89-4b30-b657-ceeb2103c826 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1580, 230, 1440, 379) |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+

To report including warnings, run with the -iw; --include-warning option:

$ t4sanity <DATA_ROOT> -iw

>>> Sanity checking...: 97it [00:03, 29.31it/s]
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
|              DatasetID               | Version |                                            Message                                             |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+
| 96200480-ae59-44cb-9e4e-dd9021e250e8 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1671, 198, 1440, 229) |
| ca346afb-ea1a-4c5c-8117-544bd9ff6aca |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1793, 99, 1440, 222)  |
| 7a095434-2916-4533-9c1b-01965fabe9cd |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1649, 628, 1440, 752) |
| 513da928-ae1c-4629-85b5-a9bf34169a0a |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1537, 159, 1440, 208) |
| e9f6ab6b-f779-4dd5-9fc5-14e5fabd265c |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1450, 162, 1440, 308) |
| 44bdcf66-c35e-430f-af34-70c503ecf62c |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1442, 186, 1440, 471) |
| 4ea652e7-76d5-4240-adb5-9d4ecac25eae |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1532, 198, 1440, 265) |
| 6d038cea-92df-43a5-a805-febf74086a57 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1899, 130, 1440, 197) |
| 6640582e-5d08-4e06-8ea2-d764b443a3c6 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1477, 205, 1440, 345) |
| ed96b707-e7f4-4a71-9e6b-571ffd56c4c4 |    2    |        level: Not available is not supported, Visibility.UNAVAILABLE will be assigned.         |
| a81a5d0a-e7c3-4ace-a331-94656a84214f |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1761, 824, 1440, 902) |
| 8034d7b5-df2f-442e-a7be-da984c6e0c2e |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1593, 154, 1440, 274) |
| 53d20443-cfaf-4199-be9a-e941f2f47e6f |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1685, 582, 1440, 730) |
| 120f402c-9c58-426f-ab6f-d13e09bf30b4 |    2    |        level: Not available is not supported, Visibility.UNAVAILABLE will be assigned.         |
| 40efb087-083c-48ec-885a-14991598b551 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1546, 645, 1440, 771) |
| d0c20918-dc89-4b30-b657-ceeb2103c826 |    2    | bbox must be (xmin, ymin, xmax, ymax) and xmin <= xmax && ymin <= ymax: (1580, 230, 1440, 379) |
+--------------------------------------+---------+------------------------------------------------------------------------------------------------+

ktro2828 added 6 commits May 26, 2025 14:08
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation new-feature New feature or request labels May 26, 2025
@github-actions

github-actions Bot commented May 26, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ❌

Overall Coverage

Lines Covered Coverage Threshold Status
2334 1572 67% 50% 🟢

New Files

File Coverage Status
t4_devkit/common/sanity.py 0% 🔴
TOTAL 0% 🔴

Modified Files

No covered modified files...

updated for commit: 3d9ba5f by action🐍

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@Shin-kyoto Shin-kyoto self-requested a review May 26, 2025 09:03

@Shin-kyoto Shin-kyoto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

  • The feature this PR provides is really good to merge.
  • I did NOT check this PR by running t4sanity command.

@ktro2828 ktro2828 merged commit d4d4c20 into main May 26, 2025
4 of 5 checks passed
@ktro2828 ktro2828 deleted the feat/cli/sanity-check branch May 26, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation new-feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants