@@ -13,7 +13,7 @@ This project implements the OSI Trace Checker for the ASAM Quality Checker proje
1313 - [ Execute tests] ( #execute-tests )
1414 - [ Contributing] ( #contributing )
1515
16- ## Installation and usage
16+ ## Installation
1717
1818qc-osi-trace can be installed using pip or from source.
1919
@@ -28,7 +28,15 @@ pip install qc-osi-trace@git+https://github.com/OpenSimulationInterface/qc-osi-t
2828** Note** : To install from different sources, you can replace ` @main ` with
2929your desired target. For example, ` develop ` branch as ` @develop ` .
3030
31- #### To use as a library
31+ ### Installation from source
32+
33+ ``` bash
34+ pip install .
35+ ```
36+
37+ ## Usage
38+
39+ ### To use as a library
3240
3341After installation, the usage is similar to the one expressed in the
3442[ ` main.py ` ] ( ./qc_ositrace/main.py ) script:
@@ -37,46 +45,39 @@ After installation, the usage is similar to the one expressed in the
3745from qc_ositrace.checks.deserialization import deserialization_checker
3846```
3947
40- #### To use as an application
48+ ### To use as an application
4149
42- ```
50+ ``` bash
4351qc_ositrace --help
4452
45- usage: QC OSI Trace Checker [-h] (-d | -c CONFIG_PATH)
53+ usage: QC OSI Trace Checker [-h] (-d | -c CONFIG_PATH) [-i INPUT_FILE] [--osiTopic OSITOPIC] [--osiType OSITYPE]
54+ [--osiVersion OSIVERSION] [--osiRulesFile OSIRULESFILE] [-r RESULT_FILE]
55+ [--output_config OUTPUT_CONFIG]
4656
47- This is a collection of scripts for checking validity of OSI Trace (.osi)
48- files.
57+ ASAM QC checker bundle for checking the validity of OSI Trace (.osi/.mcap) files.
4958
5059options:
5160 -h, --help show this help message and exit
5261 -d, --default_config
53- -c CONFIG_PATH, --config_path CONFIG_PATH
62+ -c, --config_path CONFIG_PATH
63+ -i, --input_file INPUT_FILE
64+ Path to the input OSI Trace file.
65+ --osiTopic OSITOPIC Channel topic of a multi-trace OSI Trace file to select.
66+ --osiType OSITYPE Type of the OSI Trace file (e.g., ' SensorView' , ' SensorData' ).
67+ --osiVersion OSIVERSION
68+ Expected version of the OSI Trace file (e.g., ' 3.7.0' ).
69+ --osiRulesFile OSIRULESFILE
70+ Path to a custom OSI rules file.
71+ -r, --result_file RESULT_FILE
72+ Path to the output result file.
73+ --output_config OUTPUT_CONFIG
74+ Path to save the configuration after running the checks.
5475```
5576
56- ### Installation from source
57-
58- The project can be installed from source using [ Poetry] ( https://python-poetry.org/ ) .
59-
60- ``` bash
61- poetry install
62- ```
63-
64- After installing from source, the usage is the same as shown above.
65-
66- It is also possible to execute the qc_ositrace application using Poetry.
77+ Example checking a simple SensorData trace file against version 3.7.0 rules using default configuration:
6778
6879``` bash
69- poetry run qc_ositrace --help
70-
71- usage: QC OSI Trace Checker [-h] (-d | -c CONFIG_PATH)
72-
73- This is a collection of scripts for checking validity of OSI Trace (.osi)
74- files.
75-
76- options:
77- -h, --help show this help message and exit
78- -d, --default_config
79- -c CONFIG_PATH, --config_path CONFIG_PATH
80+ qc_ositrace -d -r results.xqar --osiType SensorData --osiVersion 3.7.0 -i 20210818T150542Z_sd_370_300_1523_example_sensordata_trace.osi
8081```
8182
8283### Example output
@@ -107,50 +108,114 @@ $ qc_ositrace -c example_config/config-errors.xml
1071082024-07-31 16:15:05,806 - Done
108109```
109110
110- ## Tests
111+ ### Use with ASAM Quality Checker Framework
111112
112- To run the tests, you need to install the extra test dependency.
113+ This checker bundle can be used stand-alone, or with the overall tooling provided by the [ ASAM QC Framework] ( https://www.asam.net/standards/asam-quality-checker/ ) .
114+
115+ For example, to view the checker bundle results obtained in the example above in a GUI with external viewer support:
113116
114117``` bash
115- poetry install --with dev
118+ ReportGUI results.xqar
116119```
117120
118- ### Execute tests
121+ The framework provides further tooling to merge results from multiple checker bundles, provide textual reports, or reports that fit into CI pipelines.
122+ Please see its [ documentation] ( https://github.com/asam-ev/qc-framework/blob/main/doc/manual/readme.md ) for more information.
123+
124+ ## Contributing
125+
126+ ### Installation from source
127+
128+ For contributing, the project should be installed from source using [ Poetry] ( https://python-poetry.org/ ) , including the development requirements:
119129
120130``` bash
121- poetry run pytest -vv
131+ poetry install --with dev
122132```
123133
124- They should output something similar to:
134+ You need to have pre-commit installed and install the hooks:
135+
136+ ```
137+ pre-commit install
138+ ```
139+
140+ After installing from source, the usage is the same as shown above.
141+
142+ It is also possible to execute the qc_ositrace application using Poetry:
125143
126144``` bash
127- ============================= test session starts =============================
128- platform win32 -- Python 3.10.4, pytest-8.2.2, pluggy-1.5.0 -- C:\U sers\p mai\s rc\A SAM\q c-osi-trace\. venv\S cripts\p ython.exe
129- cachedir: .pytest_cache
130- rootdir: C:\U sers\p mai\s rc\A SAM\q c-osi-trace
131- collecting ... collected 4 items
145+ poetry run qc_ositrace --help
132146
133- tests/test_deserialization_checks.py::test_deserialization_version_is_set_examples[invalid-SensorView-547] PASSED [ 25%]
134- tests/test_deserialization_checks.py::test_deserialization_version_is_set_examples[valid-SensorView-0] PASSED [ 50%]
135- tests/test_deserialization_checks.py::test_deserialization_expected_version[360-SensorView-3.5.0-547] PASSED [ 75%]
136- tests/test_deserialization_checks.py::test_deserialization_expected_version[360-SensorView-3.6.0-0] PASSED [100%]
147+ usage: QC OSI Trace Checker [-h] (-d | -c CONFIG_PATH) [-i INPUT_FILE] [--osiTopic OSITOPIC] [--osiType OSITYPE]
148+ [--osiVersion OSIVERSION] [--osiRulesFile OSIRULESFILE] [-r RESULT_FILE]
149+ [--output_config OUTPUT_CONFIG]
137150
138- ============================== 4 passed in 0.39s ==============================
139- ```
151+ ASAM QC checker bundle for checking the validity of OSI Trace (.osi/.mcap) files.
140152
141- You can check more options for pytest at its [ own documentation] ( https://docs.pytest.org/ ) .
153+ options:
154+ -h, --help show this help message and exit
155+ -d, --default_config
156+ -c, --config_path CONFIG_PATH
157+ -i, --input_file INPUT_FILE
158+ Path to the input OSI Trace file.
159+ --osiTopic OSITOPIC Channel topic of a multi-trace OSI Trace file to select.
160+ --osiType OSITYPE Type of the OSI Trace file (e.g., ' SensorView' , ' SensorData' ).
161+ --osiVersion OSIVERSION
162+ Expected version of the OSI Trace file (e.g., ' 3.7.0' ).
163+ --osiRulesFile OSIRULESFILE
164+ Path to a custom OSI rules file.
165+ -r, --result_file RESULT_FILE
166+ Path to the output result file.
167+ --output_config OUTPUT_CONFIG
168+ Path to save the configuration after running the checks.
169+ ```
142170
143- ## Contributing
171+ ### Tests
144172
145- For contributing, you need to install the development requirements.
146- For that run:
173+ Executing the tests:
147174
148175``` bash
149- poetry install --with dev
176+ poetry run pytest -vv
150177```
151178
152- You need to have pre-commit installed and install the hooks :
179+ They should output something similar to :
153180
181+ ``` bash
182+ ================================================= test session starts =================================================
183+ platform win32 -- Python 3.13.9, pytest-8.4.1, pluggy-1.6.0 -- C:\U sers\p mai\A ppData\L ocal\P ackages\P ythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\L ocalCache\L ocal\p ypoetry\C ache\v irtualenvs\q c-osi-trace-aBsWsCJH-py3.13\S cripts\p ython.exe
184+ cachedir: .pytest_cache
185+ rootdir: C:\U sers\p mai\s rc\q c-osi-trace
186+ configfile: pyproject.toml
187+ collected 28 items
188+
189+ tests/test_deserialization_checks.py::test_deserialization_version_is_set_examples[invalid-SensorView-547] PASSED [ 3%]
190+ tests/test_deserialization_checks.py::test_deserialization_version_is_set_examples[valid-SensorView-0] PASSED [ 7%]
191+ tests/test_deserialization_checks.py::test_deserialization_expected_version[360-SensorView-3.5.0-547] PASSED [ 10%]
192+ tests/test_deserialization_checks.py::test_deserialization_expected_version[360-SensorView-3.6.0-0] PASSED [ 14%]
193+ tests/test_deserialization_checks.py::test_deserialization_mcap_topic[360-MySensorView-SensorView-3.5.0-547] PASSED [ 17%]
194+ tests/test_deserialization_checks.py::test_deserialization_mcap_topic[360-MySensorView-SensorView-3.6.0-0] PASSED [ 21%]
195+ tests/test_deserialization_checks.py::test_deserialization_mcap_topic[360-Foo-SensorView-3.6.0--1] PASSED [ 25%]
196+ tests/test_deserialization_checks.py::test_deserialization_single_topic[360-MySensorView-SensorView-3.5.0-547] PASSED [ 28%]
197+ tests/test_deserialization_checks.py::test_deserialization_single_topic[360-MySensorView-SensorView-3.6.0-0] PASSED [ 32%]
198+ tests/test_deserialization_checks.py::test_deserialization_single_topic[360-Foo-SensorView-3.5.0-547] PASSED [ 35%]
199+ tests/test_deserialization_checks.py::test_deserialization_single_topic[360-Foo-SensorView-3.6.0-0] PASSED [ 39%]
200+ tests/test_execution.py::test_nonexistent_input_file PASSED [ 42%]
201+ tests/test_osirules_checks.py::test_osirules_version_is_set_examples[invalid-SensorView-547] PASSED [ 46%]
202+ tests/test_osirules_checks.py::test_osirules_version_is_set_examples[valid-SensorView-0] PASSED [ 50%]
203+ tests/test_osirules_checks.py::test_osirules_expected_version[360-SensorView-3.5.0-547] PASSED [ 53%]
204+ tests/test_osirules_checks.py::test_osirules_expected_version[360-SensorView-3.6.0-0] PASSED [ 57%]
205+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_version_is_set/deserialization_version_is_set_invalid.osi-SensorView-3.6.0-SensorView.version.is_set-0] PASSED [ 60%]
206+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_version_is_set/deserialization_version_is_set_invalid.osi-SensorView-3.7.0-SensorView.version.is_set-547] PASSED [ 64%]
207+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-SensorView.mounting_position.is_set-0] PASSED [ 67%]
208+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.7.0-SensorView.mounting_position.is_set-547] PASSED [ 71%]
209+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_expected_version/deserialization_expected_version_360.mcap-SensorView-3.6.0-SensorView.mounting_position.is_set-0] PASSED [ 75%]
210+ tests/test_osirules_checks.py::test_osirules_automatic_rules[deserialization_expected_version/deserialization_expected_version_360.mcap-SensorView-3.7.0-SensorView.mounting_position.is_set-547] PASSED [ 78%]
211+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_version_is_set/deserialization_version_is_set_invalid.osi-SensorView-3.6.0-SensorView.version.is_set-0] PASSED [ 82%]
212+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-GroundTruth.country_code.is_set-547] PASSED [ 85%]
213+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-GroundTruth.proj_string.is_set-547] PASSED [ 89%]
214+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-GroundTruth.map_reference.is_set-547] PASSED [ 92%]
215+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-GroundTruth.stationary_object.minimum_length_1-547] PASSED [ 96%]
216+ tests/test_osirules_checks.py::test_osirules_custom_rules[deserialization_expected_version/deserialization_expected_version_360.osi-SensorView-3.6.0-GroundTruth.moving_object.maximum_length_1-547] PASSED [100%]
217+
218+ ================================================= 28 passed in 17.21s =================================================
154219```
155- pre-commit install
156- ```
220+
221+ You can check more options for pytest at its [ own documentation ] ( https://docs.pytest.org/ ) .
0 commit comments