ripple-down-rules 0.6.50__py3-none-any.whl → 0.6.52__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.6.50"
1
+ __version__ = "0.6.52"
2
2
 
3
3
  import logging
4
4
  import sys
@@ -130,8 +130,10 @@ class CallableExpression(SubclassJSONSerializer):
130
130
  conclusion_type = (conclusion_type,)
131
131
  self.conclusion_type = conclusion_type
132
132
  self.expected_types: Set[Type] = set(conclusion_type) if conclusion_type is not None else set()
133
- if not mutually_exclusive:
134
- self.expected_types.update({list, set})
133
+ if list in self.expected_types:
134
+ self.expected_types.remove(list)
135
+ if set in self.expected_types:
136
+ self.expected_types.add(set)
135
137
  self.scope: Optional[Dict[str, Any]] = scope if scope is not None else {}
136
138
  self.scope = get_used_scope(self.user_input, self.scope)
137
139
  self.expression_tree: AST = expression_tree if expression_tree else parse_string_to_expression(self.user_input)
@@ -149,6 +151,8 @@ class CallableExpression(SubclassJSONSerializer):
149
151
 
150
152
  def __call__(self, case: Any, **kwargs) -> Any:
151
153
  try:
154
+ # if not self.mutually_exclusive:
155
+ # self.expected_types.update({list, set})
152
156
  if self.user_input is not None:
153
157
  if not isinstance(case, Case):
154
158
  case = create_case(case, max_recursion_idx=3)
@@ -160,7 +164,6 @@ class CallableExpression(SubclassJSONSerializer):
160
164
  if self.mutually_exclusive and issubclass(type(output), (list, set)):
161
165
  raise ValueError(f"Mutually exclusive types cannot be lists or sets, got {type(output)}")
162
166
  output_types = {type(o) for o in make_list(output)}
163
- output_types.add(type(output))
164
167
  if not are_results_subclass_of_types(output_types, self.expected_types):
165
168
  raise ValueError(f"Not all result types {output_types} are subclasses of expected types"
166
169
  f" {self.conclusion_type}")
@@ -102,8 +102,7 @@ class RDRDecorator:
102
102
  """
103
103
  This is used to refer to the output value of the decorated function, this is used as part of the case as input to
104
104
  the rdr model, but is never used in the rule logic to prevent cycles from happening. The correct way to use the
105
- output of an rdr in the rules logic is in the case when mutually exclusive is False, or through refinements of
106
- existing rules when mutually exclusive is True, which happens automatically by the rdr prompting for refinements.
105
+ output of an rdr is through refinement rules which happens automatically by the rdr prompting for refinements.
107
106
  """
108
107
  _not_none_output_found: bool = field(init=False, default=False)
109
108
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ripple_down_rules
3
- Version: 0.6.50
3
+ Version: 0.6.52
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,14 +1,14 @@
1
- ripple_down_rules/__init__.py,sha256=6EQLRCLTgXJBkkqQ-9rcFfDRgNFPMVqlW-ofOWDjfAY,375
1
+ ripple_down_rules/__init__.py,sha256=GH4Ku_L8c0eUJ_iMXuftu5szxDlmbFtZCU6pBHMvtm4,375
2
2
  ripple_down_rules/experts.py,sha256=KXwWCmDrCffu9HW3yNewqWc1e5rnPI5Rnc981w_5M7U,17896
3
3
  ripple_down_rules/failures.py,sha256=ZPypPwKjyVcJkY9YG6p538ld8ZzpdW6CrC1RmJi44Ek,42
4
4
  ripple_down_rules/helpers.py,sha256=sVU1Q7HPbMh57X8zDYP6vj1maDoaVAvnXHpUYIbr_As,5715
5
5
  ripple_down_rules/rdr.py,sha256=M7CEjHIegJWiDZtn-B8Qf9CpMvplAkrFX3HiiyGQC7M,84292
6
- ripple_down_rules/rdr_decorators.py,sha256=H3ONvgTSgL5LS_Nv_hKAYY2nkqvn7KZ1zmIzIDi07dA,11870
6
+ ripple_down_rules/rdr_decorators.py,sha256=mu7pZM6tqjkjoKg1m4f5yXhaRL8RiZu75ABaU275qTY,11751
7
7
  ripple_down_rules/rules.py,sha256=L4Ws-x3g5ljE0GrDt4LAib2qtR1C1_Ra4cRcIB-IQDI,28702
8
8
  ripple_down_rules/start-code-server.sh,sha256=otClk7VmDgBOX2TS_cjws6K0UwvgAUJhoA0ugkPCLqQ,949
9
9
  ripple_down_rules/utils.py,sha256=5UL4h-m5Q4l7RyCYqmUmDDxUAkFqPYpFa3QldDYoJUE,80752
10
10
  ripple_down_rules/datastructures/__init__.py,sha256=V2aNgf5C96Y5-IGghra3n9uiefpoIm_QdT7cc_C8cxQ,111
11
- ripple_down_rules/datastructures/callable_expression.py,sha256=rzMrpD5oztaCRlt3hQ2B_xZ09cSuJNkYOCePndfQJRA,13684
11
+ ripple_down_rules/datastructures/callable_expression.py,sha256=Eq8_9wlFIZex3Y3htwg-AKu-B7053f0Qk6dvMo1Nlts,13815
12
12
  ripple_down_rules/datastructures/case.py,sha256=dfLnrjsHIVF2bgbz-4ID7OdQvw68V71btCeTK372P-g,15667
13
13
  ripple_down_rules/datastructures/dataclasses.py,sha256=3vX52WrAHgVyw0LUSgSBOVFaQNTSxU8hQpdr7cW-tSg,13278
14
14
  ripple_down_rules/datastructures/enums.py,sha256=CvcROl8fE7A6uTbMfs2lLpyxwS_ZFtFcQlBDDKFfoHc,6059
@@ -18,8 +18,8 @@ ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=GQf5Je5szkPH17g4
18
18
  ripple_down_rules/user_interface/object_diagram.py,sha256=FEa2HaYR9QmTE6NsOwBvZ0jqmu3DKyg6mig2VE5ZP4Y,4956
19
19
  ripple_down_rules/user_interface/prompt.py,sha256=WPbw_8_-8SpF2ISyRZRuFwPKBEuGC4HaX3lbCPFHhh8,10314
20
20
  ripple_down_rules/user_interface/template_file_creator.py,sha256=uSbosZS15MOR3Nv7M3MrFuoiKXyP4cBId-EK3I6stHM,13660
21
- ripple_down_rules-0.6.50.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
22
- ripple_down_rules-0.6.50.dist-info/METADATA,sha256=LVOjG94lFcXLJD80mILahLyK1sYrsHEsDogeKg-PBSU,48294
23
- ripple_down_rules-0.6.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- ripple_down_rules-0.6.50.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
25
- ripple_down_rules-0.6.50.dist-info/RECORD,,
21
+ ripple_down_rules-0.6.52.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
22
+ ripple_down_rules-0.6.52.dist-info/METADATA,sha256=BF5LsZwZ4dTyKXFs0zjAjWfh9Kvzj5wdfIbJXgEenVU,48294
23
+ ripple_down_rules-0.6.52.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ ripple_down_rules-0.6.52.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
25
+ ripple_down_rules-0.6.52.dist-info/RECORD,,