-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rename item and camera rules with same nomenclature
- Loading branch information
Baptiste O'Jeanson
committed
Oct 19, 2023
1 parent
23e7d72
commit e35da7e
Showing
30 changed files
with
95 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...estrator/edge_orchestrator/domain/models/business_rule/camera_rule/camera_rule_factory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from typing import Type | ||
|
||
from edge_orchestrator.domain.models.business_rule.camera_rule.camera_rule import ( | ||
CameraRule, | ||
) | ||
from edge_orchestrator.domain.models.business_rule.camera_rule.expected_label_rule import ( | ||
ExpectedLabelRule, | ||
) | ||
from edge_orchestrator.domain.models.business_rule.camera_rule.max_nb_objects_rule import ( | ||
MaxNbObjectsRule, | ||
) | ||
from edge_orchestrator.domain.models.business_rule.camera_rule.min_nb_objects_rule import ( | ||
MinNbObjectsRule, | ||
) | ||
|
||
AVAILABLE_CAMERA_RULES = { | ||
"expected_label_rule": ExpectedLabelRule, | ||
"min_nb_objects_rule": MinNbObjectsRule, | ||
"max_nb_objects_rule": MaxNbObjectsRule, | ||
} | ||
|
||
|
||
def get_camera_rule(rule_name: str) -> Type[CameraRule]: | ||
try: | ||
return AVAILABLE_CAMERA_RULES[rule_name] | ||
except KeyError as error: | ||
raise NotImplementedError(f"Unknown camera rule name: {rule_name}") from error |
4 changes: 3 additions & 1 deletion
4
...era_business_rules/expected_label_rule.py → ...s_rule/camera_rule/expected_label_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...era_business_rules/max_nb_objects_rule.py → ...s_rule/camera_rule/max_nb_objects_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...era_business_rules/min_nb_objects_rule.py → ...s_rule/camera_rule/min_nb_objects_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...orchestrator/edge_orchestrator/domain/models/business_rule/item_rule/item_rule_factory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Type | ||
|
||
from edge_orchestrator.domain.models.business_rule.item_rule.item_rule import ( | ||
ItemRule, | ||
) | ||
from edge_orchestrator.domain.models.business_rule.item_rule.min_threshold_ko_rule import ( | ||
MinThresholdKORule, | ||
) | ||
from edge_orchestrator.domain.models.business_rule.item_rule.min_threshold_ok_ratio_rule import ( | ||
MinThresholdOKRatioRule, | ||
) | ||
|
||
AVAILABLE_ITEM_RULES = { | ||
"min_threshold_ok_ratio_rule": MinThresholdOKRatioRule, | ||
"min_threshold_ko_rule": MinThresholdKORule, | ||
} | ||
|
||
|
||
def get_item_rule(rule_name: str) -> Type[ItemRule]: | ||
try: | ||
return AVAILABLE_ITEM_RULES[rule_name] | ||
except KeyError as error: | ||
raise NotImplementedError(f"Unknown item rule name: {rule_name}") from error |
4 changes: 2 additions & 2 deletions
4
...item_business_rule/item_threshold_rule.py → ...s_rule/item_rule/min_threshold_ko_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...usiness_rule/item_threshold_ratio_rule.py → .../item_rule/min_threshold_ok_ratio_rule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 1 addition & 23 deletions
24
edge_orchestrator/edge_orchestrator/domain/models/camera.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
edge_orchestrator/edge_orchestrator/domain/ports/telemetry_sink.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from abc import abstractmethod | ||
from typing import Dict | ||
|
||
|
||
class TelemetrySink: | ||
@abstractmethod | ||
async def send(self, message: str): | ||
async def send(self, message: Dict): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
..._orchestrator/tests/unit_tests/domain/models/business_rules/test_camera_business_rules.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters