ripple-down-rules 0.0.11__tar.gz → 0.0.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.0.11 → ripple_down_rules-0.0.12}/PKG-INFO +1 -1
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/pyproject.toml +1 -1
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/rdr.py +3 -4
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules.egg-info/PKG-INFO +1 -1
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_rdr.py +5 -6
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/LICENSE +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/README.md +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/setup.cfg +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/__init__.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datasets.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/__init__.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/callable_expression.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/case.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/dataclasses.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/enums.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/experts.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/failures.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/prompt.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/rules.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/utils.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules.egg-info/SOURCES.txt +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules.egg-info/dependency_links.txt +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules.egg-info/top_level.txt +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_json_serialization.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_relational_rdr.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_relational_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/test/test_sql_model.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.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
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
6
6
|
|
7
7
|
[project]
|
8
8
|
name = "ripple_down_rules"
|
9
|
-
version = "0.0.
|
9
|
+
version = "0.0.12"
|
10
10
|
description = "Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning."
|
11
11
|
readme = "README.md"
|
12
12
|
authors = [{ name = "Abdelrhman Bassiouny", email = "abassiou@uni-bremen.de" }]
|
@@ -199,7 +199,7 @@ class RDRWithCodeWriter(RDR, ABC):
|
|
199
199
|
"""
|
200
200
|
func_def = f"def classify(case: {self.case_type.__name__}) -> {self._get_conclusion_type_hint()}:\n"
|
201
201
|
with open(file_path + f"/{self.generated_python_file_name}.py", "w") as f:
|
202
|
-
f.write(self._get_imports())
|
202
|
+
f.write(self._get_imports() + "\n\n")
|
203
203
|
f.write(func_def)
|
204
204
|
f.write(f"{' '*4}if not isinstance(case, Case):\n"
|
205
205
|
f"{' '*4} case = create_case(case, recursion_idx=3)\n""")
|
@@ -222,7 +222,6 @@ class RDRWithCodeWriter(RDR, ABC):
|
|
222
222
|
if self.conclusion_type.__module__ != "builtins":
|
223
223
|
imports += f"from {self.conclusion_type.__module__} import {self.conclusion_type.__name__}\n"
|
224
224
|
imports += "from ripple_down_rules.datastructures import Case, create_case\n"
|
225
|
-
imports += "\n\n"
|
226
225
|
return imports
|
227
226
|
|
228
227
|
def get_rdr_classifier_from_python_file(self, package_name) -> Callable[[Any], Any]:
|
@@ -452,8 +451,8 @@ class MultiClassRDR(RDRWithCodeWriter):
|
|
452
451
|
return f"Set[{self.conclusion_type.__name__}]"
|
453
452
|
|
454
453
|
def _get_imports(self) -> str:
|
455
|
-
imports = super()._get_imports()
|
456
|
-
imports += "
|
454
|
+
imports = super()._get_imports()
|
455
|
+
imports += "from typing_extensions import Set\n"
|
457
456
|
return imports
|
458
457
|
|
459
458
|
def update_start_rule(self, case: Union[Case, SQLTable], target: Any, expert: Expert):
|
{ripple_down_rules-0.0.11 → ripple_down_rules-0.0.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.0.
|
3
|
+
Version: 0.0.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
|
@@ -82,10 +82,9 @@ class TestRDR(TestCase):
|
|
82
82
|
mcrdr = self.get_fit_mcrdr()
|
83
83
|
mcrdr.write_to_python_file(self.generated_rdrs_dir)
|
84
84
|
classify_species_mcrdr = mcrdr.get_rdr_classifier_from_python_file(self.generated_rdrs_dir)
|
85
|
-
for case in self.all_cases:
|
86
|
-
|
87
|
-
|
88
|
-
self.assertEqual(make_set(cat_1), make_set(cat_2))
|
85
|
+
for case, target in zip(self.all_cases, self.targets):
|
86
|
+
cat = classify_species_mcrdr(case)
|
87
|
+
self.assertEqual(make_set(cat), make_set(target))
|
89
88
|
|
90
89
|
def test_classify_mcrdr(self):
|
91
90
|
use_loaded_answers = True
|
@@ -115,7 +114,7 @@ class TestRDR(TestCase):
|
|
115
114
|
expert.load_answers(filename)
|
116
115
|
mcrdr = MultiClassRDR()
|
117
116
|
case_queries = [CaseQuery(case, target=target) for case, target in zip(self.all_cases, self.targets)]
|
118
|
-
mcrdr.fit(case_queries, expert=expert, animate_tree=draw_tree
|
117
|
+
mcrdr.fit(case_queries, expert=expert, animate_tree=draw_tree)
|
119
118
|
render_tree(mcrdr.start_rule, use_dot_exporter=True,
|
120
119
|
filename=self.test_results_dir + f"/mcrdr_stop_only")
|
121
120
|
cats = mcrdr.classify(self.all_cases[50])
|
@@ -345,5 +344,5 @@ class TestRDR(TestCase):
|
|
345
344
|
expert.load_answers(filename)
|
346
345
|
mcrdr = MultiClassRDR()
|
347
346
|
case_queries = [CaseQuery(case, target=target) for case, target in zip(self.all_cases, self.targets)]
|
348
|
-
mcrdr.fit(case_queries, expert=expert, animate_tree=draw_tree
|
347
|
+
mcrdr.fit(case_queries, expert=expert, animate_tree=draw_tree)
|
349
348
|
return mcrdr
|
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.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/case.py
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules/datastructures/enums.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ripple_down_rules-0.0.11 → ripple_down_rules-0.0.12}/src/ripple_down_rules.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{ripple_down_rules-0.0.11 → ripple_down_rules-0.0.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
|
File without changes
|