causal-testing-framework 14.1.0__tar.gz → 14.2.0__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 (182) hide show
  1. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/ci-tests-drafts.yaml +1 -1
  2. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/ci-tests.yaml +1 -1
  3. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/publish-to-dafni.yaml +1 -1
  4. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/publish-to-pypi.yaml +1 -1
  5. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.pre-commit-config.yaml +1 -1
  6. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.readthedocs.yaml +3 -3
  7. {causal_testing_framework-14.1.0/causal_testing_framework.egg-info → causal_testing_framework-14.2.0}/PKG-INFO +13 -15
  8. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/README.md +3 -3
  9. causal_testing_framework-14.2.0/causal_testing/_version.py +24 -0
  10. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/ipcw_estimator.py +1 -1
  11. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/linear_regression_estimator.py +1 -1
  12. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/main.py +25 -41
  13. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/metamorphic_relation.py +13 -5
  14. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0/causal_testing_framework.egg-info}/PKG-INFO +13 -15
  15. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing_framework.egg-info/SOURCES.txt +2 -0
  16. causal_testing_framework-14.2.0/causal_testing_framework.egg-info/entry_points.txt +16 -0
  17. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing_framework.egg-info/requires.txt +8 -14
  18. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/entrypoint.sh +3 -3
  19. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/index.rst +1 -0
  20. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/installation.rst +3 -3
  21. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/modules/causal_testing.rst +1 -1
  22. causal_testing_framework-14.2.0/docs/source/modules/custom_estimators.rst +65 -0
  23. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/modules/estimators.rst +2 -0
  24. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/poisson_line_process/poisson_line_process_tutorial.ipynb +2 -10
  25. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/causal_test_results.json +8 -8
  26. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/vaccinating_elderly_tutorial.ipynb +24 -21
  27. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/README.md +1 -1
  28. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/example_pure_python.py +22 -18
  29. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/pyproject.toml +28 -13
  30. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/main_tests/test_main.py +60 -4
  31. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/tests.json +10 -6
  32. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/testing_tests/test_causal_test_adequacy.py +7 -6
  33. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/testing_tests/test_metamorphic_relations.py +15 -4
  34. causal_testing_framework-14.1.0/causal_testing/_version.py +0 -34
  35. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  36. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  37. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/figshare.yaml +0 -0
  38. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/joss.yaml +0 -0
  39. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.github/workflows/lint-format.yaml +0 -0
  40. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.gitignore +0 -0
  41. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.mega-linter.yaml +0 -0
  42. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/.pylintrc +0 -0
  43. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/CITATION.cff +0 -0
  44. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/CONTRIBUTING.md +0 -0
  45. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/LICENSE +0 -0
  46. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/__init__.py +0 -0
  47. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/__main__.py +0 -0
  48. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/__init__.py +0 -0
  49. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/abstract_estimator.py +0 -0
  50. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/abstract_regression_estimator.py +0 -0
  51. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/cubic_spline_estimator.py +0 -0
  52. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/effect_estimate.py +0 -0
  53. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/experimental_estimator.py +0 -0
  54. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/genetic_programming_regression_fitter.py +0 -0
  55. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/instrumental_variable_estimator.py +0 -0
  56. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/estimation/logistic_regression_estimator.py +0 -0
  57. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/specification/__init__.py +0 -0
  58. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/specification/causal_dag.py +0 -0
  59. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/specification/scenario.py +0 -0
  60. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/specification/variable.py +0 -0
  61. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/surrogate/__init__.py +0 -0
  62. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/surrogate/causal_surrogate_assisted.py +0 -0
  63. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/surrogate/surrogate_search_algorithms.py +0 -0
  64. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/__init__.py +0 -0
  65. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/base_test_case.py +0 -0
  66. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/causal_effect.py +0 -0
  67. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/causal_test_adequacy.py +0 -0
  68. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/causal_test_case.py +0 -0
  69. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/causal_test_result.py +0 -0
  70. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/effect.py +0 -0
  71. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/testing/intervention.py +0 -0
  72. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/utils/__init__.py +0 -0
  73. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing/utils/validation.py +0 -0
  74. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing_framework.egg-info/dependency_links.txt +0 -0
  75. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/causal_testing_framework.egg-info/top_level.txt +0 -0
  76. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/codecov.yml +0 -0
  77. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/.dockerignore +0 -0
  78. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/.env +0 -0
  79. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/Dockerfile +0 -0
  80. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/README.md +0 -0
  81. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/data/inputs/causal-tests/causal_tests.json +0 -0
  82. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/data/inputs/dag-data/dag.dot +0 -0
  83. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/data/inputs/runtime-data/runtime_data.csv +0 -0
  84. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/data/outputs/causal_test_results.json +0 -0
  85. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/docker-compose.yaml +0 -0
  86. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/dafni/model_definition.yaml +0 -0
  87. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/Makefile +0 -0
  88. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/README.md +0 -0
  89. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/make.bat +0 -0
  90. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/_static/css/custom.css +0 -0
  91. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/_static/images/CITCOM-logo-white.png +0 -0
  92. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/_static/images/CITCOM-logo.png +0 -0
  93. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/_static/images/Sheffield-logo.png +0 -0
  94. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/_static/images/example_dag.png +0 -0
  95. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/background.rst +0 -0
  96. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/conf.py +0 -0
  97. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/credits.rst +0 -0
  98. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/dev/actions_and_webhooks.rst +0 -0
  99. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/dev/documentation.rst +0 -0
  100. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/dev/version_release.rst +0 -0
  101. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/glossary.rst +0 -0
  102. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/modules/causal_specification.rst +0 -0
  103. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/requirements.txt +0 -0
  104. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/poisson_line_process/causal_tests.json +0 -0
  105. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/poisson_line_process/dag.dot +0 -0
  106. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/poisson_line_process/dag.png +0 -0
  107. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/poisson_line_process/data/random/data_random_1000.csv +0 -0
  108. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/causal_tests.json +0 -0
  109. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/dag.dot +0 -0
  110. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/dag_image.png +0 -0
  111. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/vaccinating_elderly/simulated_data.csv +0 -0
  112. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials/visualising_causal_test_results/visualise_causal_test_results.ipynb +0 -0
  113. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/docs/source/tutorials.rst +0 -0
  114. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/.gitignore +0 -0
  115. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/README.md +0 -0
  116. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/dag.dot +0 -0
  117. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/dag.png +0 -0
  118. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/10k_observational_data.csv +0 -0
  119. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/high_contacts_avg_age_22.2.csv +0 -0
  120. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/high_contacts_avg_age_30.1.csv +0 -0
  121. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/low_contacts_avg_age_22.2.csv +0 -0
  122. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/low_contacts_avg_age_30.1.csv +0 -0
  123. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/older_population.csv +0 -0
  124. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/data/younger_population.csv +0 -0
  125. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/doubling_beta/example_beta.py +0 -0
  126. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/vaccinating_elderly/README.md +0 -0
  127. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/vaccinating_elderly/dag.dot +0 -0
  128. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/vaccinating_elderly/dag.png +0 -0
  129. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/vaccinating_elderly/example_vaccine.py +0 -0
  130. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/covasim_/vaccinating_elderly/simulated_data.csv +0 -0
  131. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/README.md +0 -0
  132. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/dag.dot +0 -0
  133. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/dag.png +0 -0
  134. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/data/normalised_results.csv +0 -0
  135. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/data/results.csv +0 -0
  136. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/lr91/example_max_conductances.py +0 -0
  137. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/.gitignore +0 -0
  138. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/causal_tests.json +0 -0
  139. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/dag.dot +0 -0
  140. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/dag.png +0 -0
  141. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/random/data_random_1000.csv +0 -0
  142. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh10_100.csv +0 -0
  143. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh1_100.csv +0 -0
  144. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh2_100.csv +0 -0
  145. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh3_100.csv +0 -0
  146. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh4_100.csv +0 -0
  147. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh5_100.csv +0 -0
  148. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh6_100.csv +0 -0
  149. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh7_100.csv +0 -0
  150. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh8_100.csv +0 -0
  151. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/data/smt_100/data_smt_wh9_100.csv +0 -0
  152. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/examples/poisson-line-process/poisson_line_process.ipynb +0 -0
  153. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/images/.gitignore +0 -0
  154. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/images/schematic-dark.png +0 -0
  155. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/images/schematic.png +0 -0
  156. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/images/schematic.tex +0 -0
  157. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/paper/paper.bib +0 -0
  158. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/paper/paper.md +0 -0
  159. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/setup.cfg +0 -0
  160. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/__init__.py +0 -0
  161. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_cubic_spline_estimator.py +0 -0
  162. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_experimental_estimator.py +0 -0
  163. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_genetic_programming_regression_fitter.py +0 -0
  164. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_instrumental_variable_estimator.py +0 -0
  165. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_ipcw_estimator.py +0 -0
  166. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_linear_regression_estimator.py +0 -0
  167. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/estimation_tests/test_logistic_regression_estimator.py +0 -0
  168. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/dag.dot +0 -0
  169. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/dag.xml +0 -0
  170. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/data.csv +0 -0
  171. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/data.pqt +0 -0
  172. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/data_with_categorical.csv +0 -0
  173. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/data_with_meta.csv +0 -0
  174. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/nhefs.csv +0 -0
  175. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/scarf_data.csv +0 -0
  176. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/resources/data/temporal_data.csv +0 -0
  177. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/specification_tests/test_causal_dag.py +0 -0
  178. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/specification_tests/test_variable.py +0 -0
  179. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/surrogate_tests/test_causal_surrogate_assisted.py +0 -0
  180. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/testing_tests/test_causal_effect.py +0 -0
  181. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/testing_tests/test_causal_test_case.py +0 -0
  182. {causal_testing_framework-14.1.0 → causal_testing_framework-14.2.0}/tests/tutorial_tests/test_tutorials.py +0 -0
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  os: ["ubuntu-latest", "windows-latest", "macos-latest"]
16
- python-version: ["3.10", "3.11", "3.12"]
16
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
17
17
  steps:
18
18
  - uses: actions/checkout@v4
19
19
  - name: Set up Python
@@ -18,7 +18,7 @@ jobs:
18
18
  strategy:
19
19
  matrix:
20
20
  os: ["ubuntu-latest", "windows-latest", "macos-latest"]
21
- python-version: ["3.10", "3.11", "3.12", "3.13"]
21
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
22
22
  steps:
23
23
  - uses: actions/checkout@v4
24
24
  - name: Set up Python
@@ -40,7 +40,7 @@ jobs:
40
40
 
41
41
  - uses: actions/setup-python@v3
42
42
  with:
43
- python-version: '3.10'
43
+ python-version: '3.11'
44
44
 
45
45
  - name: Install dependencies
46
46
  run: |
@@ -16,7 +16,7 @@ jobs:
16
16
  - name: Set up Python
17
17
  uses: actions/setup-python@v3
18
18
  with:
19
- python-version: '3.10'
19
+ python-version: '3.11'
20
20
 
21
21
  - name: Install build tools
22
22
  run: |
@@ -19,7 +19,7 @@ repos:
19
19
  rev: 25.9.0
20
20
  hooks:
21
21
  - id: black
22
- args: ['--line-length=120', '--target-version=py310']
22
+ args: ['--line-length=120', '--target-version=py311']
23
23
  files: ^causal_testing/
24
24
 
25
25
  - repo: https://github.com/pycqa/isort
@@ -7,9 +7,9 @@ version: 2
7
7
 
8
8
  # Set the version of Python
9
9
  build:
10
- os: ubuntu-20.04
10
+ os: ubuntu-24.04
11
11
  tools:
12
- python: "3.10"
12
+ python: "3.11"
13
13
 
14
14
  # Build documentation in the docs/ directory with Sphinx
15
15
  sphinx:
@@ -24,4 +24,4 @@ python:
24
24
  install:
25
25
  - requirements: docs/source/requirements.txt
26
26
  - method: pip
27
- path: . # This should tell RTD to install the CTF from root to render the Estimators page correctly.
27
+ path: . # This should tell RTD to install the CTF from root to render the Estimators page correctly.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: causal_testing_framework
3
- Version: 14.1.0
3
+ Version: 14.2.0
4
4
  Summary: A framework for causal testing using causal directed acyclic graphs.
5
5
  Author: The CITCOM team
6
6
  License: MIT
@@ -9,25 +9,23 @@ Project-URL: Documentation, https://causal-testing-framework.readthedocs.io/
9
9
  Project-URL: Repository, https://github.com/CITCOM-project/CausalTestingFramework
10
10
  Project-URL: Issues, https://github.com/CITCOM-project/CausalTestingFramework/issues
11
11
  Keywords: causal inference,verification
12
- Requires-Python: <3.14,>=3.10
12
+ Requires-Python: <3.15,>=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: lifelines<=0.28.0; python_version <= "3.10"
16
- Requires-Dist: lifelines; python_version > "3.10"
17
- Requires-Dist: networkx<3.5,>=3.4
18
- Requires-Dist: numpy<=2.2.0,>=1.26.0
19
- Requires-Dist: pandas<3,>=2.1
15
+ Requires-Dist: lifelines
16
+ Requires-Dist: networkx<3.7,>=3.4
17
+ Requires-Dist: numpy<=2.4.4,>=1.26.0
18
+ Requires-Dist: pandas>=2.1
20
19
  Requires-Dist: scikit_learn~=1.4
21
- Requires-Dist: scipy<1.14,>=1.12.0; python_version <= "3.10"
22
- Requires-Dist: scipy<=1.16.2,>=1.12.0; python_version > "3.10"
20
+ Requires-Dist: scipy<=1.17.1,>=1.12.0
23
21
  Requires-Dist: statsmodels~=0.14
24
22
  Requires-Dist: tabulate~=0.9
25
23
  Requires-Dist: pydot~=2.0
26
24
  Requires-Dist: pygad~=3.3
27
25
  Requires-Dist: deap~=1.4.1
28
- Requires-Dist: sympy~=1.13.1
29
- Requires-Dist: pyarrow~=19.0.1
30
- Requires-Dist: fastparquet~=2024.11.0
26
+ Requires-Dist: sympy~=1.14.0
27
+ Requires-Dist: pyarrow<25,>=19.0.1
28
+ Requires-Dist: fastparquet>=2024.11.0
31
29
  Requires-Dist: tqdm~=4.67.1
32
30
  Provides-Extra: dev
33
31
  Requires-Dist: astroid==3.3.8; extra == "dev"
@@ -80,7 +78,7 @@ a deliberate modification to the input configuration expected to produce a corre
80
78
  ## Installation
81
79
 
82
80
  ### Requirements
83
- - Python 3.10, 3.11, 3.12 and 3.13
81
+ - Python 3.11, 3.12, 3.13 and 3.14
84
82
 
85
83
  ### Recommended: Install from conda-forge
86
84
 
@@ -142,12 +140,12 @@ For more information on how to use the Causal Testing Framework, please refer to
142
140
 
143
141
  2. If you do not already have causal test cases, you can convert your causal DAG to causal tests by running the following command.
144
142
  ```
145
- python -m causal_testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
143
+ causal-testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
146
144
  ```
147
145
 
148
146
  3. You can now execute your tests by running the following command.
149
147
  ```
150
- python -m causal_testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
148
+ causal-testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
151
149
  ```
152
150
  The results will be saved for inspection in a JSON file located at `$OUTPUT`.
153
151
  In the future, we hope to add a visualisation tool to assist with this.
@@ -27,7 +27,7 @@ a deliberate modification to the input configuration expected to produce a corre
27
27
  ## Installation
28
28
 
29
29
  ### Requirements
30
- - Python 3.10, 3.11, 3.12 and 3.13
30
+ - Python 3.11, 3.12, 3.13 and 3.14
31
31
 
32
32
  ### Recommended: Install from conda-forge
33
33
 
@@ -89,12 +89,12 @@ For more information on how to use the Causal Testing Framework, please refer to
89
89
 
90
90
  2. If you do not already have causal test cases, you can convert your causal DAG to causal tests by running the following command.
91
91
  ```
92
- python -m causal_testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
92
+ causal-testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
93
93
  ```
94
94
 
95
95
  3. You can now execute your tests by running the following command.
96
96
  ```
97
- python -m causal_testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
97
+ causal-testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
98
98
  ```
99
99
  The results will be saved for inspection in a JSON file located at `$OUTPUT`.
100
100
  In the future, we hope to add a visualisation tool to assist with this.
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '14.2.0'
22
+ __version_tuple__ = version_tuple = (14, 2, 0)
23
+
24
+ __commit_id__ = commit_id = 'g9f06df212'
@@ -115,7 +115,7 @@ class IPCWEstimator(Estimator):
115
115
  pd.Series(strategy_assigned, index=individual.index) != pd.Series(strategy_followed, index=individual.index)
116
116
  ).astype("boolean")
117
117
  mask = mask | ~individual["eligible"]
118
- mask.reset_index(inplace=True, drop=True)
118
+ mask = mask.reset_index(drop=True)
119
119
  false = mask.loc[mask]
120
120
  if false.empty:
121
121
  return pd.DataFrame(
@@ -106,7 +106,7 @@ class LinearRegressionEstimator(RegressionEstimator):
106
106
 
107
107
  if any(
108
108
  (
109
- self.df.dtypes[factor.name()] == "object"
109
+ not pd.api.types.is_numeric_dtype(self.df.dtypes[factor.name()])
110
110
  for factor in patsy_md.rhs_termlist[1].factors
111
111
  # We want to remove this long term as it prevents us from discovering categoricals within I(...) blocks
112
112
  if factor.name() in self.df.dtypes
@@ -7,18 +7,16 @@ from dataclasses import dataclass
7
7
  from enum import Enum
8
8
  from pathlib import Path
9
9
  from typing import Any, Dict, List, Optional, Sequence, Union
10
+ from importlib.metadata import entry_points
10
11
 
11
12
  import numpy as np
12
13
  import pandas as pd
13
14
  from tqdm import tqdm
14
15
 
15
- from causal_testing.estimation.linear_regression_estimator import LinearRegressionEstimator
16
- from causal_testing.estimation.logistic_regression_estimator import LogisticRegressionEstimator
17
16
  from causal_testing.specification.causal_dag import CausalDAG
18
17
  from causal_testing.specification.scenario import Scenario
19
18
  from causal_testing.specification.variable import Input, Output
20
19
  from causal_testing.testing.base_test_case import BaseTestCase
21
- from causal_testing.testing.causal_effect import Negative, NoEffect, Positive, SomeEffect
22
20
  from causal_testing.testing.causal_test_adequacy import DataAdequacy
23
21
  from causal_testing.testing.causal_test_case import CausalTestCase
24
22
  from causal_testing.testing.causal_test_result import CausalTestResult
@@ -259,48 +257,30 @@ class CausalTestingFramework:
259
257
  :return: CausalTestCase object
260
258
  :raises: ValueError if invalid estimator or configuration is provided
261
259
  """
262
- # Map effect string to effect class
263
- effect_map = {
264
- "NoEffect": NoEffect(),
265
- "SomeEffect": SomeEffect(),
266
- "Positive": Positive(),
267
- "Negative": Negative(),
268
- }
269
-
270
- # Map estimator string to estimator class
271
- estimator_map = {
272
- "LinearRegressionEstimator": LinearRegressionEstimator,
273
- "LogisticRegressionEstimator": LogisticRegressionEstimator,
274
- }
260
+ estimator_map = {ff.name: ff for ff in entry_points(group="estimators")}
261
+ effect_map = {ff.name: ff for ff in entry_points(group="causal_effects")}
275
262
 
276
263
  if "estimator" not in test:
277
264
  raise ValueError("Test configuration must specify an estimator")
278
265
 
279
- # Get the estimator class
280
- estimator_class = estimator_map.get(test["estimator"])
281
- if estimator_class is None:
282
- raise ValueError(f"Unknown estimator: {test['estimator']}")
283
-
284
- # Handle combined queries (global and test-specific)
285
- test_query = test.get("query")
286
- combined_query = None
287
-
288
- if self.query and test_query:
289
- combined_query = f"({self.query}) and ({test_query})"
290
- logger.info(
291
- f"Combining global query '{self.query}' with test-specific query "
292
- f"'{test_query}' for test '{test['name']}'"
266
+ if test["estimator"] not in estimator_map:
267
+ raise ValueError(
268
+ f"Unsupported estimator {test['estimator']}. Supported: {sorted(estimator_map)}. "
269
+ "If you have implemented a custom estimator, you will need to add this to your entrypoints via your "
270
+ "pyproject.toml file."
293
271
  )
294
- elif test_query:
295
- combined_query = test_query
296
- logger.info(f"Using test-specific query for '{test['name']}': {test_query}")
297
- elif self.query:
298
- combined_query = self.query
299
- logger.info(f"Using global query for '{test['name']}': {self.query}")
300
272
 
301
- filtered_df = self.data.query(combined_query) if combined_query else self.data
273
+ # Handle global queries
274
+ # Test-specific queries are handled by the estimator as not all estimators support them
275
+ filtered_df = self.data
276
+ if self.query:
277
+ filtered_df = self.data.query(self.query)
302
278
 
303
279
  # Create the estimator with correct parameters
280
+ estimator_class = estimator_map.get(test["estimator"]).load()
281
+ estimator_kwargs = test.get("estimator_kwargs", {})
282
+ if "query" in test:
283
+ estimator_kwargs["query"] = test["query"]
304
284
  estimator = estimator_class(
305
285
  base_test_case=base_test,
306
286
  treatment_value=test.get("treatment_value"),
@@ -310,15 +290,19 @@ class CausalTestingFramework:
310
290
  self.dag.identification(base_test, self.scenario.hidden_variables()),
311
291
  ),
312
292
  df=filtered_df,
313
- effect_modifiers=None,
314
- formula=test.get("formula"),
315
293
  alpha=test.get("alpha", 0.05),
316
- query=combined_query,
294
+ **estimator_kwargs,
317
295
  )
318
296
 
319
297
  # Get effect type and create expected effect
320
298
  effect_type = test["expected_effect"][base_test.outcome_variable.name]
321
- expected_effect = effect_map[effect_type]
299
+ if effect_type not in effect_map:
300
+ raise ValueError(
301
+ f"Unsupported causal effect {effect_type}. Supported: {sorted(effect_map)}. "
302
+ "If you have implemented a custom causal effect, you will need to add this to your entrypoints via "
303
+ "your pyproject.toml file."
304
+ )
305
+ expected_effect = effect_map[effect_type].load()(**test.get("effect_kwargs", {}))
322
306
 
323
307
  return CausalTestCase(
324
308
  base_test_case=base_test,
@@ -49,18 +49,26 @@ class MetamorphicRelation:
49
49
  :param estimator: The name of the estimator class to use when evaluating the test
50
50
  :param alpha: The significance level to use when calculating the confidence intervals
51
51
  """
52
+ if estimator not in ["LinearRegressionEstimator", "LogisticRegressionEstimator"]:
53
+ raise ValueError(
54
+ f"Unsupported estimator {estimator}. "
55
+ "We only support autogeneration using LinearRegressionEstimator or LogisticRegressionEstimator."
56
+ "More advanced estimators require careful thought that cannot be easily automated."
57
+ )
52
58
  return {
53
59
  "name": str(self),
54
60
  "estimator": estimator,
55
61
  "estimate_type": estimate_type,
56
62
  "effect": effect_type,
57
63
  "treatment_variable": self.base_test_case.treatment_variable,
58
- "formula": (
59
- f"{self.base_test_case.outcome_variable} ~ "
60
- f"{' + '.join([self.base_test_case.treatment_variable] + self.adjustment_vars)}"
61
- ),
62
64
  "alpha": alpha,
63
65
  "skip": skip,
66
+ "estimator_kwargs": {
67
+ "formula": (
68
+ f"{self.base_test_case.outcome_variable} ~ "
69
+ f"{' + '.join([self.base_test_case.treatment_variable] + self.adjustment_vars)}"
70
+ ),
71
+ },
64
72
  }
65
73
 
66
74
 
@@ -271,7 +279,7 @@ def generate_causal_tests(
271
279
 
272
280
  logger.warning(
273
281
  "The skip parameter is hard-coded to False during test generation for better integration with the "
274
- "causal testing component (python -m causal_testing test ...)"
282
+ "causal testing component (causal-testing test ...)"
275
283
  "Please carefully review the generated tests and decide which to skip."
276
284
  )
277
285
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: causal_testing_framework
3
- Version: 14.1.0
3
+ Version: 14.2.0
4
4
  Summary: A framework for causal testing using causal directed acyclic graphs.
5
5
  Author: The CITCOM team
6
6
  License: MIT
@@ -9,25 +9,23 @@ Project-URL: Documentation, https://causal-testing-framework.readthedocs.io/
9
9
  Project-URL: Repository, https://github.com/CITCOM-project/CausalTestingFramework
10
10
  Project-URL: Issues, https://github.com/CITCOM-project/CausalTestingFramework/issues
11
11
  Keywords: causal inference,verification
12
- Requires-Python: <3.14,>=3.10
12
+ Requires-Python: <3.15,>=3.11
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: lifelines<=0.28.0; python_version <= "3.10"
16
- Requires-Dist: lifelines; python_version > "3.10"
17
- Requires-Dist: networkx<3.5,>=3.4
18
- Requires-Dist: numpy<=2.2.0,>=1.26.0
19
- Requires-Dist: pandas<3,>=2.1
15
+ Requires-Dist: lifelines
16
+ Requires-Dist: networkx<3.7,>=3.4
17
+ Requires-Dist: numpy<=2.4.4,>=1.26.0
18
+ Requires-Dist: pandas>=2.1
20
19
  Requires-Dist: scikit_learn~=1.4
21
- Requires-Dist: scipy<1.14,>=1.12.0; python_version <= "3.10"
22
- Requires-Dist: scipy<=1.16.2,>=1.12.0; python_version > "3.10"
20
+ Requires-Dist: scipy<=1.17.1,>=1.12.0
23
21
  Requires-Dist: statsmodels~=0.14
24
22
  Requires-Dist: tabulate~=0.9
25
23
  Requires-Dist: pydot~=2.0
26
24
  Requires-Dist: pygad~=3.3
27
25
  Requires-Dist: deap~=1.4.1
28
- Requires-Dist: sympy~=1.13.1
29
- Requires-Dist: pyarrow~=19.0.1
30
- Requires-Dist: fastparquet~=2024.11.0
26
+ Requires-Dist: sympy~=1.14.0
27
+ Requires-Dist: pyarrow<25,>=19.0.1
28
+ Requires-Dist: fastparquet>=2024.11.0
31
29
  Requires-Dist: tqdm~=4.67.1
32
30
  Provides-Extra: dev
33
31
  Requires-Dist: astroid==3.3.8; extra == "dev"
@@ -80,7 +78,7 @@ a deliberate modification to the input configuration expected to produce a corre
80
78
  ## Installation
81
79
 
82
80
  ### Requirements
83
- - Python 3.10, 3.11, 3.12 and 3.13
81
+ - Python 3.11, 3.12, 3.13 and 3.14
84
82
 
85
83
  ### Recommended: Install from conda-forge
86
84
 
@@ -142,12 +140,12 @@ For more information on how to use the Causal Testing Framework, please refer to
142
140
 
143
141
  2. If you do not already have causal test cases, you can convert your causal DAG to causal tests by running the following command.
144
142
  ```
145
- python -m causal_testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
143
+ causal-testing generate --dag-path $PATH_TO_DAG --output $PATH_TO_TESTS
146
144
  ```
147
145
 
148
146
  3. You can now execute your tests by running the following command.
149
147
  ```
150
- python -m causal_testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
148
+ causal-testing test --dag-path $PATH_TO_DAG --data-paths $PATH_TO_DATA --test-config $PATH_TO_TESTS --output $OUTPUT
151
149
  ```
152
150
  The results will be saved for inspection in a JSON file located at `$OUTPUT`.
153
151
  In the future, we hope to add a visualisation tool to assist with this.
@@ -54,6 +54,7 @@ causal_testing/utils/validation.py
54
54
  causal_testing_framework.egg-info/PKG-INFO
55
55
  causal_testing_framework.egg-info/SOURCES.txt
56
56
  causal_testing_framework.egg-info/dependency_links.txt
57
+ causal_testing_framework.egg-info/entry_points.txt
57
58
  causal_testing_framework.egg-info/requires.txt
58
59
  causal_testing_framework.egg-info/top_level.txt
59
60
  dafni/.dockerignore
@@ -88,6 +89,7 @@ docs/source/dev/documentation.rst
88
89
  docs/source/dev/version_release.rst
89
90
  docs/source/modules/causal_specification.rst
90
91
  docs/source/modules/causal_testing.rst
92
+ docs/source/modules/custom_estimators.rst
91
93
  docs/source/modules/estimators.rst
92
94
  docs/source/tutorials/poisson_line_process/causal_tests.json
93
95
  docs/source/tutorials/poisson_line_process/dag.dot
@@ -0,0 +1,16 @@
1
+ [causal_effects]
2
+ ExactValue = causal_testing.testing.causal_effect:ExactValue
3
+ Negative = causal_testing.testing.causal_effect:Negative
4
+ NoEffect = causal_testing.testing.causal_effect:NoEffect
5
+ Positive = causal_testing.testing.causal_effect:Positive
6
+ SomeEffect = causal_testing.testing.causal_effect:SomeEffect
7
+
8
+ [console_scripts]
9
+ causal-testing = causal_testing.__main__:main
10
+
11
+ [estimators]
12
+ CubicSplineEstimator = causal_testing.estimation.cubic_spline_estimator:CubicSplineEstimator
13
+ IPCWEstimator = causal_testing.estimation.ipcw_estimator:IPCWEstimator
14
+ InstrumentalVariableEstimator = causal_testing.estimation.instrumental_variable_estimator:InstrumentalVariableEstimator
15
+ LinearRegressionEstimator = causal_testing.estimation.linear_regression_estimator:LinearRegressionEstimator
16
+ LogisticRegressionEstimator = causal_testing.estimation.logistic_regression_estimator:LogisticRegressionEstimator
@@ -1,25 +1,19 @@
1
- networkx<3.5,>=3.4
2
- numpy<=2.2.0,>=1.26.0
3
- pandas<3,>=2.1
1
+ lifelines
2
+ networkx<3.7,>=3.4
3
+ numpy<=2.4.4,>=1.26.0
4
+ pandas>=2.1
4
5
  scikit_learn~=1.4
6
+ scipy<=1.17.1,>=1.12.0
5
7
  statsmodels~=0.14
6
8
  tabulate~=0.9
7
9
  pydot~=2.0
8
10
  pygad~=3.3
9
11
  deap~=1.4.1
10
- sympy~=1.13.1
11
- pyarrow~=19.0.1
12
- fastparquet~=2024.11.0
12
+ sympy~=1.14.0
13
+ pyarrow<25,>=19.0.1
14
+ fastparquet>=2024.11.0
13
15
  tqdm~=4.67.1
14
16
 
15
- [:python_version <= "3.10"]
16
- lifelines<=0.28.0
17
- scipy<1.14,>=1.12.0
18
-
19
- [:python_version > "3.10"]
20
- lifelines
21
- scipy<=1.16.2,>=1.12.0
22
-
23
17
  [dev]
24
18
  astroid==3.3.8
25
19
  isort
@@ -74,7 +74,7 @@ if [ "$EXECUTION_MODE" = "generate" ]; then
74
74
  echo "Running causal_testing GENERATE..."
75
75
  echo "Will write causal tests to: $CAUSAL_TESTS_OUTPUT_PATH"
76
76
 
77
- python -m causal_testing generate \
77
+ causal-testing generate \
78
78
  -D "$DAG_PATH" \
79
79
  -o "$CAUSAL_TESTS_OUTPUT_PATH" \
80
80
  -e "$ESTIMATOR" \
@@ -107,7 +107,7 @@ elif [ "$EXECUTION_MODE" = "test" ]; then
107
107
  # Build command with adequacy flags only when ADEQUACY is true
108
108
  if [ "$ADEQUACY" = "true" ]; then
109
109
  echo "DEBUG: Executing WITH adequacy flags"
110
- python -m causal_testing test \
110
+ causal-testing test \
111
111
  -D "$DAG_PATH" \
112
112
  -d $DATA_PATHS \
113
113
  -t "$CAUSAL_TESTS_INPUT_PATH" \
@@ -120,7 +120,7 @@ elif [ "$EXECUTION_MODE" = "test" ]; then
120
120
  $([ "$BATCH_SIZE" != "0" ] && echo "--batch-size $BATCH_SIZE")
121
121
  else
122
122
  echo "DEBUG: Executing WITHOUT adequacy flags"
123
- python -m causal_testing test \
123
+ causal-testing test \
124
124
  -D "$DAG_PATH" \
125
125
  -d $DATA_PATHS \
126
126
  -t "$CAUSAL_TESTS_INPUT_PATH" \
@@ -41,6 +41,7 @@ If you have any questions about our framework, you can also reach us by `email <
41
41
 
42
42
  /modules/causal_specification
43
43
  /modules/estimators
44
+ /modules/custom_estimators
44
45
  /modules/causal_testing
45
46
 
46
47
  .. toctree::
@@ -3,7 +3,7 @@ Getting Started
3
3
 
4
4
  Installation
5
5
  -----------------
6
- * We currently support Python versions 3.10, 3.11, 3.12, and 3.13.
6
+ * We currently support Python versions 3.11, 3.12, 3.13, and 3.14.
7
7
 
8
8
  * The Causal Testing Framework can be installed through `conda-forge`_ (recommended), the `Python Package Index (PyPI)`_, or directly from source (recommended for contributors).
9
9
 
@@ -95,11 +95,11 @@ Next Steps
95
95
  * Read about :doc:`modules/causal_specification` to understand causal specifications and :doc:`modules/causal_testing` for the end-to-end causal testing process.
96
96
  * Run the command for guidance on how to generate your causal tests directly from your input DAG::
97
97
 
98
- python -m causal_testing generate --help
98
+ causal-testing generate --help
99
99
 
100
100
  * and the command on guidance on how to execute your causal tests::
101
101
 
102
- python -m causal_testing test --help
102
+ causal-testing test --help
103
103
 
104
104
 
105
105
  Using the CTF on DAFNI
@@ -34,7 +34,7 @@ In the following sections, we describe the end-to-end process of ``causal testin
34
34
  In particular, suppose we're interested in how various precautions, such as hand-washing and mask-wearing, can prevent the spread of a virus within a classroom.
35
35
 
36
36
  1. Modelling Scenario
37
- ----------------
37
+ ---------------------
38
38
 
39
39
  For our modelling scenario, suppose we define the scenario with the following constraints:
40
40
 
@@ -0,0 +1,65 @@
1
+ Custom Estimators
2
+ =================
3
+
4
+ If the supported :ref:`estimators` are not sufficient for your needs, you can implement your own custom estimator by extending the :code:`Estimator` class and implementing the abstract :code:`add_modelling_assumptions` method and the estimation method for the causal effect measure you wish to calculate.
5
+ For example, if you wished to estimate the ATE using the empirical mean of the recorded outcome under the control and treatment values, you would need to implement a method called :code:`estimate_ate`.
6
+ If you wished to estimate the risk ratio, you would need to call your method :code:`estimate_risk_ratio`.
7
+ The code for the :code:`EmpiricalMeanEstimator` is shown below.
8
+
9
+ .. code-block:: python
10
+
11
+ from causal_testing.estimation.abstract_estimator import Estimator
12
+ from scipy.stats import bootstrap
13
+
14
+ class EmpiricalMeanEstimator(Estimator):
15
+ """
16
+ Custom estimator class to estimate the causal effect based on the empirical mean.
17
+ """
18
+
19
+ def add_modelling_assumptions(self):
20
+ """
21
+ Add modelling assumptions to the estimator. This is a list of strings which list the modelling assumptions that
22
+ must hold if the resulting causal inference is to be considered valid.
23
+ """
24
+ self.modelling_assumptions += "The data must contain runs with the exact configuration of interest."
25
+
26
+ def estimate_ate(self) -> EffectEstimate:
27
+ """Estimate the outcomes under control and treatment.
28
+ :return: The empirical average treatment effect.
29
+ """
30
+ treatment_variable = self.base_test_case.treatment_variable.name
31
+ outcome_variable = self.base_test_case.outcome_variable.name
32
+
33
+ control_results = self.df.where(self.df[treatment_variable] == self.control_value)[outcome_variable].dropna()
34
+ treatment_results = self.df.where(self.df[treatment_variable] == self.treatment_value)[
35
+ outcome_variable
36
+ ].dropna()
37
+
38
+ def risk_ratio(sample1, sample2):
39
+ return sample1.mean() - sample2.mean()
40
+
41
+ bootstraps = bootstrap((treatment_results, control_results), risk_ratio, confidence_level=self.alpha)
42
+ return EffectEstimate(
43
+ type="risk_ratio",
44
+ value=risk_ratio(treatment_results, control_results),
45
+ ci_low=bootstraps.confidence_interval.low,
46
+ ci_high=bootstraps.confidence_interval.high,
47
+ )
48
+
49
+ Once you have implemented your estimator, you will need to register it as an extra entry point in your project's :code:`pyproject.toml` file so that the Causal Testing Framework can find it.
50
+ For example, if you had defined your :code:`EmpiricalMeanEstimator` class in a module called :code:`empirical_mean_estimator` in a folder called :code:`custom_estimators`, you would register it as follows.
51
+ You will also need to reinstall your project, e.g. with :code:`pip install -e .` each time you add a new estimator to your :code:`pyproject.toml`.
52
+ You do not need to reinstall each time you edit your project for source code edits.
53
+
54
+
55
+ .. code-block:: ini
56
+
57
+ [project.entry-points."estimators"]
58
+ CustomFlakefighter = "custom_estimators.empirical_mean_estimator:EmpiricalMeanEstimator"
59
+
60
+ Of course, for this to work, your module needs to be discoverable on your python path.
61
+ That is, you should be able to execute :code:`from custom_estimators.empirical_mean_estimator import EmpiricalMeanEstimator` successfully from within the current working directory.
62
+
63
+ You can also add your custom estimator to causal test cases specified in JSON.
64
+ To do so, you can simply set the :code:`estimator` property to the name of your estimator class and the :code:`estimate_type` property to the name of your causal effect measure.
65
+ In the above :code:`EmpiricalMeanEstimator` example, :code:`estimator` would be set to :code:`"EmpiricalMeanEstimator"` and :code:`estimate_type` would be set to :code:`"ate"`.
@@ -1,3 +1,5 @@
1
+ .. _estimators:
2
+
1
3
  Estimators Overview
2
4
  ===================
3
5