ripple-down-rules 0.5.4__py3-none-any.whl → 0.5.5__py3-none-any.whl

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.
@@ -1,4 +1,4 @@
1
- __version__ = "0.5.4"
1
+ __version__ = "0.5.5"
2
2
 
3
3
  import logging
4
4
  logger = logging.Logger("rdr")
@@ -300,6 +300,7 @@ class TemplateFileCreator:
300
300
  if isinstance(node, ast.FunctionDef) and node.name == func_name:
301
301
  exec_globals = {}
302
302
  scope = extract_imports(tree=tree)
303
+ updates.update(scope)
303
304
  exec(source, scope, exec_globals)
304
305
  user_function = exec_globals[func_name]
305
306
  updates[func_name] = user_function
@@ -1370,8 +1370,8 @@ def draw_tree(root: Node, fig: Figure):
1370
1370
  """
1371
1371
  Draw the tree using matplotlib and networkx.
1372
1372
  """
1373
- if matplotlib.get_backend().lower() not in ['qt5agg', 'qt4agg', 'qt6agg']:
1374
- matplotlib.use("Qt6Agg") # or "Qt6Agg", depending on availability
1373
+ # if matplotlib.get_backend().lower() not in ['qt5agg', 'qt4agg', 'qt6agg']:
1374
+ # matplotlib.use("Qt6Agg") # or "Qt6Agg", depending on availability
1375
1375
 
1376
1376
  if root is None:
1377
1377
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ripple_down_rules
3
- Version: 0.5.4
3
+ Version: 0.5.5
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
@@ -693,7 +693,7 @@ Requires-Dist: colorama
693
693
  Requires-Dist: pygments
694
694
  Requires-Dist: sqlalchemy
695
695
  Requires-Dist: pandas
696
- Requires-Dist: pyparsing
696
+ Requires-Dist: pyparsing>=3.2.3
697
697
  Provides-Extra: viz
698
698
  Requires-Dist: networkx>=3.1; extra == "viz"
699
699
  Requires-Dist: matplotlib>=3.7.5; extra == "viz"
@@ -799,6 +799,19 @@ cat = grdr.classify(all_cases[50])['species']
799
799
  assert cat == targets[50]
800
800
  ```
801
801
 
802
+ When prompted to write a rule, I wrote the following inside the template function that the Ripple Down Rules created:
803
+ ```python
804
+ return case.milk == 1
805
+ ```
806
+ then
807
+ ```python
808
+ return case.aquatic == 1
809
+ ```
810
+
811
+ The rule tree generated from fitting all the dataset will look like this:
812
+ ![species_rdr](https://raw.githubusercontent.com/AbdelrhmanBassiouny/ripple_down_rules/main/images/scrdr.png)
813
+
814
+
802
815
  ### Relational Example
803
816
 
804
817
  By relational, I mean that each rule conclusion is not a constant value, but is related to the case being classified,
@@ -1,11 +1,11 @@
1
- ripple_down_rules/__init__.py,sha256=8e_vgenmdqtVY41f0q59EP97pFvgSGxtQgPyO9fnp64,99
1
+ ripple_down_rules/__init__.py,sha256=OV_GxE_svT43w1V5gHpc0YaGCqmA-cm_U7P8UmX4Ox4,99
2
2
  ripple_down_rules/experts.py,sha256=rPRJU2py5wCopZADVWOP3Vzp077KL6ArDlkxUQ0Mh6w,12130
3
3
  ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
4
4
  ripple_down_rules/rdr.py,sha256=FJYuRXgpUYSSK1pYrp2yeXb_ZZ2xjPED31tzxofokL4,48865
5
5
  ripple_down_rules/rdr_decorators.py,sha256=pYCKLgMKgQ6x_252WQtF2t4ZNjWPBxnaWtJ6TpGdcc0,7820
6
6
  ripple_down_rules/rules.py,sha256=TPNVMqW9T-_46BS4WemrspLg5uG8kP6tsPvWWBAzJxg,17515
7
7
  ripple_down_rules/start-code-server.sh,sha256=otClk7VmDgBOX2TS_cjws6K0UwvgAUJhoA0ugkPCLqQ,949
8
- ripple_down_rules/utils.py,sha256=cv40XBj-tp11aRYcAPhPtkrYatMvAKk_1d5P7PB1-tw,51123
8
+ ripple_down_rules/utils.py,sha256=4xQ5gmIeMsY-mA9g-4cedKt2WJq4oZAMs5XEKeplWPM,51127
9
9
  ripple_down_rules/datastructures/__init__.py,sha256=V2aNgf5C96Y5-IGghra3n9uiefpoIm_QdT7cc_C8cxQ,111
10
10
  ripple_down_rules/datastructures/callable_expression.py,sha256=D2KD1RdShzxYZPAERgywZ5ZPE4ar8WmMtXINqvYo_Tc,12497
11
11
  ripple_down_rules/datastructures/case.py,sha256=r8kjL9xP_wk84ThXusspgPMrAoed2bGQmKi54fzhmH8,15258
@@ -16,9 +16,9 @@ ripple_down_rules/user_interface/gui.py,sha256=SB0gUhgReJ3yx-NEHRPMGVuNRLPRUwW8-
16
16
  ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=24MIFwqnAhC6ofObEO6x5xRWRnyQmPpPmTvxbCKBrzM,6514
17
17
  ripple_down_rules/user_interface/object_diagram.py,sha256=tsB6iuLNEbHxp5lR2WjyejjWbnAX_nHF9xS8jNPOQVk,4548
18
18
  ripple_down_rules/user_interface/prompt.py,sha256=AkkltdDIaioN43lkRKDPKSjJcmdSSGZDMYz7AL7X9lE,8082
19
- ripple_down_rules/user_interface/template_file_creator.py,sha256=ycCbddy_BJP8d0Q2Sj21UzamhGtqGZuK_e73VTJqznY,13766
20
- ripple_down_rules-0.5.4.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
21
- ripple_down_rules-0.5.4.dist-info/METADATA,sha256=2t5F_Z7AqI7lb2zZxTREAGEUyipcISlZ00Dk-0BAEx4,47796
22
- ripple_down_rules-0.5.4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
23
- ripple_down_rules-0.5.4.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
24
- ripple_down_rules-0.5.4.dist-info/RECORD,,
19
+ ripple_down_rules/user_interface/template_file_creator.py,sha256=FGtLfYBfr4310c7Dfa9b2qiOWLNzHk1q3kdhD70Ilg4,13804
20
+ ripple_down_rules-0.5.5.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
21
+ ripple_down_rules-0.5.5.dist-info/METADATA,sha256=irk6Cn48hjgyNiE9XyuRsSFP1svBynaDMTkN1ijbvRc,48188
22
+ ripple_down_rules-0.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ ripple_down_rules-0.5.5.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
24
+ ripple_down_rules-0.5.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5