ripple-down-rules 0.5.0__tar.gz → 0.5.1__tar.gz
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-0.5.1/.github/workflows/ci.yml +41 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/PKG-INFO +3 -2
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/README.md +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/examples/readme_example.py +1 -1
- ripple_down_rules-0.5.1/requirements-dev-ci.txt +4 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/requirements.txt +2 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/__init__.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/PKG-INFO +3 -2
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/SOURCES.txt +3 -3
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/requires.txt +1 -0
- {ripple_down_rules-0.5.0/src/ripple_down_rules → ripple_down_rules-0.5.1/test}/datasets.py +6 -12
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_helpers/helpers.py +2 -2
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_json_serialization.py +2 -4
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_object_diagram.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_rdr.py +6 -4
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_rdr_alchemy.py +2 -2
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_rdr_decorators.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_rdr_world.py +12 -6
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_relational_rdr.py +2 -3
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr_defs.py +2 -2
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_is_a_robot/rdr_metadata/datasets_physical_object_is_a_robot.json +6 -6
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_output__mcrdr.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_output__mcrdr_defs.py +3 -3
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/rdr_metadata/datasets_physical_object_select_objects_that_are_parts_of_robot.json +7 -7
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_sql_model.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_template_file_creator.py +1 -1
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_user_interface/test_qt_gui_inline.py +13 -8
- ripple_down_rules-0.5.0/test/test_user_interface/test_pdb.py +0 -37
- ripple_down_rules-0.5.0/test/test_user_interface/test_qt_gui.py +0 -333
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]/shelved.patch +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]1/shelved.patch +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/LICENSE +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/images/thinking_pr2.jpg +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/pyproject.toml +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/pytest.ini +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/requirements-dev.txt +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/requirements-gui.txt +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/requirements-viz.txt +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_stop_only.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_stop_only.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_stop_plus_rule.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_mcrdr_stop_plus_rule.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr_2.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr_2.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr_3.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/complete_scrdr_3.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/grdr_Habitat.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/grdr_Habitat.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/grdr_Species.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/grdr_Species.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_extra.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_extra_classify.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_extra_classify.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_stop_plus_rule_combined.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/mcrdr_stop_plus_rule_combined.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/partial_mcrdr_extra.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/partial_mcrdr_extra.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/relational_scrdr_classify.dot +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/results/relational_scrdr_classify.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/setup.cfg +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/datastructures/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/datastructures/callable_expression.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/datastructures/case.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/datastructures/dataclasses.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/datastructures/enums.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/experts.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/failures.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/helpers.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/rdr.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/rdr_decorators.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/rules.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/start-code-server.sh +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/gui.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/ipython_custom_shell.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/object_diagram.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/prompt.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/user_interface/template_file_creator.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules/utils.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/dependency_links.txt +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/top_level.txt +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/correct_drawer_rdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/grdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/grdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/grdr_expert_answers_fit_extra.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/grdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_expert_answers_stop_only_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_extra_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_extra_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_stop_only_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_stop_plus_rule_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_stop_plus_rule_combined_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mcrdr_stop_plus_rule_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/mutagenic_expert_answers.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/relational_scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/scrdr_expert_answers_classify.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/scrdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/scrdr_expert_answers_fit_no_targets.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/scrdr_multi_line_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/scrdr_world_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_expert_answers/view_rdr_expert_answers_fit.json +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_generated_rdrs/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_helpers/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_helpers/object_diagram_case_query.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_helpers/object_diagram_person.png +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_on_mutagenic.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_relational_rdr_alchemy.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_is_a_robot/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_rdr.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/physical_object_select_objects_that_are_parts_of_robot_rdr.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_user_interface/__init__.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_user_interface/test_ipython.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_user_interface/test_ipython_copilot.py +0 -0
- {ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_utils.py +0 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
# .github/workflows/ci.yml
|
2
|
+
name: CI
|
3
|
+
|
4
|
+
on:
|
5
|
+
push:
|
6
|
+
branches: [ main ]
|
7
|
+
pull_request:
|
8
|
+
branches: [ main ]
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
test:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
python-version: ['3.10']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v3
|
19
|
+
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
21
|
+
uses: actions/setup-python@v4
|
22
|
+
with:
|
23
|
+
python-version: ${{ matrix.python-version }}
|
24
|
+
|
25
|
+
- name: Install dependencies
|
26
|
+
run: |
|
27
|
+
sudo apt-get update
|
28
|
+
sudo apt install graphviz graphviz-dev
|
29
|
+
python -m pip install --upgrade pip
|
30
|
+
pip install virtualenv
|
31
|
+
python -m virtualenv venv
|
32
|
+
source venv/bin/activate
|
33
|
+
pip install -r requirements-dev-ci.txt
|
34
|
+
pip install pytest mypy flake8 black isort
|
35
|
+
pip install .
|
36
|
+
|
37
|
+
- name: Run tests
|
38
|
+
run: |
|
39
|
+
source venv/bin/activate
|
40
|
+
cd test
|
41
|
+
pytest
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.1
|
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
|
@@ -693,6 +693,7 @@ Requires-Dist: colorama
|
|
693
693
|
Requires-Dist: pygments
|
694
694
|
Requires-Dist: sqlalchemy
|
695
695
|
Requires-Dist: pandas
|
696
|
+
Requires-Dist: pyparsing
|
696
697
|
Provides-Extra: viz
|
697
698
|
Requires-Dist: networkx>=3.1; extra == "viz"
|
698
699
|
Requires-Dist: matplotlib>=3.7.5; extra == "viz"
|
@@ -735,7 +736,7 @@ and render the tree to a file:
|
|
735
736
|
```python
|
736
737
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
737
738
|
from ripple_down_rules.rdr import SingleClassRDR
|
738
|
-
from
|
739
|
+
from datasets import load_zoo_dataset
|
739
740
|
from ripple_down_rules.utils import render_tree
|
740
741
|
|
741
742
|
all_cases, targets = load_zoo_dataset()
|
@@ -32,7 +32,7 @@ and render the tree to a file:
|
|
32
32
|
```python
|
33
33
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
34
34
|
from ripple_down_rules.rdr import SingleClassRDR
|
35
|
-
from
|
35
|
+
from datasets import load_zoo_dataset
|
36
36
|
from ripple_down_rules.utils import render_tree
|
37
37
|
|
38
38
|
all_cases, targets = load_zoo_dataset()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
2
2
|
from ripple_down_rules.rdr import SingleClassRDR
|
3
|
-
from
|
3
|
+
from datasets import load_zoo_dataset
|
4
4
|
from ripple_down_rules.utils import render_tree
|
5
5
|
|
6
6
|
all_cases, targets = load_zoo_dataset()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.1
|
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
|
@@ -693,6 +693,7 @@ Requires-Dist: colorama
|
|
693
693
|
Requires-Dist: pygments
|
694
694
|
Requires-Dist: sqlalchemy
|
695
695
|
Requires-Dist: pandas
|
696
|
+
Requires-Dist: pyparsing
|
696
697
|
Provides-Extra: viz
|
697
698
|
Requires-Dist: networkx>=3.1; extra == "viz"
|
698
699
|
Requires-Dist: matplotlib>=3.7.5; extra == "viz"
|
@@ -735,7 +736,7 @@ and render the tree to a file:
|
|
735
736
|
```python
|
736
737
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
737
738
|
from ripple_down_rules.rdr import SingleClassRDR
|
738
|
-
from
|
739
|
+
from datasets import load_zoo_dataset
|
739
740
|
from ripple_down_rules.utils import render_tree
|
740
741
|
|
741
742
|
all_cases, targets = load_zoo_dataset()
|
{ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/src/ripple_down_rules.egg-info/SOURCES.txt
RENAMED
@@ -2,10 +2,12 @@ LICENSE
|
|
2
2
|
README.md
|
3
3
|
pyproject.toml
|
4
4
|
pytest.ini
|
5
|
+
requirements-dev-ci.txt
|
5
6
|
requirements-dev.txt
|
6
7
|
requirements-gui.txt
|
7
8
|
requirements-viz.txt
|
8
9
|
requirements.txt
|
10
|
+
.github/workflows/ci.yml
|
9
11
|
.github/workflows/publish-to-test-pypi.yml
|
10
12
|
.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]/shelved.patch
|
11
13
|
.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]1/shelved.patch
|
@@ -38,7 +40,6 @@ results/partial_mcrdr_extra.png
|
|
38
40
|
results/relational_scrdr_classify.dot
|
39
41
|
results/relational_scrdr_classify.png
|
40
42
|
src/ripple_down_rules/__init__.py
|
41
|
-
src/ripple_down_rules/datasets.py
|
42
43
|
src/ripple_down_rules/experts.py
|
43
44
|
src/ripple_down_rules/failures.py
|
44
45
|
src/ripple_down_rules/helpers.py
|
@@ -63,6 +64,7 @@ src/ripple_down_rules/user_interface/ipython_custom_shell.py
|
|
63
64
|
src/ripple_down_rules/user_interface/object_diagram.py
|
64
65
|
src/ripple_down_rules/user_interface/prompt.py
|
65
66
|
src/ripple_down_rules/user_interface/template_file_creator.py
|
67
|
+
test/datasets.py
|
66
68
|
test/test_json_serialization.py
|
67
69
|
test/test_object_diagram.py
|
68
70
|
test/test_on_mutagenic.py
|
@@ -116,6 +118,4 @@ test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robo
|
|
116
118
|
test/test_user_interface/__init__.py
|
117
119
|
test/test_user_interface/test_ipython.py
|
118
120
|
test/test_user_interface/test_ipython_copilot.py
|
119
|
-
test/test_user_interface/test_pdb.py
|
120
|
-
test/test_user_interface/test_qt_gui.py
|
121
121
|
test/test_user_interface/test_qt_gui_inline.py
|
@@ -10,9 +10,9 @@ from sqlalchemy.orm import MappedAsDataclass, Mapped, mapped_column, relationshi
|
|
10
10
|
from typing_extensions import Tuple, List, Set, Optional, Self
|
11
11
|
from ucimlrepo import fetch_ucirepo
|
12
12
|
|
13
|
-
from .datastructures.case import Case, create_cases_from_dataframe
|
14
|
-
from .datastructures.enums import Category
|
15
|
-
from .rdr_decorators import RDRDecorator
|
13
|
+
from ripple_down_rules.datastructures.case import Case, create_cases_from_dataframe
|
14
|
+
from ripple_down_rules.datastructures.enums import Category
|
15
|
+
from ripple_down_rules.rdr_decorators import RDRDecorator
|
16
16
|
|
17
17
|
|
18
18
|
def load_cached_dataset(cache_file):
|
@@ -117,21 +117,15 @@ class PhysicalObject:
|
|
117
117
|
"""
|
118
118
|
A physical object is an object that can be contained in a container.
|
119
119
|
"""
|
120
|
-
_rdr_json_dir: str = os.path.join(os.path.dirname(__file__), "
|
120
|
+
_rdr_json_dir: str = os.path.join(os.path.dirname(__file__), "test_results")
|
121
121
|
"""
|
122
122
|
The directory where the RDR serialized JSON files are stored.
|
123
123
|
"""
|
124
|
-
|
125
|
-
"""
|
126
|
-
The directory where the RDR generated Python files are stored.
|
127
|
-
"""
|
128
|
-
_is_a_robot_rdr: RDRDecorator = RDRDecorator(_rdr_json_dir, (bool,), True,
|
129
|
-
python_dir=_rdr_python_dir)
|
124
|
+
_is_a_robot_rdr: RDRDecorator = RDRDecorator(_rdr_json_dir, (bool,), True)
|
130
125
|
"""
|
131
126
|
The RDR decorator that is used to determine if the object is a robot or not.
|
132
127
|
"""
|
133
|
-
_select_parts_rdr: RDRDecorator = RDRDecorator(_rdr_json_dir, (Self,), False
|
134
|
-
python_dir=_rdr_python_dir)
|
128
|
+
_select_parts_rdr: RDRDecorator = RDRDecorator(_rdr_json_dir, (Self,), False)
|
135
129
|
"""
|
136
130
|
The RDR decorator that is used to determine if the object is a robot or not.
|
137
131
|
"""
|
@@ -2,13 +2,13 @@ import os
|
|
2
2
|
|
3
3
|
from typing_extensions import List, Any, Tuple, Type
|
4
4
|
|
5
|
-
from
|
5
|
+
from datasets import Species, Habitat
|
6
6
|
from ripple_down_rules.datastructures.case import Case
|
7
7
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
8
8
|
from ripple_down_rules.datastructures.enums import Category
|
9
9
|
from ripple_down_rules.experts import Human
|
10
10
|
from ripple_down_rules.rdr import MultiClassRDR, SingleClassRDR, GeneralRDR
|
11
|
-
from ripple_down_rules.utils import make_set
|
11
|
+
from ripple_down_rules.utils import make_set
|
12
12
|
|
13
13
|
|
14
14
|
def get_fit_scrdr(cases: List[Any], targets: List[Any], attribute_name: str = "species",
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import json
|
2
1
|
from dataclasses import dataclass
|
3
2
|
from unittest import TestCase
|
4
3
|
|
5
4
|
from typing_extensions import List
|
6
5
|
|
7
|
-
from
|
8
|
-
from ripple_down_rules.datastructures.dataclasses import
|
9
|
-
from ripple_down_rules.experts import Human
|
6
|
+
from datasets import load_zoo_dataset
|
7
|
+
from ripple_down_rules.datastructures.dataclasses import Case
|
10
8
|
from ripple_down_rules.rdr import SingleClassRDR, MultiClassRDR, GeneralRDR
|
11
9
|
from ripple_down_rules.utils import make_set, flatten_list, serialize_dataclass, deserialize_dataclass
|
12
10
|
from test_helpers.helpers import get_fit_mcrdr, get_fit_scrdr, get_fit_grdr
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
import unittest
|
3
3
|
|
4
|
-
from
|
4
|
+
from datasets import load_zoo_dataset, Species
|
5
5
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
6
6
|
from ripple_down_rules.user_interface.object_diagram import generate_object_graph
|
7
7
|
|
@@ -4,8 +4,8 @@ from unittest import TestCase
|
|
4
4
|
|
5
5
|
from typing_extensions import List, Optional
|
6
6
|
|
7
|
-
from
|
8
|
-
from
|
7
|
+
from datasets import Habitat, Species
|
8
|
+
from datasets import load_zoo_dataset
|
9
9
|
from ripple_down_rules.datastructures.case import Case
|
10
10
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
11
11
|
from ripple_down_rules.datastructures.enums import MCRDRMode
|
@@ -96,8 +96,9 @@ class TestRDR(TestCase):
|
|
96
96
|
self.assertEqual(cat, target)
|
97
97
|
|
98
98
|
def test_expert_incremental_save(self):
|
99
|
-
|
100
|
-
|
99
|
+
if not os.path.exists(os.path.join(self.test_results_dir, "expert_incremental_save/expert_answers.py")):
|
100
|
+
return
|
101
|
+
# os.remove(os.path.join(self.test_results_dir, "expert_incremental_save/expert_answers.py"))
|
101
102
|
expert = Human(answers_save_path=f"{self.test_results_dir}/expert_incremental_save/expert_answers")
|
102
103
|
cq = CaseQuery(self.all_cases[0], "species", Species, True)
|
103
104
|
conclusion = expert.ask_for_conclusion(cq)
|
@@ -110,6 +111,7 @@ class TestRDR(TestCase):
|
|
110
111
|
scrdr.ask_always = False
|
111
112
|
else:
|
112
113
|
scrdr = SingleClassRDR(save_dir=self.test_results_dir + "/scrdr_incremental_save")
|
114
|
+
return
|
113
115
|
expert = Human(answers_save_path=f"{self.test_results_dir}/scrdr_incremental_save/expert_answers")
|
114
116
|
cq = CaseQuery(self.all_cases[0], "species", Species, True)
|
115
117
|
scrdr.fit_case(cq, expert=expert)
|
@@ -7,11 +7,11 @@ from sqlalchemy.orm import MappedColumn as Column
|
|
7
7
|
from typing_extensions import List, Sequence
|
8
8
|
import pandas as pd
|
9
9
|
|
10
|
-
from
|
10
|
+
from datasets import Base, MappedAnimal, Species, get_dataset, Habitat, HabitatTable
|
11
11
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
12
12
|
from ripple_down_rules.experts import Human
|
13
13
|
from ripple_down_rules.rdr import SingleClassRDR, MultiClassRDR, GeneralRDR
|
14
|
-
from ripple_down_rules.utils import
|
14
|
+
from ripple_down_rules.utils import make_set
|
15
15
|
from test_helpers.helpers import get_fit_scrdr
|
16
16
|
|
17
17
|
|
@@ -6,11 +6,15 @@ from dataclasses import dataclass, field
|
|
6
6
|
from typing import List, Optional
|
7
7
|
from unittest import TestCase
|
8
8
|
|
9
|
-
|
9
|
+
try:
|
10
|
+
from PyQt6.QtWidgets import QApplication
|
11
|
+
from ripple_down_rules.user_interface.gui import RDRCaseViewer
|
12
|
+
except ImportError as e:
|
13
|
+
QApplication = None
|
14
|
+
RDRCaseViewer = None
|
10
15
|
|
11
16
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
12
17
|
from ripple_down_rules.experts import Human
|
13
|
-
from ripple_down_rules.user_interface.gui import RDRCaseViewer
|
14
18
|
from ripple_down_rules.helpers import is_matching
|
15
19
|
from ripple_down_rules.rdr import GeneralRDR
|
16
20
|
|
@@ -88,8 +92,8 @@ class Cabinet(View):
|
|
88
92
|
class TestRDRWorld(TestCase):
|
89
93
|
drawer_case_queries: List[CaseQuery]
|
90
94
|
world: World
|
91
|
-
app: QApplication
|
92
|
-
viewer: RDRCaseViewer
|
95
|
+
app: Optional[QApplication] = None
|
96
|
+
viewer: Optional[RDRCaseViewer] = None
|
93
97
|
|
94
98
|
@classmethod
|
95
99
|
def setUpClass(cls):
|
@@ -115,8 +119,10 @@ class TestRDRWorld(TestCase):
|
|
115
119
|
# print(all_possible_drawers)
|
116
120
|
cls.drawer_case_queries = [CaseQuery(possible_drawer, "correct", (bool,), True, default_value=False)
|
117
121
|
for possible_drawer in all_possible_drawers]
|
118
|
-
|
119
|
-
|
122
|
+
|
123
|
+
if RDRCaseViewer is not None and QApplication is not None:
|
124
|
+
cls.app = QApplication(sys.argv)
|
125
|
+
cls.viewer = RDRCaseViewer(save_file="./test_generated_rdrs")
|
120
126
|
|
121
127
|
def test_view_rdr(self):
|
122
128
|
self.get_view_rdr(use_loaded_answers=True, save_answers=False, append=False)
|
@@ -3,14 +3,13 @@ from __future__ import annotations
|
|
3
3
|
import os
|
4
4
|
from unittest import TestCase
|
5
5
|
|
6
|
-
from typing_extensions import List,
|
6
|
+
from typing_extensions import List, Any
|
7
7
|
|
8
|
-
from
|
8
|
+
from datasets import Robot, Part, PhysicalObject
|
9
9
|
from ripple_down_rules.datastructures.case import CaseAttribute
|
10
10
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery, CallableExpression
|
11
11
|
from ripple_down_rules.experts import Human
|
12
12
|
from ripple_down_rules.rdr import SingleClassRDR
|
13
|
-
from ripple_down_rules.utils import render_tree
|
14
13
|
|
15
14
|
|
16
15
|
class RelationalRDRTestCase(TestCase):
|
@@ -12,9 +12,9 @@
|
|
12
12
|
"builtins.bool"
|
13
13
|
],
|
14
14
|
"scope": {
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
15
|
+
"PhysicalObject": "datasets.PhysicalObject",
|
16
|
+
"Robot": "datasets.Robot",
|
17
|
+
"Dict": "typing.Dict"
|
18
18
|
},
|
19
19
|
"conclusion": {
|
20
20
|
"_type": "builtins.NoneType",
|
@@ -29,9 +29,9 @@
|
|
29
29
|
"builtins.bool"
|
30
30
|
],
|
31
31
|
"scope": {
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
32
|
+
"PhysicalObject": "datasets.PhysicalObject",
|
33
|
+
"Robot": "datasets.Robot",
|
34
|
+
"Dict": "typing.Dict"
|
35
35
|
},
|
36
36
|
"conclusion": {
|
37
37
|
"_type": "builtins.NoneType",
|
@@ -1,7 +1,7 @@
|
|
1
|
-
from typing import Union
|
2
1
|
from typing import Dict
|
3
|
-
from
|
4
|
-
from
|
2
|
+
from typing import Union
|
3
|
+
from datasets import PhysicalObject
|
4
|
+
from datasets import Robot
|
5
5
|
from typing import List
|
6
6
|
from typing_extensions import Union
|
7
7
|
|
@@ -12,11 +12,11 @@
|
|
12
12
|
"builtins.bool"
|
13
13
|
],
|
14
14
|
"scope": {
|
15
|
-
"Union": "typing.Union",
|
16
15
|
"List": "typing.List",
|
17
|
-
"PhysicalObject": "
|
16
|
+
"PhysicalObject": "datasets.PhysicalObject",
|
17
|
+
"Robot": "datasets.Robot",
|
18
18
|
"Dict": "typing.Dict",
|
19
|
-
"
|
19
|
+
"Union": "typing.Union"
|
20
20
|
},
|
21
21
|
"conclusion": {
|
22
22
|
"_type": "builtins.NoneType",
|
@@ -28,16 +28,16 @@
|
|
28
28
|
"_type": "ripple_down_rules.datastructures.callable_expression.CallableExpression",
|
29
29
|
"user_input": "def _get_value(case):\n def physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> List[PhysicalObject]:\n \"\"\"Get possible value(s) for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject.\"\"\"\n robot_parts = [obj for obj in objects if obj in robot.parts]\n return robot_parts\n return physical_object_select_objects_that_are_parts_of_robot(**case)\n ",
|
30
30
|
"conclusion_type": [
|
31
|
-
"
|
31
|
+
"datasets.PhysicalObject",
|
32
32
|
"builtins.set",
|
33
33
|
"builtins.list"
|
34
34
|
],
|
35
35
|
"scope": {
|
36
|
-
"Union": "typing.Union",
|
37
36
|
"List": "typing.List",
|
38
|
-
"PhysicalObject": "
|
37
|
+
"PhysicalObject": "datasets.PhysicalObject",
|
38
|
+
"Robot": "datasets.Robot",
|
39
39
|
"Dict": "typing.Dict",
|
40
|
-
"
|
40
|
+
"Union": "typing.Union"
|
41
41
|
},
|
42
42
|
"conclusion": {
|
43
43
|
"_type": "builtins.NoneType",
|
@@ -8,7 +8,7 @@ from ripple_down_rules.datastructures.enums import PromptFor
|
|
8
8
|
from ripple_down_rules.rdr_decorators import RDRDecorator
|
9
9
|
from ripple_down_rules.user_interface.template_file_creator import TemplateFileCreator
|
10
10
|
from test_rdr_world import World, Handle, Container
|
11
|
-
from
|
11
|
+
from datasets import Part, PhysicalObject, Robot
|
12
12
|
|
13
13
|
|
14
14
|
|
{ripple_down_rules-0.5.0 → ripple_down_rules-0.5.1}/test/test_user_interface/test_qt_gui_inline.py
RENAMED
@@ -1,20 +1,25 @@
|
|
1
1
|
import os.path
|
2
2
|
import unittest
|
3
3
|
|
4
|
-
|
5
|
-
QApplication
|
6
|
-
|
4
|
+
try:
|
5
|
+
from PyQt6.QtWidgets import QApplication
|
6
|
+
from ripple_down_rules.user_interface.gui import RDRCaseViewer, style
|
7
|
+
except ImportError as e:
|
8
|
+
print(f"Skipping GUI tests due to missing PyQt6: {e}")
|
9
|
+
QApplication = None
|
10
|
+
RDRCaseViewer = None
|
11
|
+
style = None
|
7
12
|
from typing_extensions import List
|
8
13
|
|
9
|
-
from
|
14
|
+
from datasets import load_zoo_dataset, Species
|
10
15
|
from ripple_down_rules.datastructures.case import Case
|
11
16
|
from ripple_down_rules.datastructures.dataclasses import CaseQuery
|
12
|
-
from ripple_down_rules.user_interface.gui import RDRCaseViewer, style
|
13
17
|
from test_helpers.helpers import get_fit_grdr
|
14
18
|
from test_object_diagram import Person, Address
|
15
19
|
|
16
20
|
|
17
|
-
|
21
|
+
@unittest.skipIf(QApplication is None, "GUI tests need PyQt6,"
|
22
|
+
"and they need visual inspection by a user and cannot be run automatically.")
|
18
23
|
class GUITestCase(unittest.TestCase):
|
19
24
|
"""Test case for the GUI components of the ripple down rules package."""
|
20
25
|
app: QApplication
|
@@ -61,6 +66,6 @@ class GUITestCase(unittest.TestCase):
|
|
61
66
|
self.viewer.title_label.setText(style("Press `Save` To Test", "o", 28, 'bold'))
|
62
67
|
self.viewer.show()
|
63
68
|
self.app.exec()
|
64
|
-
|
65
|
-
grdr.model_name}/rdr_metadata/{grdr.model_name}.json"))
|
69
|
+
grdr_viewer_dir = f"{os.path.dirname(__file__)}/../test_results/grdr_viewer"
|
70
|
+
self.assertTrue(os.path.exists(f"{grdr_viewer_dir}/{grdr.model_name}/rdr_metadata/{grdr.model_name}.json"))
|
66
71
|
|
@@ -1,37 +0,0 @@
|
|
1
|
-
from unittest import skip
|
2
|
-
|
3
|
-
import pdbpp as pdb
|
4
|
-
import readline
|
5
|
-
import rlcompleter
|
6
|
-
|
7
|
-
|
8
|
-
class MyPdb(pdb.Pdb):
|
9
|
-
|
10
|
-
readline.parse_and_bind("tab: complete")
|
11
|
-
|
12
|
-
def onecmd(self, line):
|
13
|
-
print(f"[Captured Input]: {line.strip()}")
|
14
|
-
return super().onecmd(line)
|
15
|
-
|
16
|
-
|
17
|
-
class A:
|
18
|
-
|
19
|
-
def __init__(self, a, b=10):
|
20
|
-
self.x = 10
|
21
|
-
self.y = 20
|
22
|
-
self.z = 30
|
23
|
-
self.a = a
|
24
|
-
self.b = b
|
25
|
-
|
26
|
-
def a_method(self):
|
27
|
-
print("Hello from a_method")
|
28
|
-
|
29
|
-
|
30
|
-
def foo():
|
31
|
-
x = 3
|
32
|
-
ahmed = 20
|
33
|
-
debugger = MyPdb()
|
34
|
-
debugger.set_trace()
|
35
|
-
print(x)
|
36
|
-
|
37
|
-
# foo()
|