ripple-down-rules 0.1.63__py3-none-any.whl → 0.1.64__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.
ripple_down_rules/rdr.py CHANGED
@@ -217,13 +217,16 @@ class RDRWithCodeWriter(RippleDownRules, ABC):
217
217
  for rule in [self.start_rule] + list(self.start_rule.descendants):
218
218
  if not rule.conditions:
219
219
  continue
220
- if rule.conditions.scope is None or len(rule.conditions.scope) == 0:
221
- continue
222
- for k, v in rule.conditions.scope.items():
223
- new_imports = f"from {v.__module__} import {v.__name__}\n"
224
- if new_imports in imports:
220
+ for scope in [rule.conditions.scope, rule.conclusion.scope]:
221
+ if scope is None:
225
222
  continue
226
- imports += new_imports
223
+ for k, v in scope.items():
224
+ if not hasattr(v, "__module__") or not hasattr(v, "__name__"):
225
+ continue
226
+ new_imports = f"from {v.__module__} import {v.__name__}\n"
227
+ if new_imports in imports:
228
+ continue
229
+ imports += new_imports
227
230
  return imports
228
231
 
229
232
  def get_rdr_classifier_from_python_file(self, package_name: str) -> Callable[[Any], Any]:
@@ -288,7 +288,7 @@ class MultiClassStopRule(Rule, HasAlternativeRule):
288
288
 
289
289
  def __init__(self, *args, **kwargs):
290
290
  super(MultiClassStopRule, self).__init__(*args, **kwargs)
291
- self.conclusion = Stop.stop
291
+ self.conclusion = CallableExpression(conclusion_type=(Stop,), conclusion=Stop.stop)
292
292
 
293
293
  def evaluate_next_rule(self, x: Case) -> Optional[Union[MultiClassStopRule, MultiClassTopRule]]:
294
294
  if self.fired:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ripple_down_rules
3
- Version: 0.1.63
3
+ Version: 0.1.64
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
@@ -4,17 +4,17 @@ ripple_down_rules/experts.py,sha256=TretkdR1IY2RjcSh4WJUFJtYEbItsand7SYFmzouE_Y,
4
4
  ripple_down_rules/failures.py,sha256=E6ajDUsw3Blom8eVLbA7d_Qnov2conhtZ0UmpQ9ZtSE,302
5
5
  ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
6
6
  ripple_down_rules/prompt.py,sha256=cHqhMJqubGhfGpOOY_uXv5L7PBNb64O0IBWSfiY0ui0,6682
7
- ripple_down_rules/rdr.py,sha256=Ts47r1Tf00tBDRKZu_0s-8o1kYn97Pc8M6uMIRPa-6s,47713
7
+ ripple_down_rules/rdr.py,sha256=tJDbPF3D2qJ5cw2WPmZrs_C2Jj6b7cCxEJDp2SK9GCI,47863
8
8
  ripple_down_rules/rdr_decorators.py,sha256=8SclpceI3EtrsbuukWJu8HGLh7Q1ZCgYGLX-RPlG-w0,2018
9
- ripple_down_rules/rules.py,sha256=KTB7kPnyyU9GuZhVe9ba25-3ICdzl46r9MFduckk-_Y,16147
9
+ ripple_down_rules/rules.py,sha256=4oQSb4p36A-YzW0hJ8HH2FhmIvokjXKK1rIXEn-8WcE,16203
10
10
  ripple_down_rules/utils.py,sha256=JIF99Knqzqjgny7unvEnib3sCmExqU-w9xYOSGIT86Q,32276
11
11
  ripple_down_rules/datastructures/__init__.py,sha256=V2aNgf5C96Y5-IGghra3n9uiefpoIm_QdT7cc_C8cxQ,111
12
12
  ripple_down_rules/datastructures/callable_expression.py,sha256=TW_u6CJfelW2CiJj9pWFpdOBNIxeEuhhsQEz_pLpFVE,9092
13
13
  ripple_down_rules/datastructures/case.py,sha256=uM5YkJOfYfARrZZ3oAxKMWE5QBSnvHLLZa9Atoxb7eY,13800
14
14
  ripple_down_rules/datastructures/dataclasses.py,sha256=_aabVXsgdVUeAmgGA9K_LZpO2U5a6-htrg2Tka7qc30,5960
15
15
  ripple_down_rules/datastructures/enums.py,sha256=RdyPUp9Ls1QuLmkcMMkBbCWrmXIZI4xWuM-cLPYZhR0,4666
16
- ripple_down_rules-0.1.63.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
17
- ripple_down_rules-0.1.63.dist-info/METADATA,sha256=jXq2PSfcC2cqtqrpIwt7zyyWLtKf3aUGD5EZH9_bYuA,42576
18
- ripple_down_rules-0.1.63.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
19
- ripple_down_rules-0.1.63.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
20
- ripple_down_rules-0.1.63.dist-info/RECORD,,
16
+ ripple_down_rules-0.1.64.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
17
+ ripple_down_rules-0.1.64.dist-info/METADATA,sha256=PChgWG-I8g-_yaKMDwrxJPuIHOe0fIrThGu_vOqrQkE,42576
18
+ ripple_down_rules-0.1.64.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
19
+ ripple_down_rules-0.1.64.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
20
+ ripple_down_rules-0.1.64.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5