ripple-down-rules 0.6.43__tar.gz → 0.6.45__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.
Files changed (165) hide show
  1. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/PKG-INFO +1 -1
  2. ripple_down_rules-0.6.45/src/ripple_down_rules/__init__.py +5 -0
  3. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/rdr.py +40 -10
  4. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/utils.py +20 -10
  5. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules.egg-info/PKG-INFO +1 -1
  6. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr.py +4 -4
  7. ripple_down_rules-0.6.45/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr_defs.py +19 -0
  8. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_results/datasets_physical_object_is_a_robot/rdr_metadata/datasets_physical_object_is_a_robot.json +4 -4
  9. ripple_down_rules-0.6.45/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 +19 -0
  10. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/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 +6 -6
  11. ripple_down_rules-0.6.43/src/ripple_down_rules/__init__.py +0 -5
  12. ripple_down_rules-0.6.43/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr_defs.py +0 -19
  13. ripple_down_rules-0.6.43/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 +0 -19
  14. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.github/workflows/build_and_deploy_doc.yml +0 -0
  15. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.github/workflows/ci.yml +0 -0
  16. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.github/workflows/publish-to-test-pypi.yml +0 -0
  17. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.gitignore +0 -0
  18. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]/shelved.patch +0 -0
  19. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/.idea/shelf/Uncommitted_changes_before_Checkout_at_2_4_25,_6_32_PM_[Changes]1/shelved.patch +0 -0
  20. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/LICENSE +0 -0
  21. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/README.md +0 -0
  22. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/_config.yml +0 -0
  23. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/_toc.yml +0 -0
  24. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/bibliography.md +0 -0
  25. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/intro.md +0 -0
  26. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/references.bib +0 -0
  27. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/doc/requirements.txt +0 -0
  28. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/__init__.py +0 -0
  29. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/animal_species.py +0 -0
  30. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/part_containment_rdr/__init__.py +0 -0
  31. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/part_containment_rdr/rdr_metadata/part_containment_rdr.json +0 -0
  32. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/part_containment_rdr/robot_contained_objects_mcrdr.py +0 -0
  33. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/part_containment_rdr/robot_contained_objects_mcrdr_defs.py +0 -0
  34. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/part_containment_rdr/robot_rdr.py +0 -0
  35. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/examples/relational_example.py +0 -0
  36. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/images/scrdr.dot +0 -0
  37. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/images/scrdr.png +0 -0
  38. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/images/thinking_pr2.jpg +0 -0
  39. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/pyproject.toml +0 -0
  40. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/pytest.ini +0 -0
  41. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/requirements-dev-ci.txt +0 -0
  42. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/requirements-dev.txt +0 -0
  43. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/requirements-gui.txt +0 -0
  44. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/requirements-viz.txt +0 -0
  45. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/requirements.txt +0 -0
  46. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_extra.dot +0 -0
  47. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_extra.png +0 -0
  48. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_stop_only.dot +0 -0
  49. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_stop_only.png +0 -0
  50. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_stop_plus_rule.dot +0 -0
  51. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_mcrdr_stop_plus_rule.png +0 -0
  52. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr.dot +0 -0
  53. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr.png +0 -0
  54. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr_2.dot +0 -0
  55. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr_2.png +0 -0
  56. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr_3.dot +0 -0
  57. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/complete_scrdr_3.png +0 -0
  58. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/grdr_Habitat.dot +0 -0
  59. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/grdr_Habitat.png +0 -0
  60. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/grdr_Species.dot +0 -0
  61. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/grdr_Species.png +0 -0
  62. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_extra.dot +0 -0
  63. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_extra.png +0 -0
  64. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_extra_classify.dot +0 -0
  65. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_extra_classify.png +0 -0
  66. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_stop_plus_rule_combined.dot +0 -0
  67. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/mcrdr_stop_plus_rule_combined.png +0 -0
  68. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/partial_mcrdr_extra.dot +0 -0
  69. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/partial_mcrdr_extra.png +0 -0
  70. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/relational_scrdr_classify.dot +0 -0
  71. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/results/relational_scrdr_classify.png +0 -0
  72. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/scripts/live_dot_server_client.py +0 -0
  73. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/setup.cfg +0 -0
  74. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/datastructures/__init__.py +0 -0
  75. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/datastructures/callable_expression.py +0 -0
  76. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/datastructures/case.py +0 -0
  77. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/datastructures/dataclasses.py +0 -0
  78. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/datastructures/enums.py +0 -0
  79. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/experts.py +0 -0
  80. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/helpers.py +0 -0
  81. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/rdr_decorators.py +0 -0
  82. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/rules.py +0 -0
  83. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/start-code-server.sh +0 -0
  84. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/__init__.py +0 -0
  85. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/gui.py +0 -0
  86. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/ipython_custom_shell.py +0 -0
  87. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/object_diagram.py +0 -0
  88. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/prompt.py +0 -0
  89. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules/user_interface/template_file_creator.py +0 -0
  90. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules.egg-info/SOURCES.txt +0 -0
  91. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules.egg-info/dependency_links.txt +0 -0
  92. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules.egg-info/requires.txt +0 -0
  93. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/src/ripple_down_rules.egg-info/top_level.txt +0 -0
  94. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/__init__.py +0 -0
  95. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/conf/__init__.py +0 -0
  96. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/conf/world/__init__.py +0 -0
  97. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/conf/world/base_config.py +0 -0
  98. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/conf/world/handles_and_containers.py +0 -0
  99. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/conftest.py +0 -0
  100. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/datasets.py +0 -0
  101. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/factories/__init__.py +0 -0
  102. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/factories/world/__init__.py +0 -0
  103. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/factories/world/handles_and_containers.py +0 -0
  104. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/__init__.py +0 -0
  105. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/correct_drawer_rdr_expert_answers_fit.json +0 -0
  106. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/drawer_cabinet_expert_answers_fit.json +0 -0
  107. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_classify.json +0 -0
  108. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_fit.json +0 -0
  109. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_fit.py +0 -0
  110. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_fit_extra.json +0 -0
  111. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_fit_no_targets.json +0 -0
  112. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/grdr_expert_answers_fit_no_targets.py +0 -0
  113. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_expert_answers_classify.json +0 -0
  114. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_expert_answers_fit_no_targets.json +0 -0
  115. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_expert_answers_fit_no_targets.py +0 -0
  116. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_expert_answers_stop_only_fit.json +0 -0
  117. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_expert_answers_stop_only_fit.py +0 -0
  118. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_extra_expert_answers_classify.json +0 -0
  119. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_extra_expert_answers_fit.json +0 -0
  120. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_multi_line_expert_answers_fit.json +0 -0
  121. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_multi_line_expert_answers_fit.py +0 -0
  122. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_stop_only_answers_fit.json +0 -0
  123. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_stop_plus_rule_answers_fit.json +0 -0
  124. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_stop_plus_rule_combined_expert_answers_fit.json +0 -0
  125. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mcrdr_stop_plus_rule_expert_answers_fit.json +0 -0
  126. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/mutagenic_expert_answers.json +0 -0
  127. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/relational_scrdr_expert_answers_classify.json +0 -0
  128. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_expert_answers_classify.json +0 -0
  129. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_expert_answers_fit.json +0 -0
  130. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_expert_answers_fit.py +0 -0
  131. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_expert_answers_fit_no_targets.json +0 -0
  132. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_expert_answers_fit_no_targets.py +0 -0
  133. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_multi_line_expert_answers_fit.json +0 -0
  134. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_multi_line_expert_answers_fit.py +0 -0
  135. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_expert_answers/scrdr_world_expert_answers_fit.json +0 -0
  136. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_generated_rdrs/__init__.py +0 -0
  137. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_helpers/__init__.py +0 -0
  138. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_helpers/helpers.py +0 -0
  139. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_helpers/object_diagram_case_query.png +0 -0
  140. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_helpers/object_diagram_person.png +0 -0
  141. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_json_serialization.py +0 -0
  142. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_object_diagram.py +0 -0
  143. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_on_mutagenic.py +0 -0
  144. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_alchemy.py +0 -0
  145. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_decorators.py +0 -0
  146. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_helpers_rdrs.py +0 -0
  147. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_world/__init__.py +0 -0
  148. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_world/conftest.py +0 -0
  149. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_rdr_world/test_rdr_world.py +0 -0
  150. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_relational_rdr.py +0 -0
  151. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_relational_rdr_alchemy.py +0 -0
  152. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_results/datasets_physical_object_is_a_robot/__init__.py +0 -0
  153. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_output__scrdr.py +0 -0
  154. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_results/datasets_physical_object_is_a_robot/physical_object_is_a_robot_rdr.py +0 -0
  155. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_results/datasets_physical_object_select_objects_that_are_parts_of_robot/__init__.py +0 -0
  156. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/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
  157. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/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
  158. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_sql_model.py +0 -0
  159. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_template_file_creator.py +0 -0
  160. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_user_interface/__init__.py +0 -0
  161. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_user_interface/test_ipython.py +0 -0
  162. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_user_interface/test_ipython_copilot.py +0 -0
  163. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_user_interface/test_prompt.py +0 -0
  164. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_user_interface/test_qt_gui_inline.py +0 -0
  165. {ripple_down_rules-0.6.43 → ripple_down_rules-0.6.45}/test/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ripple_down_rules
3
- Version: 0.6.43
3
+ Version: 0.6.45
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
@@ -0,0 +1,5 @@
1
+ __version__ = "0.6.45"
2
+
3
+ import logging
4
+ logger = logging.Logger("rdr")
5
+ logger.setLevel(logging.INFO)
@@ -45,7 +45,7 @@ from .utils import draw_tree, make_set, SubclassJSONSerializer, make_list, get_t
45
45
  is_value_conflicting, extract_function_source, extract_imports, get_full_class_name, \
46
46
  is_iterable, str_to_snake_case, get_import_path_from_path, get_imports_from_types, render_tree, \
47
47
  get_types_to_import_from_func_type_hints, get_function_return_type, get_file_that_ends_with, \
48
- get_and_import_python_module, get_and_import_python_modules_in_a_package
48
+ get_and_import_python_module, get_and_import_python_modules_in_a_package, get_type_from_type_hint
49
49
 
50
50
 
51
51
  class RippleDownRules(SubclassJSONSerializer, ABC):
@@ -217,10 +217,10 @@ class RippleDownRules(SubclassJSONSerializer, ABC):
217
217
  if os.path.exists(json_file + ".json"):
218
218
  rdr = cls.from_json_file(json_file)
219
219
  try:
220
+ acronym = cls.get_acronym().lower()
221
+ python_file_name = get_file_that_ends_with(model_dir, f"_{acronym}.py")
222
+ python_file_path = os.path.join(model_dir, python_file_name)
220
223
  if rdr is None:
221
- acronym = cls.get_acronym().lower()
222
- python_file_name = get_file_that_ends_with(model_dir, f"_{acronym}.py")
223
- python_file_path = os.path.join(model_dir, python_file_name)
224
224
  rdr = cls.from_python(model_dir, parent_package_name=package_name, python_file_path=python_file_path)
225
225
  else:
226
226
  rdr.update_from_python(model_dir, package_name=package_name)
@@ -886,22 +886,52 @@ class RDRWithCodeWriter(RippleDownRules, ABC):
886
886
  self.update_rdr_metadata_from_python(main_module)
887
887
 
888
888
  functions_source = extract_function_source(defs_module.__file__,
889
- all_func_names, include_signature=False)
889
+ all_func_names, include_signature=True)
890
890
  scope = extract_imports(defs_module.__file__, package_name=package_name)
891
891
 
892
+ cases_source, cases_scope = None, None
893
+ if cases_module:
894
+ with open(cases_module.__file__, "r") as f:
895
+ cases_source = f.read()
896
+ cases_scope = extract_imports(cases_module.__file__, package_name=package_name)
897
+
898
+ with open(main_module.__file__, "r") as f:
899
+ main_source = f.read()
900
+ main_scope = extract_imports(main_module.__file__, package_name=package_name)
901
+ attribute_name_line = [l for l in main_source.split('\n') if "attribute_name = " in l]
902
+ conclusion_name = None
903
+ if len(attribute_name_line) > 0:
904
+ conclusion_name = eval(attribute_name_line[0].split('=')[-1].strip(), main_scope)
905
+
892
906
  for rule in all_rules:
893
907
  if rule.conditions is not None:
894
908
  conditions_wrapper_func_name = rule.generated_conditions_function_name
895
909
  user_input = functions_source[conditions_wrapper_func_name]
910
+ user_input = '\n'.join(user_input.split("\n")[1:]) # Remove the function signature line
896
911
  rule.conditions = CallableExpression(user_input, (bool,), scope=scope)
897
912
  if cases_module:
898
- rule.corner_case_metadata = cases_module.__dict__.get(rule.generated_corner_case_object_name, None)
913
+ try:
914
+ rule.corner_case_metadata = cases_module.__dict__[rule.generated_corner_case_object_name]
915
+ except KeyError:
916
+ case_def_lines = [l for l in cases_source.split('\n') if rule.generated_corner_case_object_name in l]
917
+ if len(case_def_lines) > 0:
918
+ case_def_line = case_def_lines[0].split('=')[-1].strip()
919
+ rule.corner_case_metadata = eval(case_def_line, cases_scope)
920
+
899
921
  if not isinstance(rule, MultiClassStopRule):
900
- rule.conclusion_name = main_module.attribute_name
901
- conclusion_wrapper_func_name = rule.generated_conclusion_function_name
902
- user_input = functions_source[conclusion_wrapper_func_name]
922
+ if conclusion_name:
923
+ rule.conclusion_name = conclusion_name
924
+ user_input = functions_source[rule.generated_conclusion_function_name]
925
+ split_user_input = user_input.split("\n")
926
+ user_input = '\n'.join(split_user_input[1:])
903
927
  conclusion_func = defs_module.__dict__.get(rule.generated_conclusion_function_name)
904
- conclusion_type = get_function_return_type(conclusion_func)
928
+ if conclusion_func is None:
929
+ function_signature = split_user_input[0]
930
+ return_type_hint_str = function_signature.split('->')[-1].strip(' :')
931
+ return_type_hint = eval(return_type_hint_str, scope)
932
+ conclusion_type = get_type_from_type_hint(return_type_hint)
933
+ else:
934
+ conclusion_type = get_function_return_type(conclusion_func)
905
935
  rule.conclusion = CallableExpression(user_input, conclusion_type, scope=scope,
906
936
  mutually_exclusive=self.mutually_exclusive)
907
937
 
@@ -168,20 +168,23 @@ def extract_imports(file_path: Optional[str] = None, tree: Optional[ast.AST] = N
168
168
  try:
169
169
  scope[asname] = importlib.import_module(module_name, package=package_name)
170
170
  except ImportError as e:
171
- print(f"Could not import {module_name}: {e}")
171
+ logger.warning(f"Could not import {module_name}: {e}")
172
172
  elif isinstance(node, ast.ImportFrom):
173
173
  module_name = node.module
174
174
  for alias in node.names:
175
175
  name = alias.name
176
176
  asname = alias.asname or name
177
177
  try:
178
- if package_name is not None and node.level > 0: # Handle relative imports
179
- module_rel_path = Path(os.path.join(file_path, *['..'] * node.level, module_name)).resolve()
180
- idx = str(module_rel_path).rfind(package_name)
181
- if idx != -1:
182
- module_name = str(module_rel_path)[idx:].replace(os.path.sep, '.')
183
- module = importlib.import_module(module_name, package=package_name)
184
- scope[asname] = getattr(module, name)
178
+ if node.level > 0: # Handle relative imports
179
+ package_name = get_import_path_from_path(Path(os.path.join(file_path, *['..'] * node.level)).resolve())
180
+ try:
181
+ module = importlib.import_module(module_name, package=package_name)
182
+ except ModuleNotFoundError:
183
+ module = importlib.import_module(f"{package_name}.{module_name}")
184
+ if name == "*":
185
+ scope.update(module.__dict__)
186
+ else:
187
+ scope[asname] = getattr(module, name)
185
188
  except (ImportError, AttributeError) as e:
186
189
  logger.warning(f"Could not import {module_name}: {e} while extracting imports from {file_path}")
187
190
 
@@ -782,10 +785,14 @@ def get_function_return_type(func: Callable) -> Union[Type, None, Tuple[Type, ..
782
785
  if sig.return_annotation == inspect.Signature.empty:
783
786
  return None
784
787
  type_hint = sig.return_annotation
788
+ return get_type_from_type_hint(type_hint)
789
+
790
+
791
+ def get_type_from_type_hint(type_hint: Type) -> Union[Type, Tuple[Type, ...]]:
785
792
  origin = get_origin(type_hint)
786
793
  args = get_args(type_hint)
787
794
  if origin not in [list, set, None, Union]:
788
- raise TypeError(f"{origin} is not a handled return type for function {func.__name__}")
795
+ raise TypeError(f"{origin} is not a handled return type for type hint {type_hint}")
789
796
  if origin is None:
790
797
  return typing_to_python_type(type_hint)
791
798
  if args is None or len(args) == 0:
@@ -2091,7 +2098,10 @@ def render_tree(root: Node, use_dot_exporter: bool = False,
2091
2098
  else:
2092
2099
  filename = filename or "rule_tree"
2093
2100
  de.to_dotfile(f"{filename}{'.dot'}")
2094
- de.to_picture(f"{filename}{'.svg'}")
2101
+ try:
2102
+ de.to_picture(f"{filename}{'.svg'}")
2103
+ except FileNotFoundError as e:
2104
+ logger.warning(f"{e}")
2095
2105
 
2096
2106
 
2097
2107
  def draw_tree(root: Node, fig: Figure):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ripple_down_rules
3
- Version: 0.6.43
3
+ Version: 0.6.45
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
@@ -106,8 +106,8 @@ class TestRDR(TestCase):
106
106
  def test_read_mcrdr_tree(self):
107
107
  original_mcrdr = get_fit_mcrdr(self.all_cases, self.targets)
108
108
  save_dir = self.generated_rdrs_dir
109
- model_name = original_mcrdr.save(save_dir)
110
- scrdr_loaded = MultiClassRDR.load(save_dir, original_mcrdr.generated_python_file_name)
109
+ model_name = original_mcrdr.save(save_dir, 'test_read_mcrdr_tree')
110
+ scrdr_loaded = MultiClassRDR.load(save_dir, model_name, package_name=f"test.test_generated_rdrs.{model_name}")
111
111
  model_path = os.path.join(save_dir, model_name)
112
112
  rules_root = MultiClassRDR.read_rule_tree_from_python(model_path)
113
113
  for rule, og_rule in zip([rules_root] + list(rules_root.descendants),
@@ -130,7 +130,7 @@ class TestRDR(TestCase):
130
130
  def test_load_mcrdr_from_python(self):
131
131
  original_mcrdr = get_fit_mcrdr(self.all_cases, self.targets)
132
132
  save_dir = self.generated_rdrs_dir
133
- model_name = original_mcrdr.save(save_dir)
133
+ model_name = original_mcrdr.save(save_dir, 'test_load_mcrdr_from_python')
134
134
  model_path = os.path.join(save_dir, model_name)
135
135
  mcrdr_loaded = MultiClassRDR.from_python(model_path)
136
136
  for case, target in zip(self.all_cases, self.targets):
@@ -139,7 +139,7 @@ class TestRDR(TestCase):
139
139
  def test_load_grdr_from_python(self):
140
140
  original_grdr, targets = get_fit_grdr(self.all_cases, self.targets)
141
141
  save_dir = self.generated_rdrs_dir
142
- model_name = original_grdr.save(save_dir)
142
+ model_name = original_grdr.save(save_dir, 'test_load_grdr_from_python')
143
143
  model_path = os.path.join(save_dir, model_name)
144
144
  grdr_loaded = GeneralRDR.from_python(model_path)
145
145
  for case, target in zip(self.all_cases[:len(targets)], targets):
@@ -0,0 +1,19 @@
1
+ from types import NoneType
2
+ from typing_extensions import Dict, Optional, Union
3
+ from ...datasets import PhysicalObject, Robot
4
+
5
+
6
+ def conditions_226969243620390858682731042391766665817(case) -> bool:
7
+ def conditions_for_physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:
8
+ """Get conditions on whether it's possible to conclude a value for PhysicalObject_is_a_robot.output_ of type ."""
9
+ return True
10
+ return conditions_for_physical_object_is_a_robot(**case)
11
+
12
+
13
+ def conclusion_226969243620390858682731042391766665817(case) -> bool:
14
+ def physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:
15
+ """Get possible value(s) for PhysicalObject_is_a_robot.output_ of type ."""
16
+ return isinstance(self_, Robot)
17
+ return physical_object_is_a_robot(**case)
18
+
19
+
@@ -7,7 +7,7 @@
7
7
  "_type": "ripple_down_rules.rules.SingleClassRule",
8
8
  "conditions": {
9
9
  "_type": "ripple_down_rules.datastructures.callable_expression.CallableExpression",
10
- "user_input": "def _get_value(case):\n def conditions_for_physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:\n \"\"\"Get conditions on whether it's possible to conclude a value for PhysicalObject_is_a_robot.output_ of type .\"\"\"\n return True\n return conditions_for_physical_object_is_a_robot(**case)\n ",
10
+ "user_input": "def _get_value(case):\n def conditions_for_physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:\n \"\"\"Get conditions on whether it's possible to conclude a value for PhysicalObject_is_a_robot.output_ of type .\"\"\"\n return True\n return conditions_for_physical_object_is_a_robot(**case)\n ",
11
11
  "conclusion_type": [
12
12
  "builtins.bool"
13
13
  ],
@@ -22,13 +22,13 @@
22
22
  },
23
23
  "conclusion": {
24
24
  "_type": "ripple_down_rules.datastructures.callable_expression.CallableExpression",
25
- "user_input": "def _get_value(case):\n def physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:\n \"\"\"Get possible value(s) for PhysicalObject_is_a_robot.output_ of type .\"\"\"\n return isinstance(self_, Robot)\n return physical_object_is_a_robot(**case)\n ",
25
+ "user_input": "def _get_value(case):\n def physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:\n \"\"\"Get possible value(s) for PhysicalObject_is_a_robot.output_ of type .\"\"\"\n return isinstance(self_, Robot)\n return physical_object_is_a_robot(**case)\n ",
26
26
  "conclusion_type": [
27
27
  "builtins.bool"
28
28
  ],
29
29
  "scope": {
30
- "Robot": "test.datasets.Robot",
31
- "PhysicalObject": "test.datasets.PhysicalObject"
30
+ "PhysicalObject": "test.datasets.PhysicalObject",
31
+ "Robot": "test.datasets.Robot"
32
32
  },
33
33
  "conclusion": {
34
34
  "_type": "builtins.NoneType",
@@ -0,0 +1,19 @@
1
+ from ...datasets import PhysicalObject, Robot
2
+ from typing_extensions import Dict, List, Set, Union
3
+
4
+
5
+ def conditions_164855806603893754507167918997373216146(case) -> bool:
6
+ def conditions_for_physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> bool:
7
+ """Get conditions on whether it's possible to conclude a value for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject."""
8
+ return robot is not None
9
+ return conditions_for_physical_object_select_objects_that_are_parts_of_robot(**case)
10
+
11
+
12
+ def conclusion_164855806603893754507167918997373216146(case) -> List[PhysicalObject]:
13
+ def physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> List[PhysicalObject]:
14
+ """Get possible value(s) for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject."""
15
+ robot_parts = [obj for obj in objects if obj in robot.parts]
16
+ return robot_parts
17
+ return physical_object_select_objects_that_are_parts_of_robot(**case)
18
+
19
+
@@ -7,14 +7,14 @@
7
7
  "_type": "ripple_down_rules.rules.MultiClassTopRule",
8
8
  "conditions": {
9
9
  "_type": "ripple_down_rules.datastructures.callable_expression.CallableExpression",
10
- "user_input": "def _get_value(case):\n def conditions_for_physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> bool:\n \"\"\"Get conditions on whether it's possible to conclude a value for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject.\"\"\"\n return robot is not None\n return conditions_for_physical_object_select_objects_that_are_parts_of_robot(**case)\n ",
10
+ "user_input": "def _get_value(case):\n def conditions_for_physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> bool:\n \"\"\"Get conditions on whether it's possible to conclude a value for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject.\"\"\"\n return robot is not None\n return conditions_for_physical_object_select_objects_that_are_parts_of_robot(**case)\n ",
11
11
  "conclusion_type": [
12
12
  "builtins.bool"
13
13
  ],
14
14
  "scope": {
15
+ "PhysicalObject": "test.datasets.PhysicalObject",
15
16
  "Robot": "test.datasets.Robot",
16
- "List": "typing.List",
17
- "PhysicalObject": "test.datasets.PhysicalObject"
17
+ "List": "typing.List"
18
18
  },
19
19
  "conclusion": {
20
20
  "_type": "builtins.NoneType",
@@ -24,14 +24,14 @@
24
24
  },
25
25
  "conclusion": {
26
26
  "_type": "ripple_down_rules.datastructures.callable_expression.CallableExpression",
27
- "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 ",
27
+ "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 ",
28
28
  "conclusion_type": [
29
29
  "test.datasets.PhysicalObject"
30
30
  ],
31
31
  "scope": {
32
+ "PhysicalObject": "test.datasets.PhysicalObject",
32
33
  "Robot": "test.datasets.Robot",
33
- "List": "typing.List",
34
- "PhysicalObject": "test.datasets.PhysicalObject"
34
+ "List": "typing.List"
35
35
  },
36
36
  "conclusion": {
37
37
  "_type": "builtins.NoneType",
@@ -1,5 +0,0 @@
1
- __version__ = "0.6.43"
2
-
3
- import logging
4
- logger = logging.Logger("rdr")
5
- logger.setLevel(logging.INFO)
@@ -1,19 +0,0 @@
1
- from typing_extensions import Dict, Optional, Union
2
- from types import NoneType
3
- from ...datasets import PhysicalObject, Robot
4
-
5
-
6
- def conditions_226969243620390858682731042391766665817(case) -> bool:
7
- def conditions_for_physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:
8
- """Get conditions on whether it's possible to conclude a value for PhysicalObject_is_a_robot.output_ of type ."""
9
- return True
10
- return conditions_for_physical_object_is_a_robot(**case)
11
-
12
-
13
- def conclusion_226969243620390858682731042391766665817(case) -> bool:
14
- def physical_object_is_a_robot(self_: PhysicalObject, output_: bool) -> bool:
15
- """Get possible value(s) for PhysicalObject_is_a_robot.output_ of type ."""
16
- return isinstance(self_, Robot)
17
- return physical_object_is_a_robot(**case)
18
-
19
-
@@ -1,19 +0,0 @@
1
- from typing_extensions import Dict, List, Set, Union
2
- from ...datasets import PhysicalObject, Robot
3
-
4
-
5
- def conditions_164855806603893754507167918997373216146(case) -> bool:
6
- def conditions_for_physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> bool:
7
- """Get conditions on whether it's possible to conclude a value for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject."""
8
- return robot is not None
9
- return conditions_for_physical_object_select_objects_that_are_parts_of_robot(**case)
10
-
11
-
12
- def conclusion_164855806603893754507167918997373216146(case) -> List[PhysicalObject]:
13
- def physical_object_select_objects_that_are_parts_of_robot(self_: PhysicalObject, objects: List[PhysicalObject], robot: Robot, output_: PhysicalObject) -> List[PhysicalObject]:
14
- """Get possible value(s) for PhysicalObject_select_objects_that_are_parts_of_robot.output_ of type PhysicalObject."""
15
- robot_parts = [obj for obj in objects if obj in robot.parts]
16
- return robot_parts
17
- return physical_object_select_objects_that_are_parts_of_robot(**case)
18
-
19
-
@@ -1,6 +1,6 @@
1
+ from ripple_down_rules.helpers import get_an_updated_case_copy
1
2
  from ripple_down_rules.datastructures.case import Case, create_case
2
3
  from typing_extensions import Optional, Set
3
- from ripple_down_rules.helpers import get_an_updated_case_copy
4
4
  from ripple_down_rules.utils import make_set
5
5
  from .physical_object_select_objects_that_are_parts_of_robot_output__mcrdr_defs import *
6
6