ripple-down-rules 0.5.60__py3-none-any.whl → 0.5.61__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/experts.py +8 -1
- {ripple_down_rules-0.5.60.dist-info → ripple_down_rules-0.5.61.dist-info}/METADATA +1 -1
- {ripple_down_rules-0.5.60.dist-info → ripple_down_rules-0.5.61.dist-info}/RECORD +7 -7
- {ripple_down_rules-0.5.60.dist-info → ripple_down_rules-0.5.61.dist-info}/WHEEL +0 -0
- {ripple_down_rules-0.5.60.dist-info → ripple_down_rules-0.5.61.dist-info}/licenses/LICENSE +0 -0
- {ripple_down_rules-0.5.60.dist-info → ripple_down_rules-0.5.61.dist-info}/top_level.txt +0 -0
ripple_down_rules/__init__.py
CHANGED
ripple_down_rules/experts.py
CHANGED
@@ -138,7 +138,12 @@ class Expert(ABC):
|
|
138
138
|
os.makedirs(dir_name, exist_ok=True)
|
139
139
|
with open(dir_name + '/__init__.py', 'w') as f:
|
140
140
|
f.write('# This is an empty init file to make the directory a package.\n')
|
141
|
-
|
141
|
+
# Current file data
|
142
|
+
current_file_data = None
|
143
|
+
if os.path.exists(path + '.py'):
|
144
|
+
with open(path + '.py', 'r') as f:
|
145
|
+
current_file_data = f.read()
|
146
|
+
action = 'a' if self.append and current_file_data is not None else 'w'
|
142
147
|
with open(path + '.py', action) as f:
|
143
148
|
for scope, func_source in self.all_expert_answers:
|
144
149
|
if len(scope) > 0:
|
@@ -150,6 +155,8 @@ class Expert(ABC):
|
|
150
155
|
func_source = encapsulate_user_input(func_source, CallableExpression.get_encapsulating_function(f'_{uid}'))
|
151
156
|
else:
|
152
157
|
func_source = 'pass # No user input provided for this case.\n'
|
158
|
+
if func_source[1:] in current_file_data:
|
159
|
+
continue
|
153
160
|
f.write(imports + func_source + '\n' + '\n\n\n\'===New Answer===\'\n\n\n')
|
154
161
|
|
155
162
|
def load_answers(self, path: Optional[str] = None):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.61
|
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,5 +1,5 @@
|
|
1
|
-
ripple_down_rules/__init__.py,sha256=
|
2
|
-
ripple_down_rules/experts.py,sha256=
|
1
|
+
ripple_down_rules/__init__.py,sha256=HTMMmCE5AYEKizCjLFu9IPmEvRHJS3yrXE380eC2jus,100
|
2
|
+
ripple_down_rules/experts.py,sha256=9SDkyJGtmx-YaSCqWw727do09DwrRIbLrkheP625aXE,12576
|
3
3
|
ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
|
4
4
|
ripple_down_rules/rdr.py,sha256=4iobla4XmMwAOQsn_JZaZe2tWU0aMMvqgzP5WavIagI,49280
|
5
5
|
ripple_down_rules/rdr_decorators.py,sha256=bmn4h4a7xujTVxu-ofECe71cM_6iiqZhLVFosEItid4,7602
|
@@ -17,8 +17,8 @@ ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=24MIFwqnAhC6ofOb
|
|
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
19
|
ripple_down_rules/user_interface/template_file_creator.py,sha256=FGtLfYBfr4310c7Dfa9b2qiOWLNzHk1q3kdhD70Ilg4,13804
|
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.61.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
21
|
+
ripple_down_rules-0.5.61.dist-info/METADATA,sha256=2RMPipq0IAqfsMJdijKW-JSYCKpLtmYSnXf6_BTC3BQ,48189
|
22
|
+
ripple_down_rules-0.5.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ripple_down_rules-0.5.61.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
|
24
|
+
ripple_down_rules-0.5.61.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|