ripple-down-rules 0.5.82__py3-none-any.whl → 0.5.83__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/__init__.py +1 -1
- ripple_down_rules/rdr_decorators.py +8 -4
- {ripple_down_rules-0.5.82.dist-info → ripple_down_rules-0.5.83.dist-info}/METADATA +1 -1
- {ripple_down_rules-0.5.82.dist-info → ripple_down_rules-0.5.83.dist-info}/RECORD +7 -7
- {ripple_down_rules-0.5.82.dist-info → ripple_down_rules-0.5.83.dist-info}/WHEEL +0 -0
- {ripple_down_rules-0.5.82.dist-info → ripple_down_rules-0.5.83.dist-info}/licenses/LICENSE +0 -0
- {ripple_down_rules-0.5.82.dist-info → ripple_down_rules-0.5.83.dist-info}/top_level.txt +0 -0
ripple_down_rules/__init__.py
CHANGED
@@ -31,7 +31,8 @@ class RDRDecorator:
|
|
31
31
|
expert: Optional[Expert] = None,
|
32
32
|
ask_always: bool = False,
|
33
33
|
update_existing_rules: bool = True,
|
34
|
-
viewer: Optional[RDRCaseViewer] = None
|
34
|
+
viewer: Optional[RDRCaseViewer] = None,
|
35
|
+
package_name: Optional[str] = None):
|
35
36
|
"""
|
36
37
|
:param models_dir: The directory to save/load the RDR models.
|
37
38
|
:param output_type: The type of the output. This is used to create the RDR model.
|
@@ -46,6 +47,8 @@ class RDRDecorator:
|
|
46
47
|
:param ask_always: If True, the function will ask the user for a target if it doesn't exist.
|
47
48
|
:param update_existing_rules: If True, the function will update the existing RDR rules
|
48
49
|
even if they gave an output.
|
50
|
+
:param viewer: The viewer to use for the RDR model. If None, no viewer will be used.
|
51
|
+
:param package_name: The package name to use for relative imports in the RDR model.
|
49
52
|
:return: A decorator to use a GeneralRDR as a classifier that monitors and modifies the function's output.
|
50
53
|
"""
|
51
54
|
self.rdr_models_dir = models_dir
|
@@ -59,6 +62,7 @@ class RDRDecorator:
|
|
59
62
|
self.ask_always = ask_always
|
60
63
|
self.update_existing_rules = update_existing_rules
|
61
64
|
self.viewer = viewer
|
65
|
+
self.package_name = package_name
|
62
66
|
self.load()
|
63
67
|
|
64
68
|
def decorator(self, func: Callable) -> Callable:
|
@@ -166,7 +170,7 @@ class RDRDecorator:
|
|
166
170
|
"""
|
167
171
|
Save the RDR model to the specified directory.
|
168
172
|
"""
|
169
|
-
self.rdr.save(self.rdr_models_dir)
|
173
|
+
self.rdr.save(self.rdr_models_dir, package_name=self.package_name)
|
170
174
|
|
171
175
|
def load(self):
|
172
176
|
"""
|
@@ -176,7 +180,7 @@ class RDRDecorator:
|
|
176
180
|
if self.model_name is not None:
|
177
181
|
model_path = os.path.join(self.rdr_models_dir, self.model_name + f"/rdr_metadata/{self.model_name}.json")
|
178
182
|
if os.path.exists(os.path.join(self.rdr_models_dir, model_path)):
|
179
|
-
self.rdr = GeneralRDR.load(self.rdr_models_dir, self.model_name)
|
183
|
+
self.rdr = GeneralRDR.load(self.rdr_models_dir, self.model_name, package_name=self.package_name)
|
180
184
|
self.rdr.set_viewer(self.viewer)
|
181
185
|
if self.rdr is None:
|
182
186
|
self.rdr = GeneralRDR(save_dir=self.rdr_models_dir, model_name=self.model_name,
|
@@ -186,4 +190,4 @@ class RDRDecorator:
|
|
186
190
|
"""
|
187
191
|
Update the RDR model from a python file.
|
188
192
|
"""
|
189
|
-
self.rdr.update_from_python(self.rdr_models_dir, self.model_name)
|
193
|
+
self.rdr.update_from_python(self.rdr_models_dir, self.model_name, package_name=self.package_name)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.83
|
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,8 +1,8 @@
|
|
1
|
-
ripple_down_rules/__init__.py,sha256=
|
1
|
+
ripple_down_rules/__init__.py,sha256=xixYpXbV9gGErJuj1TxFPGGMaaFTOvzOpHpkn65VVoU,100
|
2
2
|
ripple_down_rules/experts.py,sha256=bwozulI1rv0uyaMZQqEgapDO-s8wvW0D6Jqxmvu5fik,12610
|
3
3
|
ripple_down_rules/helpers.py,sha256=v4oE7C5PfQUVJfSUs1FfLHEwrJXEHJLn4vJhJMvyCR8,4453
|
4
4
|
ripple_down_rules/rdr.py,sha256=C6bvlq6MsKa2Mym1wW6JUMj705aCaoihTP279TM6eT0,55218
|
5
|
-
ripple_down_rules/rdr_decorators.py,sha256=
|
5
|
+
ripple_down_rules/rdr_decorators.py,sha256=amXUjgc-rfYxPKFW16Xm8Z9vfaaslNl5OvDOg9fKaTg,9447
|
6
6
|
ripple_down_rules/rules.py,sha256=iVevv6iZ-6L2IPI0ZYbBjxBymXEQMmJGRFhiKUS-NmA,20352
|
7
7
|
ripple_down_rules/start-code-server.sh,sha256=otClk7VmDgBOX2TS_cjws6K0UwvgAUJhoA0ugkPCLqQ,949
|
8
8
|
ripple_down_rules/utils.py,sha256=ikzlXjgBWM95dgL-idzeWcYyZs2IAwgA5BXMNRoKE2w,60144
|
@@ -17,8 +17,8 @@ ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=Jrf7NxOdlrwGXH0X
|
|
17
17
|
ripple_down_rules/user_interface/object_diagram.py,sha256=FEa2HaYR9QmTE6NsOwBvZ0jqmu3DKyg6mig2VE5ZP4Y,4956
|
18
18
|
ripple_down_rules/user_interface/prompt.py,sha256=AkkltdDIaioN43lkRKDPKSjJcmdSSGZDMYz7AL7X9lE,8082
|
19
19
|
ripple_down_rules/user_interface/template_file_creator.py,sha256=xWUt-RHRqrvoMo74o-bMLo8xNxil68wgbOZAMADZp2A,13570
|
20
|
-
ripple_down_rules-0.5.
|
21
|
-
ripple_down_rules-0.5.
|
22
|
-
ripple_down_rules-0.5.
|
23
|
-
ripple_down_rules-0.5.
|
24
|
-
ripple_down_rules-0.5.
|
20
|
+
ripple_down_rules-0.5.83.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
21
|
+
ripple_down_rules-0.5.83.dist-info/METADATA,sha256=PGZ_KSayeTFDv3fTPBln3u3AzWwilfHgRdkHz5i-dv8,48214
|
22
|
+
ripple_down_rules-0.5.83.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ripple_down_rules-0.5.83.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
|
24
|
+
ripple_down_rules-0.5.83.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|