Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation and example #46

Merged
merged 1 commit into from
Oct 24, 2024
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
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