Skip to content

Commit

Permalink
fixed example
Browse files Browse the repository at this point in the history
  • Loading branch information
niliayu committed Sep 19, 2024
1 parent 3053872 commit 1e9ab35
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ rules:
- name: vehicle_not_stopped
description: Makes sure vehicle velocity remains 0 while stopped
expression: $1 == "Stopped" && $2 > 0
type: review
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ rules:
- name: undervoltage
description: Checks for undervoltage while accelerating
expression: $1 == "Accelerating" && $2 < 40
type: review
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def nostromos_lv_426() -> TelemetryConfig:

telemetry_config_path = TELEMETRY_CONFIGS_DIR.joinpath(telemetry_config_name)

# Load your telemetry config with your reusable expressions modules
# Load your telemetry config with your reusable expressions modules and rule modules
return TelemetryConfig.try_from_yaml(
telemetry_config_path,
[
EXPRESSION_MODULES_DIR.joinpath("kinematics.yml"),
EXPRESSION_MODULES_DIR.joinpath("string.yml"),
],
[RULE_MODULES_DIR.joinpath("voltage.yml")],
[RULE_MODULES_DIR],
)
1 change: 1 addition & 0 deletions python/lib/sift_py/ingestion/config/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def _from_yaml(
if not found_rule:
# TODO: Maybe we should try and catch this earlier?
raise ValueError(f"Could not find rule name {rule['name']} in {namespace}")
rule = found_rule

annotation_type = RuleActionAnnotationKind.from_str(rule["type"])

Expand Down

0 comments on commit 1e9ab35

Please sign in to comment.