Skip to content

Commit

Permalink
Merge pull request #46 from asam-ev/tung/update-doc-example
Browse files Browse the repository at this point in the history
Update documentation and example
  • Loading branch information
andreaskern74 authored Oct 24, 2024
2 parents d4d87ed + 3d56d39 commit ef1d32c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ The library features the main interfaces needed to implement a module:

### Installation using pip

**From PyPi**

```bash
pip install asam-qc-baselib
```

**From GitHub repository**

```bash
pip install asam-qc-baselib@git+https://github.com/asam-ev/qc-baselib-py@main
```

**Note**: To install from different sources, you can replace `@main` with
To install from different sources, you can replace `@main` with
your desired target. For example, `develop` branch as `@develop`.

**From a local repository**

```bash
pip install /home/user/qc-baselib-py
```

### Installation from source for local development.

Using [Poetry](https://python-poetry.org/):
Expand Down
2 changes: 1 addition & 1 deletion examples/json_validator/config/invalid.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<Config>

<Param name="JsonFile" value="data/invalid.json" />
<Param name="InputFile" value="data/invalid.json" />

<CheckerBundle application="jsonBundle">
<Param name="resultFile" value="json_bundle_report.xqar" />
Expand Down
2 changes: 1 addition & 1 deletion examples/json_validator/config/skipped.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<Config>

<Param name="JsonFile" value="data/non_existing_file.json" />
<Param name="InputFile" value="data/non_existing_file.json" />

<CheckerBundle application="jsonBundle">
<Param name="resultFile" value="json_bundle_report.xqar" />
Expand Down
2 changes: 1 addition & 1 deletion examples/json_validator/config/valid.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<Config>

<Param name="JsonFile" value="data/valid.json" />
<Param name="InputFile" value="data/valid.json" />

<CheckerBundle application="jsonBundle">
<Param name="resultFile" value="json_bundle_report.xqar" />
Expand Down
11 changes: 4 additions & 7 deletions examples/json_validator/json_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,17 @@ def main():
# Create result object
result = Result()

json_file = config.get_config_param("JsonFile")
result_file = config.get_checker_bundle_param("jsonBundle", "resultFile")
json_file = config.get_config_param("InputFile")
result_file = config.get_checker_bundle_param(BUNDLE_NAME, "resultFile")

logging.info(f"JsonFile = {json_file}")
logging.info(f"InputFile = {json_file}")
logging.info(f"resultFile = {result_file}")

# Register checker bundle
result.register_checker_bundle(
name=BUNDLE_NAME,
build_date=datetime.today().strftime("%Y-%m-%d"),
description="JSON checker bundle",
version=BUNDLE_VERSION,
summary="",
)
result.set_result_version(version=BUNDLE_VERSION)

Expand All @@ -61,7 +59,6 @@ def main():
checker_bundle_name=BUNDLE_NAME,
checker_id=CHECKER_ID,
description="Json validation checker",
summary="",
)

# Register addressed rule
Expand All @@ -81,7 +78,7 @@ def main():
is_valid = is_valid_json(json_file)

if not is_valid:
issue_id = result.register_issue(
result.register_issue(
checker_bundle_name=BUNDLE_NAME,
checker_id=CHECKER_ID,
description="The input file is not a valid json file.",
Expand Down
2 changes: 1 addition & 1 deletion examples/json_validator/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main
asam-qc-baselib
2 changes: 1 addition & 1 deletion examples/report_module_text/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asam-qc-baselib @ git+https://github.com/asam-ev/qc-baselib-py@main
asam-qc-baselib
lxml==5.2.2
numpy==2.0.0
scipy==1.14.0

0 comments on commit ef1d32c

Please sign in to comment.