ripple-down-rules 0.6.1__tar.gz → 0.6.12__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.1 → ripple_down_rules-0.6.12}/PKG-INFO +1 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/__init__.py +1 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/callable_expression.py +1 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/helpers.py +1 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/rdr.py +4 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/rdr_decorators.py +15 -4
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/PKG-INFO +1 -1
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.github/workflows/build_and_deploy_doc.yml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.github/workflows/ci.yml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.gitignore +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]/shelved.patch +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]1/shelved.patch +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/LICENSE +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/README.md +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/_config.yml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/_toc.yml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/bibliography.md +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/intro.md +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/references.bib +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/doc/requirements.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/animal_species.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/rdr_metadata/part_containment_rdr.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/robot_contained_objects_mcrdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/robot_contained_objects_mcrdr_defs.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/robot_rdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/examples/relational_example.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/images/scrdr.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/images/scrdr.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/images/thinking_pr2.jpg +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/pyproject.toml +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/pytest.ini +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/requirements-dev-ci.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/requirements-dev.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/requirements-gui.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/requirements-viz.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/requirements.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_stop_only.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_stop_only.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_stop_plus_rule.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_stop_plus_rule.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr_2.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr_2.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr_3.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/complete_scrdr_3.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/grdr_Habitat.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/grdr_Habitat.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/grdr_Species.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/grdr_Species.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_extra_classify.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_extra_classify.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_stop_plus_rule_combined.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/mcrdr_stop_plus_rule_combined.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/partial_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/partial_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/relational_scrdr_classify.dot +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/results/relational_scrdr_classify.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/setup.cfg +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/case.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/dataclasses.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/enums.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/experts.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/rules.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/start-code-server.sh +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/gui.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/ipython_custom_shell.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/object_diagram.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/prompt.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/template_file_creator.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/utils.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/SOURCES.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/dependency_links.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/requires.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/top_level.txt +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/conf/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/conf/world/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/conf/world/base_config.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/conf/world/handles_and_containers.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/conftest.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/datasets.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/factories/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/factories/world/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/factories/world/handles_and_containers.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/correct_drawer_rdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/drawer_cabinet_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/grdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/grdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/grdr_expert_answers_fit_extra.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/grdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_expert_answers_stop_only_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_extra_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_extra_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_stop_only_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_stop_plus_rule_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_stop_plus_rule_combined_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mcrdr_stop_plus_rule_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/mutagenic_expert_answers.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/relational_scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/scrdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/scrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/scrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_expert_answers/scrdr_world_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_generated_rdrs/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_helpers/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_helpers/helpers.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_helpers/object_diagram_case_query.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_helpers/object_diagram_person.png +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_json_serialization.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_object_diagram.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_on_mutagenic.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_decorators.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_helpers_rdrs.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_world/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_world/conftest.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_rdr_world/test_rdr_world.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_relational_rdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_relational_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_is_a_robot/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_rdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_is_a_robot/rdr_metadata/datasets_physical_object_is_a_robot.json +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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 +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_rdr.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/test/test_sql_model.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_template_file_creator.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/__init__.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_ipython.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_ipython_copilot.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_prompt.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_qt_gui_inline.py +0 -0
- {ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.12
|
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
|
@@ -161,7 +161,7 @@ class CallableExpression(SubclassJSONSerializer):
|
|
161
161
|
else:
|
162
162
|
raise ValueError("Either user_input or conclusion must be provided.")
|
163
163
|
except Exception as e:
|
164
|
-
raise ValueError(f"Error during evaluation: {e}")
|
164
|
+
raise ValueError(f"Error during evaluation: {e}, user_input: {self.user_input}")
|
165
165
|
|
166
166
|
def combine_with(self, other: 'CallableExpression') -> 'CallableExpression':
|
167
167
|
"""
|
@@ -55,7 +55,7 @@ def general_rdr_classify(classifiers_dict: Dict[str, Union[ModuleType, RippleDow
|
|
55
55
|
if attribute_name in new_conclusions:
|
56
56
|
temp_case_query = CaseQuery(case_cp, attribute_name, rdr.conclusion_type, rdr.mutually_exclusive)
|
57
57
|
update_case(temp_case_query, new_conclusions)
|
58
|
-
if len(new_conclusions) == 0 or (len(classifiers_dict) == 1 and all(rdr.mutually_exclusive for rdr in classifiers_dict.values())):
|
58
|
+
if len(new_conclusions) == 0: #or (len(classifiers_dict) == 1 and all(rdr.mutually_exclusive for rdr in classifiers_dict.values())):
|
59
59
|
break
|
60
60
|
return conclusions
|
61
61
|
|
@@ -244,6 +244,7 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
|
|
244
244
|
expert: Optional[Expert] = None,
|
245
245
|
update_existing_rules: bool = True,
|
246
246
|
scenario: Optional[Callable] = None,
|
247
|
+
ask_now: Callable = lambda _: True,
|
247
248
|
**kwargs) \
|
248
249
|
-> Union[CallableExpression, Dict[str, CallableExpression]]:
|
249
250
|
"""
|
@@ -255,6 +256,7 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
|
|
255
256
|
:param update_existing_rules: Whether to update the existing same conclusion type rules that already gave
|
256
257
|
some conclusions with the type required by the case query.
|
257
258
|
:param scenario: The scenario at which the case was created, this is used to recreate the case if needed.
|
259
|
+
:ask_now: Whether to ask the expert for refinements or alternatives.
|
258
260
|
:return: The category that the case belongs to.
|
259
261
|
"""
|
260
262
|
if case_query is None:
|
@@ -271,7 +273,8 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
|
|
271
273
|
if case_query.target is None:
|
272
274
|
case_query_cp = copy(case_query)
|
273
275
|
conclusions = self.classify(case_query_cp.case, modify_case=True, case_query=case_query_cp)
|
274
|
-
if self.should_i_ask_the_expert_for_a_target(conclusions, case_query_cp, update_existing_rules)
|
276
|
+
if (self.should_i_ask_the_expert_for_a_target(conclusions, case_query_cp, update_existing_rules)
|
277
|
+
and ask_now(case_query_cp.case)):
|
275
278
|
expert.ask_for_conclusion(case_query_cp)
|
276
279
|
case_query.target = case_query_cp.target
|
277
280
|
if case_query.target is None:
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/rdr_decorators.py
RENAMED
@@ -33,7 +33,8 @@ class RDRDecorator:
|
|
33
33
|
viewer: Optional[RDRCaseViewer] = None,
|
34
34
|
package_name: Optional[str] = None,
|
35
35
|
use_generated_classifier: bool = False,
|
36
|
-
ask_now: Callable[[Any], bool] = lambda _: True
|
36
|
+
ask_now: Callable[[Any, Any], bool] = lambda _,n: True,
|
37
|
+
fitting_decorator: Optional[Callable] = None):
|
37
38
|
"""
|
38
39
|
:param models_dir: The directory to save/load the RDR models.
|
39
40
|
:param output_type: The type of the output. This is used to create the RDR model.
|
@@ -66,6 +67,7 @@ class RDRDecorator:
|
|
66
67
|
self.use_generated_classifier = use_generated_classifier
|
67
68
|
self.generated_classifier: Optional[Callable] = None
|
68
69
|
self.ask_now = ask_now
|
70
|
+
self.fitting_decorator = fitting_decorator
|
69
71
|
self.load()
|
70
72
|
|
71
73
|
def decorator(self, func: Callable) -> Callable:
|
@@ -79,8 +81,9 @@ class RDRDecorator:
|
|
79
81
|
func_output = {self.output_name: func(*args, **kwargs)}
|
80
82
|
|
81
83
|
case, case_dict = self.create_case_from_method(func, func_output, *args, **kwargs)
|
82
|
-
|
83
|
-
|
84
|
+
|
85
|
+
@self.fitting_decorator
|
86
|
+
def fit():
|
84
87
|
if len(self.parsed_output_type) == 0:
|
85
88
|
self.parsed_output_type = self.parse_output_type(func, self.output_type, *args)
|
86
89
|
if self.expert is None:
|
@@ -89,10 +92,15 @@ class RDRDecorator:
|
|
89
92
|
case_query = self.create_case_query_from_method(func, func_output,
|
90
93
|
self.parsed_output_type,
|
91
94
|
self.mutual_exclusive,
|
95
|
+
case, case_dict,
|
92
96
|
*args, **kwargs)
|
93
97
|
output = self.rdr.fit_case(case_query, expert=self.expert,
|
94
98
|
update_existing_rules=self.update_existing_rules,
|
95
99
|
viewer=self.viewer)
|
100
|
+
return output
|
101
|
+
|
102
|
+
if self.fit and not self.use_generated_classifier and self.ask_now(case_dict, self.rdr.classify(case)):
|
103
|
+
output = fit()
|
96
104
|
else:
|
97
105
|
if self.use_generated_classifier:
|
98
106
|
if self.generated_classifier is None:
|
@@ -114,6 +122,8 @@ class RDRDecorator:
|
|
114
122
|
func_output: Dict[str, Any],
|
115
123
|
output_type: Sequence[Type],
|
116
124
|
mutual_exclusive: bool,
|
125
|
+
case: Optional[Case] = None,
|
126
|
+
case_dict: Optional[Dict[str, Any]] = None,
|
117
127
|
*args, **kwargs) -> CaseQuery:
|
118
128
|
"""
|
119
129
|
Create a CaseQuery from the function and its arguments.
|
@@ -127,7 +137,8 @@ class RDRDecorator:
|
|
127
137
|
:return: A CaseQuery object representing the case.
|
128
138
|
"""
|
129
139
|
output_type = make_set(output_type)
|
130
|
-
case
|
140
|
+
if case is None or case_dict is None:
|
141
|
+
case, case_dict = RDRDecorator.create_case_from_method(func, func_output, *args, **kwargs)
|
131
142
|
scope = func.__globals__
|
132
143
|
scope.update(case_dict)
|
133
144
|
func_args_type_hints = get_type_hints(func)
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.12
|
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.1 → ripple_down_rules-0.6.12}/.github/workflows/build_and_deploy_doc.yml
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/.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.1 → ripple_down_rules-0.6.12}/examples/part_containment_rdr/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/results/complete_mcrdr_stop_plus_rule.dot
RENAMED
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/results/mcrdr_stop_plus_rule_combined.dot
RENAMED
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/case.py
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/datastructures/enums.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/start-code-server.sh
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/gui.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules/user_interface/prompt.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/src/ripple_down_rules.egg-info/requires.txt
RENAMED
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/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.1 → ripple_down_rules-0.6.12}/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
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_helpers/object_diagram_case_query.png
RENAMED
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/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
|
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.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_ipython.py
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_prompt.py
RENAMED
File without changes
|
{ripple_down_rules-0.6.1 → ripple_down_rules-0.6.12}/test/test_user_interface/test_qt_gui_inline.py
RENAMED
File without changes
|
File without changes
|