ripple-down-rules 0.4.84__py3-none-any.whl → 0.4.86__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/datastructures/case.py +1 -1
- ripple_down_rules/rdr.py +5 -11
- ripple_down_rules/user_interface/gui.py +1 -2
- ripple_down_rules/user_interface/ipython_custom_shell.py +1 -1
- ripple_down_rules/user_interface/template_file_creator.py +1 -3
- {ripple_down_rules-0.4.84.dist-info → ripple_down_rules-0.4.86.dist-info}/METADATA +6 -5
- {ripple_down_rules-0.4.84.dist-info → ripple_down_rules-0.4.86.dist-info}/RECORD +11 -11
- {ripple_down_rules-0.4.84.dist-info → ripple_down_rules-0.4.86.dist-info}/WHEEL +0 -0
- {ripple_down_rules-0.4.84.dist-info → ripple_down_rules-0.4.86.dist-info}/licenses/LICENSE +0 -0
- {ripple_down_rules-0.4.84.dist-info → ripple_down_rules-0.4.86.dist-info}/top_level.txt +0 -0
ripple_down_rules/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.4.
|
1
|
+
__version__ = "0.4.86"
|
@@ -7,7 +7,7 @@ from enum import Enum
|
|
7
7
|
|
8
8
|
from pandas import DataFrame
|
9
9
|
from sqlalchemy import MetaData
|
10
|
-
from sqlalchemy.orm import DeclarativeBase as SQLTable,
|
10
|
+
from sqlalchemy.orm import DeclarativeBase as SQLTable, registry
|
11
11
|
from typing_extensions import Any, Optional, Dict, Type, Set, Hashable, Union, List, TYPE_CHECKING
|
12
12
|
|
13
13
|
from ..utils import make_set, row_to_dict, table_rows_as_str, get_value_type_from_type_hint, SubclassJSONSerializer, \
|
ripple_down_rules/rdr.py
CHANGED
@@ -360,15 +360,13 @@ class RDRWithCodeWriter(RippleDownRules, ABC):
|
|
360
360
|
return importlib.import_module(name).classify
|
361
361
|
|
362
362
|
@property
|
363
|
-
def _default_generated_python_file_name(self) -> str:
|
363
|
+
def _default_generated_python_file_name(self) -> Optional[str]:
|
364
364
|
"""
|
365
365
|
:return: The default generated python file name.
|
366
366
|
"""
|
367
|
-
if
|
368
|
-
|
369
|
-
|
370
|
-
name = self.start_rule.corner_case.__class__.__name__
|
371
|
-
return f"{name.lower()}_{self.attribute_name}_{self.acronym.lower()}"
|
367
|
+
if self.start_rule is None or self.start_rule.conclusion is None:
|
368
|
+
return None
|
369
|
+
return f"{self.case_type.__name__.lower()}_{self.attribute_name}_{self.acronym.lower()}"
|
372
370
|
|
373
371
|
@property
|
374
372
|
def generated_python_defs_file_name(self) -> str:
|
@@ -958,11 +956,7 @@ class GeneralRDR(RippleDownRules):
|
|
958
956
|
"""
|
959
957
|
if self.start_rule is None or self.start_rule.conclusion is None:
|
960
958
|
return None
|
961
|
-
|
962
|
-
name = self.start_rule.corner_case._name
|
963
|
-
else:
|
964
|
-
name = self.start_rule.corner_case.__class__.__name__
|
965
|
-
return f"{name}_rdr".lower()
|
959
|
+
return f"{self.case_type.__name__.lower()}_rdr".lower()
|
966
960
|
|
967
961
|
@property
|
968
962
|
def conclusion_type_hint(self) -> str:
|
@@ -473,8 +473,7 @@ class RDRCaseViewer(QMainWindow):
|
|
473
473
|
self.close()
|
474
474
|
|
475
475
|
def _edit(self):
|
476
|
-
self.template_file_creator = TemplateFileCreator(self.
|
477
|
-
self.case_query, self.prompt_for, self.code_to_modify,
|
476
|
+
self.template_file_creator = TemplateFileCreator(self.case_query, self.prompt_for, self.code_to_modify,
|
478
477
|
self.print)
|
479
478
|
self.template_file_creator.edit()
|
480
479
|
|
@@ -20,7 +20,7 @@ class MyMagics(Magics):
|
|
20
20
|
prompt_for: Optional[PromptFor] = None,
|
21
21
|
case_query: Optional[CaseQuery] = None):
|
22
22
|
super().__init__(shell)
|
23
|
-
self.rule_editor = TemplateFileCreator(
|
23
|
+
self.rule_editor = TemplateFileCreator(case_query, prompt_for=prompt_for, code_to_modify=code_to_modify)
|
24
24
|
self.all_code_lines: Optional[List[str]] = None
|
25
25
|
|
26
26
|
@line_magic
|
@@ -8,7 +8,6 @@ from functools import cached_property
|
|
8
8
|
from textwrap import indent, dedent
|
9
9
|
|
10
10
|
from colorama import Fore, Style
|
11
|
-
from ipykernel.inprocess.ipkernel import InProcessInteractiveShell
|
12
11
|
from typing_extensions import Optional, Type, List, Callable, Tuple, Dict
|
13
12
|
|
14
13
|
from ..datastructures.case import Case
|
@@ -73,10 +72,9 @@ class TemplateFileCreator:
|
|
73
72
|
The list of all code lines in the function in the temporary file.
|
74
73
|
"""
|
75
74
|
|
76
|
-
def __init__(self,
|
75
|
+
def __init__(self, case_query: CaseQuery, prompt_for: PromptFor,
|
77
76
|
code_to_modify: Optional[str] = None, print_func: Callable[[str], None] = print):
|
78
77
|
self.print_func = print_func
|
79
|
-
self.shell = shell
|
80
78
|
self.code_to_modify = code_to_modify
|
81
79
|
self.prompt_for = prompt_for
|
82
80
|
self.case_query = case_query
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.86
|
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
|
@@ -691,19 +691,20 @@ Requires-Dist: ipython
|
|
691
691
|
Requires-Dist: requests
|
692
692
|
Requires-Dist: colorama
|
693
693
|
Requires-Dist: pygments
|
694
|
+
Requires-Dist: sqlalchemy
|
695
|
+
Requires-Dist: pandas
|
694
696
|
Provides-Extra: gui
|
695
697
|
Requires-Dist: pyqt6; extra == "gui"
|
696
698
|
Requires-Dist: qtconsole; extra == "gui"
|
697
|
-
Provides-Extra:
|
698
|
-
Requires-Dist: matplotlib; extra == "
|
699
|
-
Requires-Dist: networkx; extra == "
|
699
|
+
Provides-Extra: viz
|
700
|
+
Requires-Dist: matplotlib; extra == "viz"
|
701
|
+
Requires-Dist: networkx; extra == "viz"
|
700
702
|
Provides-Extra: dev
|
701
703
|
Requires-Dist: pyqt6; extra == "dev"
|
702
704
|
Requires-Dist: qtconsole; extra == "dev"
|
703
705
|
Requires-Dist: matplotlib; extra == "dev"
|
704
706
|
Requires-Dist: networkx; extra == "dev"
|
705
707
|
Requires-Dist: pytest; extra == "dev"
|
706
|
-
Requires-Dist: sqlalchemy; extra == "dev"
|
707
708
|
Requires-Dist: ucimlrepo>=0.0.7; extra == "dev"
|
708
709
|
Requires-Dist: pdbpp; extra == "dev"
|
709
710
|
Dynamic: license-file
|
@@ -1,26 +1,26 @@
|
|
1
|
-
ripple_down_rules/__init__.py,sha256=
|
1
|
+
ripple_down_rules/__init__.py,sha256=v-1F6x1Q2QlDiOWgzsCkkSZVyHAeRboirfjTWeRqJxo,22
|
2
2
|
ripple_down_rules/datasets.py,sha256=fJbZ7V-UUYTu5XVVpFinTbuzN3YePCnUB01L3AyZVM8,6837
|
3
3
|
ripple_down_rules/experts.py,sha256=RWDR-xxbeFIrUQiMYLEDr_PLQFdpPZ-hOXo4dpeiUpI,6630
|
4
4
|
ripple_down_rules/failures.py,sha256=E6ajDUsw3Blom8eVLbA7d_Qnov2conhtZ0UmpQ9ZtSE,302
|
5
5
|
ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
|
6
|
-
ripple_down_rules/rdr.py,sha256=
|
6
|
+
ripple_down_rules/rdr.py,sha256=zQiWHUw8Qq-FPuKHdBErZUhh8zqiB6UCBi1kWZx5cJE,45511
|
7
7
|
ripple_down_rules/rdr_decorators.py,sha256=VdmE0JrE8j89b6Af1R1tLZiKfy3h1VCvhAUefN_FLLQ,6753
|
8
8
|
ripple_down_rules/rules.py,sha256=7NB8qWW7XEB45tmJRYsKJqBG8DN3v02fzAFYmOkX8ow,17458
|
9
9
|
ripple_down_rules/start-code-server.sh,sha256=otClk7VmDgBOX2TS_cjws6K0UwvgAUJhoA0ugkPCLqQ,949
|
10
10
|
ripple_down_rules/utils.py,sha256=iM2bYRYanuWTnq7dflRar8tMwRxL88B__hWkayGLVz4,50675
|
11
11
|
ripple_down_rules/datastructures/__init__.py,sha256=V2aNgf5C96Y5-IGghra3n9uiefpoIm_QdT7cc_C8cxQ,111
|
12
12
|
ripple_down_rules/datastructures/callable_expression.py,sha256=jA7424_mWPbOoPICW3eLMX0-ypxnsW6gOqxrJ7JpDbE,11610
|
13
|
-
ripple_down_rules/datastructures/case.py,sha256=
|
13
|
+
ripple_down_rules/datastructures/case.py,sha256=3nGeTv9JYpnRSmsHCt61qo1QT4d9Dfkl9KrZ7I6E2kk,15164
|
14
14
|
ripple_down_rules/datastructures/dataclasses.py,sha256=GWnUF4h4zfNHSsyBIz3L9y8sLkrXRv0FK_OxzzLc8L8,8183
|
15
15
|
ripple_down_rules/datastructures/enums.py,sha256=ce7tqS0otfSTNAOwsnXlhsvIn4iW_Y_N3TNebF3YoZs,5700
|
16
16
|
ripple_down_rules/user_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
ripple_down_rules/user_interface/gui.py,sha256=
|
18
|
-
ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=
|
17
|
+
ripple_down_rules/user_interface/gui.py,sha256=SB0gUhgReJ3yx-NEHRPMGVuNRLPRUwW8-qup-Kd4Cfo,27182
|
18
|
+
ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=24MIFwqnAhC6ofObEO6x5xRWRnyQmPpPmTvxbCKBrzM,6514
|
19
19
|
ripple_down_rules/user_interface/object_diagram.py,sha256=tsB6iuLNEbHxp5lR2WjyejjWbnAX_nHF9xS8jNPOQVk,4548
|
20
20
|
ripple_down_rules/user_interface/prompt.py,sha256=AkkltdDIaioN43lkRKDPKSjJcmdSSGZDMYz7AL7X9lE,8082
|
21
|
-
ripple_down_rules/user_interface/template_file_creator.py,sha256
|
22
|
-
ripple_down_rules-0.4.
|
23
|
-
ripple_down_rules-0.4.
|
24
|
-
ripple_down_rules-0.4.
|
25
|
-
ripple_down_rules-0.4.
|
26
|
-
ripple_down_rules-0.4.
|
21
|
+
ripple_down_rules/user_interface/template_file_creator.py,sha256=J_bBOJltc1fsrIYeHdrSUA_jep2DhDbTK5NYRbL6QyY,13831
|
22
|
+
ripple_down_rules-0.4.86.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
23
|
+
ripple_down_rules-0.4.86.dist-info/METADATA,sha256=OZ1QS5AnJFolHEoUSn_b88yB7jX2SN3Kanyr6u_Y9oY,43598
|
24
|
+
ripple_down_rules-0.4.86.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
25
|
+
ripple_down_rules-0.4.86.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
|
26
|
+
ripple_down_rules-0.4.86.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|