ripple-down-rules 0.6.21__tar.gz → 0.6.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/PKG-INFO +1 -1
- ripple_down_rules-0.6.21/scripts/live_dot_server.py → ripple_down_rules-0.6.23/scripts/live_dot_server_client.py +26 -11
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/__init__.py +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/rdr.py +9 -6
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/rdr_decorators.py +2 -2
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/rules.py +10 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/utils.py +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/PKG-INFO +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/SOURCES.txt +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_is_a_robot/rdr_metadata/datasets_physical_object_is_a_robot.json +4 -4
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_output__mcrdr.py +3 -3
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.github/workflows/build_and_deploy_doc.yml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.github/workflows/ci.yml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.gitignore +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]/shelved.patch +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]1/shelved.patch +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/LICENSE +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/README.md +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/_config.yml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/_toc.yml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/bibliography.md +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/intro.md +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/references.bib +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/doc/requirements.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/animal_species.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/rdr_metadata/part_containment_rdr.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/robot_contained_objects_mcrdr.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/robot_contained_objects_mcrdr_defs.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/robot_rdr.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/relational_example.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/images/scrdr.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/images/scrdr.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/images/thinking_pr2.jpg +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/pyproject.toml +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/pytest.ini +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/requirements-dev-ci.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/requirements-dev.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/requirements-gui.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/requirements-viz.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/requirements.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_only.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_only.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_plus_rule.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_plus_rule.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr_2.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr_2.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr_3.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_scrdr_3.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/grdr_Habitat.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/grdr_Habitat.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/grdr_Species.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/grdr_Species.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_extra_classify.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_extra_classify.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_stop_plus_rule_combined.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_stop_plus_rule_combined.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/partial_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/partial_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/relational_scrdr_classify.dot +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/relational_scrdr_classify.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/setup.cfg +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/callable_expression.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/case.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/dataclasses.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/enums.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/experts.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/helpers.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/start-code-server.sh +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/gui.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/ipython_custom_shell.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/object_diagram.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/prompt.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/template_file_creator.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/dependency_links.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/requires.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/top_level.txt +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conf/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conf/world/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conf/world/base_config.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conf/world/handles_and_containers.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conftest.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/datasets.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/factories/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/factories/world/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/factories/world/handles_and_containers.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/correct_drawer_rdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/drawer_cabinet_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/grdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/grdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/grdr_expert_answers_fit_extra.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/grdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_expert_answers_stop_only_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_extra_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_extra_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_stop_only_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_stop_plus_rule_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_stop_plus_rule_combined_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mcrdr_stop_plus_rule_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/mutagenic_expert_answers.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/relational_scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/scrdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/scrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/scrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_expert_answers/scrdr_world_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_generated_rdrs/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_helpers/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_helpers/helpers.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_helpers/object_diagram_case_query.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_helpers/object_diagram_person.png +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_json_serialization.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_object_diagram.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_on_mutagenic.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_decorators.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_helpers_rdrs.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_world/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_world/conftest.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_rdr_world/test_rdr_world.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_relational_rdr.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_relational_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_is_a_robot/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr.py +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr_defs.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_rdr.py +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_output__mcrdr_defs.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_rdr.py +1 -1
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/rdr_metadata/datasets_physical_object_select_objects_that_are_parts_of_robot.json +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_sql_model.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_template_file_creator.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/__init__.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_ipython.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_ipython_copilot.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_prompt.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_qt_gui_inline.py +0 -0
- {ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.6.
|
3
|
+
Version: 0.6.23
|
4
4
|
Summary: Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
|
5
5
|
Author-email: Abdelrhman Bassiouny <abassiou@uni-bremen.de>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -1,18 +1,29 @@
|
|
1
1
|
import http.server
|
2
|
-
import socketserver
|
3
|
-
import threading
|
4
|
-
import time
|
5
2
|
import os
|
3
|
+
import shutil
|
4
|
+
import socketserver
|
6
5
|
import sys
|
6
|
+
import time
|
7
|
+
import urllib.request
|
7
8
|
|
8
9
|
dot_path = None
|
9
|
-
|
10
|
+
|
10
11
|
|
11
12
|
def get_dot_content():
|
12
|
-
|
13
|
-
|
13
|
+
if dot_path.startswith("http://") or dot_path.startswith("https://"):
|
14
|
+
try:
|
15
|
+
with urllib.request.urlopen(dot_path) as response:
|
16
|
+
return response.read().decode("utf-8").replace("`", "\\`")
|
17
|
+
except Exception as e:
|
18
|
+
print(f"[ERROR] Failed to fetch DOT from URL: {e}")
|
19
|
+
return "digraph G { ErrorFetching -> DOT; }"
|
20
|
+
else:
|
21
|
+
with open(dot_path, "r", encoding="utf-8") as f:
|
22
|
+
return f.read().replace("`", "\\`")
|
23
|
+
|
14
24
|
|
15
25
|
def generate_html(dot_output="graph.html"):
|
26
|
+
shutil.copy(dot_file, "graph.dot")
|
16
27
|
html_template = f"""<!DOCTYPE html>
|
17
28
|
<html>
|
18
29
|
<head>
|
@@ -41,13 +52,14 @@ def generate_html(dot_output="graph.html"):
|
|
41
52
|
}}
|
42
53
|
|
43
54
|
fetchAndRender();
|
44
|
-
setInterval(fetchAndRender,
|
55
|
+
setInterval(fetchAndRender, 500); // Refresh every 2 seconds
|
45
56
|
</script>
|
46
57
|
</body>
|
47
58
|
</html>"""
|
48
59
|
with open(dot_output, "w", encoding="utf-8") as f:
|
49
60
|
f.write(html_template)
|
50
61
|
|
62
|
+
|
51
63
|
class CustomHandler(http.server.SimpleHTTPRequestHandler):
|
52
64
|
def do_GET(self):
|
53
65
|
if self.path.startswith("/graph.dot"):
|
@@ -58,22 +70,25 @@ class CustomHandler(http.server.SimpleHTTPRequestHandler):
|
|
58
70
|
else:
|
59
71
|
super().do_GET()
|
60
72
|
|
73
|
+
|
61
74
|
def serve_dot(dot_file, port=8000):
|
62
75
|
global dot_path
|
63
76
|
dot_path = dot_file
|
64
|
-
|
65
|
-
|
66
|
-
|
77
|
+
if not dot_path.startswith("http://") and not dot_path.startswith("https://"):
|
78
|
+
while not os.path.exists(dot_path):
|
79
|
+
print(f"Waiting for {dot_path} to be created...")
|
80
|
+
time.sleep(1)
|
67
81
|
generate_html("graph.html")
|
68
82
|
|
69
83
|
handler = CustomHandler
|
70
|
-
with socketserver.TCPServer(("", port), handler) as httpd:
|
84
|
+
with socketserver.TCPServer(("0.0.0.0", port), handler) as httpd:
|
71
85
|
print(f"Serving at http://localhost:{port}/graph.html")
|
72
86
|
try:
|
73
87
|
httpd.serve_forever()
|
74
88
|
except KeyboardInterrupt:
|
75
89
|
print("\nServer stopped.")
|
76
90
|
|
91
|
+
|
77
92
|
if __name__ == "__main__":
|
78
93
|
if len(sys.argv) < 2:
|
79
94
|
print("Usage: python live_dot_server.py path/to/graph.dot [port]")
|
@@ -92,7 +92,7 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
|
|
92
92
|
self.start_rule = start_rule
|
93
93
|
self.fig: Optional[Figure] = None
|
94
94
|
self.viewer: Optional[RDRCaseViewer] = viewer
|
95
|
-
if viewer is None:
|
95
|
+
if viewer is None and RDRCaseViewer is not None:
|
96
96
|
if len(RDRCaseViewer.instances) > 0:
|
97
97
|
self.viewer = RDRCaseViewer.instances[0]
|
98
98
|
logger.error("No viewer was provided, but there is already an existing viewer. "
|
@@ -108,11 +108,14 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
|
|
108
108
|
if value is not None:
|
109
109
|
value.set_save_function(self.save)
|
110
110
|
|
111
|
-
def render_evaluated_rule_tree(self, filename: str) -> None:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
111
|
+
def render_evaluated_rule_tree(self, filename: str, show_full_tree: bool = False) -> None:
|
112
|
+
if show_full_tree:
|
113
|
+
render_tree(self.start_rule, use_dot_exporter=True, filename=filename)
|
114
|
+
else:
|
115
|
+
evaluated_rules = self.get_evaluated_rule_tree()
|
116
|
+
if evaluated_rules is not None and len(evaluated_rules) > 0:
|
117
|
+
render_tree(evaluated_rules[0], use_dot_exporter=True, filename=filename,
|
118
|
+
only_nodes=evaluated_rules)
|
116
119
|
|
117
120
|
def get_evaluated_rule_tree(self) -> List[Rule]:
|
118
121
|
"""
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/rdr_decorators.py
RENAMED
@@ -120,7 +120,7 @@ class RDRDecorator:
|
|
120
120
|
if self.generate_dot_file:
|
121
121
|
eval_rule_tree = self.rdr.get_evaluated_rule_tree()
|
122
122
|
if not self.not_none_output_found or (eval_rule_tree and len(eval_rule_tree) > 1):
|
123
|
-
self.rdr.render_evaluated_rule_tree(self.rdr_models_dir + f'/{self.model_name}')
|
123
|
+
self.rdr.render_evaluated_rule_tree(self.rdr_models_dir + f'/{self.model_name}', show_full_tree=True)
|
124
124
|
if eval_rule_tree and len(eval_rule_tree) > 1:
|
125
125
|
self.not_none_output_found = True
|
126
126
|
|
@@ -181,7 +181,7 @@ class RDRDecorator:
|
|
181
181
|
return Case(dict, id(case_dict), case_name, case_dict, **case_dict), case_dict
|
182
182
|
|
183
183
|
def initialize_rdr_model_name_and_load(self, func: Callable) -> None:
|
184
|
-
self.viewer = RDRCaseViewer.instances[0] if len(RDRCaseViewer.instances) > 0 else self.viewer
|
184
|
+
self.viewer = RDRCaseViewer.instances[0] if RDRCaseViewer is not None and len(RDRCaseViewer.instances) > 0 else self.viewer
|
185
185
|
model_file_name = get_func_rdr_model_name(func, include_file_name=True)
|
186
186
|
self.model_name = str_to_snake_case(model_file_name)
|
187
187
|
self.load()
|
@@ -60,6 +60,16 @@ class Rule(NodeMixin, SubclassJSONSerializer, ABC):
|
|
60
60
|
self.evaluated: bool = False
|
61
61
|
self._user_defined_name: Optional[str] = None
|
62
62
|
|
63
|
+
@property
|
64
|
+
def color(self) -> str:
|
65
|
+
if self.evaluated:
|
66
|
+
if self.fired:
|
67
|
+
return "green"
|
68
|
+
else:
|
69
|
+
return "red"
|
70
|
+
else:
|
71
|
+
return "white"
|
72
|
+
|
63
73
|
@property
|
64
74
|
def user_defined_name(self) -> Optional[str]:
|
65
75
|
"""
|
@@ -1934,7 +1934,7 @@ def render_tree(root: Node, use_dot_exporter: bool = False,
|
|
1934
1934
|
include_nodes=only_nodes,
|
1935
1935
|
nodenamefunc=unique_node_names,
|
1936
1936
|
edgeattrfunc=edge_attr_setter,
|
1937
|
-
nodeattrfunc=lambda node: f'style=filled, fillcolor={
|
1937
|
+
nodeattrfunc=lambda node: f'style=filled, fillcolor={node.color}'
|
1938
1938
|
)
|
1939
1939
|
de.to_dotfile(f"{filename}{'.dot'}")
|
1940
1940
|
# de.to_picture(f"{filename}{'.png'}")
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.6.
|
3
|
+
Version: 0.6.23
|
4
4
|
Summary: Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
|
5
5
|
Author-email: Abdelrhman Bassiouny <abassiou@uni-bremen.de>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/SOURCES.txt
RENAMED
@@ -56,7 +56,7 @@ results/partial_mcrdr_extra.dot
|
|
56
56
|
results/partial_mcrdr_extra.png
|
57
57
|
results/relational_scrdr_classify.dot
|
58
58
|
results/relational_scrdr_classify.png
|
59
|
-
scripts/
|
59
|
+
scripts/live_dot_server_client.py
|
60
60
|
src/ripple_down_rules/__init__.py
|
61
61
|
src/ripple_down_rules/experts.py
|
62
62
|
src/ripple_down_rules/helpers.py
|
@@ -15,9 +15,9 @@
|
|
15
15
|
"Dict": "typing.Dict",
|
16
16
|
"Optional": "typing.Optional",
|
17
17
|
"Union": "typing.Union",
|
18
|
-
"NoneType": "builtins.NoneType",
|
19
18
|
"PhysicalObject": "test.datasets.PhysicalObject",
|
20
|
-
"Robot": "test.datasets.Robot"
|
19
|
+
"Robot": "test.datasets.Robot",
|
20
|
+
"NoneType": "builtins.NoneType"
|
21
21
|
},
|
22
22
|
"conclusion": {
|
23
23
|
"_type": "builtins.NoneType",
|
@@ -35,9 +35,9 @@
|
|
35
35
|
"Dict": "typing.Dict",
|
36
36
|
"Optional": "typing.Optional",
|
37
37
|
"Union": "typing.Union",
|
38
|
-
"NoneType": "builtins.NoneType",
|
39
38
|
"PhysicalObject": "test.datasets.PhysicalObject",
|
40
|
-
"Robot": "test.datasets.Robot"
|
39
|
+
"Robot": "test.datasets.Robot",
|
40
|
+
"NoneType": "builtins.NoneType"
|
41
41
|
},
|
42
42
|
"conclusion": {
|
43
43
|
"_type": "builtins.NoneType",
|
@@ -1,11 +1,11 @@
|
|
1
|
-
from ripple_down_rules.utils import make_set
|
2
|
-
from ripple_down_rules.datastructures.case import Case, create_case
|
3
1
|
from typing_extensions import Optional, Set
|
2
|
+
from ripple_down_rules.datastructures.case import Case, create_case
|
3
|
+
from ripple_down_rules.utils import make_set
|
4
4
|
from .physical_object_select_objects_that_are_parts_of_robot_output__mcrdr_defs import *
|
5
5
|
|
6
6
|
|
7
7
|
attribute_name = 'output_'
|
8
|
-
conclusion_type = (set,
|
8
|
+
conclusion_type = (set, list, PhysicalObject,)
|
9
9
|
mutually_exclusive = False
|
10
10
|
|
11
11
|
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.github/workflows/build_and_deploy_doc.yml
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/.github/workflows/publish-to-test-pypi.yml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/examples/part_containment_rdr/robot_rdr.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_plus_rule.dot
RENAMED
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/complete_mcrdr_stop_plus_rule.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_stop_plus_rule_combined.dot
RENAMED
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/results/mcrdr_stop_plus_rule_combined.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/case.py
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/datastructures/enums.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/start-code-server.sh
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/gui.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules/user_interface/prompt.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/requires.txt
RENAMED
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/src/ripple_down_rules.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/conf/world/handles_and_containers.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/factories/world/handles_and_containers.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_helpers/object_diagram_person.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
|
-
from ripple_down_rules.datastructures.case import Case, create_case
|
2
1
|
from typing_extensions import Optional
|
2
|
+
from ripple_down_rules.datastructures.case import Case, create_case
|
3
3
|
from types import NoneType
|
4
4
|
from .physical_object_is_a_robot_output__scrdr_defs import *
|
5
5
|
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
+
from ripple_down_rules.helpers import general_rdr_classify
|
1
2
|
from typing_extensions import Any, Dict
|
2
3
|
from ripple_down_rules.datastructures.case import Case, create_case
|
3
|
-
from ripple_down_rules.helpers import general_rdr_classify
|
4
4
|
from . import physical_object_is_a_robot_output__scrdr as output__classifier
|
5
5
|
|
6
6
|
classifiers_dict = dict()
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
+
from ripple_down_rules.helpers import general_rdr_classify
|
1
2
|
from typing_extensions import Any, Dict
|
2
3
|
from ripple_down_rules.datastructures.case import Case, create_case
|
3
|
-
from ripple_down_rules.helpers import general_rdr_classify
|
4
4
|
from . import physical_object_select_objects_that_are_parts_of_robot_output__mcrdr as output__classifier
|
5
5
|
|
6
6
|
classifiers_dict = dict()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_ipython.py
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_prompt.py
RENAMED
File without changes
|
{ripple_down_rules-0.6.21 → ripple_down_rules-0.6.23}/test/test_user_interface/test_qt_gui_inline.py
RENAMED
File without changes
|
File without changes
|