shap-gpu 0.0.1.dev0__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 (306) hide show
  1. shap_gpu-0.0.1.dev0/.git-blame-ignore-revs +13 -0
  2. shap_gpu-0.0.1.dev0/.gitattributes +5 -0
  3. shap_gpu-0.0.1.dev0/.github/ISSUE_TEMPLATE/bug-report.yml +75 -0
  4. shap_gpu-0.0.1.dev0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  5. shap_gpu-0.0.1.dev0/.github/ISSUE_TEMPLATE/feature-request.yml +40 -0
  6. shap_gpu-0.0.1.dev0/.github/PULL_REQUEST_TEMPLATE.md +12 -0
  7. shap_gpu-0.0.1.dev0/.github/codecov.yml +13 -0
  8. shap_gpu-0.0.1.dev0/.github/dependabot.yml +12 -0
  9. shap_gpu-0.0.1.dev0/.github/release.yml +26 -0
  10. shap_gpu-0.0.1.dev0/.github/workflows/build_gpu.yml +27 -0
  11. shap_gpu-0.0.1.dev0/.github/workflows/build_wheels.yml +188 -0
  12. shap_gpu-0.0.1.dev0/.github/workflows/codeql-analysis.yml +86 -0
  13. shap_gpu-0.0.1.dev0/.github/workflows/run_notebooks.yml +41 -0
  14. shap_gpu-0.0.1.dev0/.github/workflows/run_tests.yml +212 -0
  15. shap_gpu-0.0.1.dev0/.github/workflows/stale_issues.yml +59 -0
  16. shap_gpu-0.0.1.dev0/.github/workflows/test_js.yml +47 -0
  17. shap_gpu-0.0.1.dev0/.gitignore +43 -0
  18. shap_gpu-0.0.1.dev0/.pre-commit-config.yaml +48 -0
  19. shap_gpu-0.0.1.dev0/.readthedocs.yml +23 -0
  20. shap_gpu-0.0.1.dev0/CMakeLists.txt +142 -0
  21. shap_gpu-0.0.1.dev0/CONTRIBUTING.md +425 -0
  22. shap_gpu-0.0.1.dev0/LICENSE +21 -0
  23. shap_gpu-0.0.1.dev0/PKG-INFO +451 -0
  24. shap_gpu-0.0.1.dev0/README.md +357 -0
  25. shap_gpu-0.0.1.dev0/javascript/.npmignore +2 -0
  26. shap_gpu-0.0.1.dev0/javascript/Makefile +3 -0
  27. shap_gpu-0.0.1.dev0/javascript/README.md +22 -0
  28. shap_gpu-0.0.1.dev0/javascript/babel.config.js +6 -0
  29. shap_gpu-0.0.1.dev0/javascript/developer-docs.md +19 -0
  30. shap_gpu-0.0.1.dev0/javascript/index.jsx +24 -0
  31. shap_gpu-0.0.1.dev0/javascript/jest.config.js +8 -0
  32. shap_gpu-0.0.1.dev0/javascript/package-lock.json +10386 -0
  33. shap_gpu-0.0.1.dev0/javascript/package.json +40 -0
  34. shap_gpu-0.0.1.dev0/javascript/random-explanation.js +25 -0
  35. shap_gpu-0.0.1.dev0/javascript/test_bundle.js +4 -0
  36. shap_gpu-0.0.1.dev0/javascript/tests/__snapshots__/render.spec.jsx.snap +136 -0
  37. shap_gpu-0.0.1.dev0/javascript/tests/render.spec.jsx +31 -0
  38. shap_gpu-0.0.1.dev0/javascript/visualizers/AdditiveForceArrayVisualizer.jsx +950 -0
  39. shap_gpu-0.0.1.dev0/javascript/visualizers/AdditiveForceVisualizer.jsx +611 -0
  40. shap_gpu-0.0.1.dev0/javascript/visualizers/SimpleListVisualizer.jsx +113 -0
  41. shap_gpu-0.0.1.dev0/javascript/visualizers/color-set.js +13 -0
  42. shap_gpu-0.0.1.dev0/javascript/visualizers/index.jsx +15 -0
  43. shap_gpu-0.0.1.dev0/javascript/webpack.config.js +54 -0
  44. shap_gpu-0.0.1.dev0/pyproject.toml +396 -0
  45. shap_gpu-0.0.1.dev0/requirements.ci.txt +51 -0
  46. shap_gpu-0.0.1.dev0/requirements.txt +16 -0
  47. shap_gpu-0.0.1.dev0/scripts/run_notebooks_timeouts.py +104 -0
  48. shap_gpu-0.0.1.dev0/shap/__init__.py +149 -0
  49. shap_gpu-0.0.1.dev0/shap/_explanation.py +1007 -0
  50. shap_gpu-0.0.1.dev0/shap/_serializable.py +201 -0
  51. shap_gpu-0.0.1.dev0/shap/_version.py +24 -0
  52. shap_gpu-0.0.1.dev0/shap/actions/__init__.py +3 -0
  53. shap_gpu-0.0.1.dev0/shap/actions/_action.py +16 -0
  54. shap_gpu-0.0.1.dev0/shap/actions/_optimizer.py +86 -0
  55. shap_gpu-0.0.1.dev0/shap/benchmark/__init__.py +9 -0
  56. shap_gpu-0.0.1.dev0/shap/benchmark/_compute.py +8 -0
  57. shap_gpu-0.0.1.dev0/shap/benchmark/_explanation_error.py +191 -0
  58. shap_gpu-0.0.1.dev0/shap/benchmark/_result.py +34 -0
  59. shap_gpu-0.0.1.dev0/shap/benchmark/_sequential.py +348 -0
  60. shap_gpu-0.0.1.dev0/shap/benchmark/experiments.py +428 -0
  61. shap_gpu-0.0.1.dev0/shap/benchmark/framework.py +117 -0
  62. shap_gpu-0.0.1.dev0/shap/benchmark/measures.py +444 -0
  63. shap_gpu-0.0.1.dev0/shap/benchmark/methods.py +165 -0
  64. shap_gpu-0.0.1.dev0/shap/benchmark/metrics.py +880 -0
  65. shap_gpu-0.0.1.dev0/shap/benchmark/models.py +219 -0
  66. shap_gpu-0.0.1.dev0/shap/benchmark/plots.py +612 -0
  67. shap_gpu-0.0.1.dev0/shap/cext/_cext.cc +580 -0
  68. shap_gpu-0.0.1.dev0/shap/cext/_cext_gpu.cc +192 -0
  69. shap_gpu-0.0.1.dev0/shap/cext/_cext_gpu.cu +435 -0
  70. shap_gpu-0.0.1.dev0/shap/cext/gpu_treeshap.h +1546 -0
  71. shap_gpu-0.0.1.dev0/shap/cext/tree_shap.h +1479 -0
  72. shap_gpu-0.0.1.dev0/shap/cutils/__init__.py +0 -0
  73. shap_gpu-0.0.1.dev0/shap/cutils/cutils.cpp +13 -0
  74. shap_gpu-0.0.1.dev0/shap/cutils/grey_code_utils.h +135 -0
  75. shap_gpu-0.0.1.dev0/shap/cutils/kernel_explainer_utils.h +45 -0
  76. shap_gpu-0.0.1.dev0/shap/datasets.py +713 -0
  77. shap_gpu-0.0.1.dev0/shap/explainers/__init__.py +41 -0
  78. shap_gpu-0.0.1.dev0/shap/explainers/_additive.py +230 -0
  79. shap_gpu-0.0.1.dev0/shap/explainers/_coalition.py +536 -0
  80. shap_gpu-0.0.1.dev0/shap/explainers/_deep/__init__.py +164 -0
  81. shap_gpu-0.0.1.dev0/shap/explainers/_deep/deep_pytorch.py +414 -0
  82. shap_gpu-0.0.1.dev0/shap/explainers/_deep/deep_tf.py +798 -0
  83. shap_gpu-0.0.1.dev0/shap/explainers/_deep/deep_utils.py +31 -0
  84. shap_gpu-0.0.1.dev0/shap/explainers/_exact.py +417 -0
  85. shap_gpu-0.0.1.dev0/shap/explainers/_explainer.py +581 -0
  86. shap_gpu-0.0.1.dev0/shap/explainers/_gpu_tree.py +180 -0
  87. shap_gpu-0.0.1.dev0/shap/explainers/_gradient.py +714 -0
  88. shap_gpu-0.0.1.dev0/shap/explainers/_kernel.py +794 -0
  89. shap_gpu-0.0.1.dev0/shap/explainers/_linear.py +515 -0
  90. shap_gpu-0.0.1.dev0/shap/explainers/_partition.py +786 -0
  91. shap_gpu-0.0.1.dev0/shap/explainers/_permutation.py +294 -0
  92. shap_gpu-0.0.1.dev0/shap/explainers/_sampling.py +227 -0
  93. shap_gpu-0.0.1.dev0/shap/explainers/_tree.py +2572 -0
  94. shap_gpu-0.0.1.dev0/shap/explainers/other/__init__.py +14 -0
  95. shap_gpu-0.0.1.dev0/shap/explainers/other/_coefficient.py +18 -0
  96. shap_gpu-0.0.1.dev0/shap/explainers/other/_lime.py +79 -0
  97. shap_gpu-0.0.1.dev0/shap/explainers/other/_maple.py +325 -0
  98. shap_gpu-0.0.1.dev0/shap/explainers/other/_random.py +90 -0
  99. shap_gpu-0.0.1.dev0/shap/explainers/other/_treegain.py +33 -0
  100. shap_gpu-0.0.1.dev0/shap/explainers/other/_ubjson.py +207 -0
  101. shap_gpu-0.0.1.dev0/shap/explainers/pytree.py +530 -0
  102. shap_gpu-0.0.1.dev0/shap/explainers/tf_utils.py +109 -0
  103. shap_gpu-0.0.1.dev0/shap/links.py +35 -0
  104. shap_gpu-0.0.1.dev0/shap/maskers/__init__.py +21 -0
  105. shap_gpu-0.0.1.dev0/shap/maskers/_composite.py +150 -0
  106. shap_gpu-0.0.1.dev0/shap/maskers/_fixed.py +34 -0
  107. shap_gpu-0.0.1.dev0/shap/maskers/_fixed_composite.py +69 -0
  108. shap_gpu-0.0.1.dev0/shap/maskers/_image.py +240 -0
  109. shap_gpu-0.0.1.dev0/shap/maskers/_masker.py +35 -0
  110. shap_gpu-0.0.1.dev0/shap/maskers/_output_composite.py +76 -0
  111. shap_gpu-0.0.1.dev0/shap/maskers/_tabular.py +356 -0
  112. shap_gpu-0.0.1.dev0/shap/maskers/_text.py +547 -0
  113. shap_gpu-0.0.1.dev0/shap/models/__init__.py +13 -0
  114. shap_gpu-0.0.1.dev0/shap/models/_model.py +53 -0
  115. shap_gpu-0.0.1.dev0/shap/models/_teacher_forcing.py +442 -0
  116. shap_gpu-0.0.1.dev0/shap/models/_text_generation.py +247 -0
  117. shap_gpu-0.0.1.dev0/shap/models/_topk_lm.py +277 -0
  118. shap_gpu-0.0.1.dev0/shap/models/_transformers_pipeline.py +41 -0
  119. shap_gpu-0.0.1.dev0/shap/plots/__init__.py +42 -0
  120. shap_gpu-0.0.1.dev0/shap/plots/_bar.py +462 -0
  121. shap_gpu-0.0.1.dev0/shap/plots/_beeswarm.py +1152 -0
  122. shap_gpu-0.0.1.dev0/shap/plots/_benchmark.py +234 -0
  123. shap_gpu-0.0.1.dev0/shap/plots/_decision.py +626 -0
  124. shap_gpu-0.0.1.dev0/shap/plots/_embedding.py +69 -0
  125. shap_gpu-0.0.1.dev0/shap/plots/_force.py +585 -0
  126. shap_gpu-0.0.1.dev0/shap/plots/_force_matplotlib.py +420 -0
  127. shap_gpu-0.0.1.dev0/shap/plots/_group_difference.py +92 -0
  128. shap_gpu-0.0.1.dev0/shap/plots/_heatmap.py +206 -0
  129. shap_gpu-0.0.1.dev0/shap/plots/_image.py +597 -0
  130. shap_gpu-0.0.1.dev0/shap/plots/_labels.py +15 -0
  131. shap_gpu-0.0.1.dev0/shap/plots/_monitoring.py +81 -0
  132. shap_gpu-0.0.1.dev0/shap/plots/_partial_dependence.py +256 -0
  133. shap_gpu-0.0.1.dev0/shap/plots/_scatter.py +859 -0
  134. shap_gpu-0.0.1.dev0/shap/plots/_style.py +133 -0
  135. shap_gpu-0.0.1.dev0/shap/plots/_text.py +1473 -0
  136. shap_gpu-0.0.1.dev0/shap/plots/_utils.py +275 -0
  137. shap_gpu-0.0.1.dev0/shap/plots/_violin.py +420 -0
  138. shap_gpu-0.0.1.dev0/shap/plots/_waterfall.py +737 -0
  139. shap_gpu-0.0.1.dev0/shap/plots/colors/__init__.py +33 -0
  140. shap_gpu-0.0.1.dev0/shap/plots/colors/_colorconv.py +222 -0
  141. shap_gpu-0.0.1.dev0/shap/plots/colors/_colors.py +130 -0
  142. shap_gpu-0.0.1.dev0/shap/plots/resources/bundle.js +2 -0
  143. shap_gpu-0.0.1.dev0/shap/plots/resources/logoSmallGray.png +0 -0
  144. shap_gpu-0.0.1.dev0/shap/utils/__init__.py +46 -0
  145. shap_gpu-0.0.1.dev0/shap/utils/_clustering.py +313 -0
  146. shap_gpu-0.0.1.dev0/shap/utils/_exceptions.py +44 -0
  147. shap_gpu-0.0.1.dev0/shap/utils/_general.py +364 -0
  148. shap_gpu-0.0.1.dev0/shap/utils/_legacy.py +277 -0
  149. shap_gpu-0.0.1.dev0/shap/utils/_masked_model.py +473 -0
  150. shap_gpu-0.0.1.dev0/shap/utils/_show_progress.py +55 -0
  151. shap_gpu-0.0.1.dev0/shap/utils/_types.py +10 -0
  152. shap_gpu-0.0.1.dev0/shap/utils/_warnings.py +4 -0
  153. shap_gpu-0.0.1.dev0/shap/utils/image.py +145 -0
  154. shap_gpu-0.0.1.dev0/shap/utils/transformers.py +94 -0
  155. shap_gpu-0.0.1.dev0/tests/README.md +15 -0
  156. shap_gpu-0.0.1.dev0/tests/actions/test_action.py +60 -0
  157. shap_gpu-0.0.1.dev0/tests/actions/test_optimizer.py +95 -0
  158. shap_gpu-0.0.1.dev0/tests/benchmark/framework.py +55 -0
  159. shap_gpu-0.0.1.dev0/tests/benchmark/perturbation.py +56 -0
  160. shap_gpu-0.0.1.dev0/tests/benchmark/test_imports.py +4 -0
  161. shap_gpu-0.0.1.dev0/tests/conftest.py +114 -0
  162. shap_gpu-0.0.1.dev0/tests/datasets_to_cache.py +84 -0
  163. shap_gpu-0.0.1.dev0/tests/explainers/__init__.py +1 -0
  164. shap_gpu-0.0.1.dev0/tests/explainers/common.py +118 -0
  165. shap_gpu-0.0.1.dev0/tests/explainers/conftest.py +60 -0
  166. shap_gpu-0.0.1.dev0/tests/explainers/other/test_maple.py +17 -0
  167. shap_gpu-0.0.1.dev0/tests/explainers/other/test_treegain.py +45 -0
  168. shap_gpu-0.0.1.dev0/tests/explainers/other/test_ubjson.py +91 -0
  169. shap_gpu-0.0.1.dev0/tests/explainers/test_coalition.py +89 -0
  170. shap_gpu-0.0.1.dev0/tests/explainers/test_deep.py +756 -0
  171. shap_gpu-0.0.1.dev0/tests/explainers/test_exact.py +182 -0
  172. shap_gpu-0.0.1.dev0/tests/explainers/test_explainer.py +97 -0
  173. shap_gpu-0.0.1.dev0/tests/explainers/test_gpu_tree.py +385 -0
  174. shap_gpu-0.0.1.dev0/tests/explainers/test_gradient.py +472 -0
  175. shap_gpu-0.0.1.dev0/tests/explainers/test_kernel.py +397 -0
  176. shap_gpu-0.0.1.dev0/tests/explainers/test_linear.py +293 -0
  177. shap_gpu-0.0.1.dev0/tests/explainers/test_partition.py +67 -0
  178. shap_gpu-0.0.1.dev0/tests/explainers/test_permutation.py +104 -0
  179. shap_gpu-0.0.1.dev0/tests/explainers/test_sampling.py +54 -0
  180. shap_gpu-0.0.1.dev0/tests/explainers/test_tree.py +3017 -0
  181. shap_gpu-0.0.1.dev0/tests/gpu_tree_tests.ipynb +252 -0
  182. shap_gpu-0.0.1.dev0/tests/maskers/__init__.py +0 -0
  183. shap_gpu-0.0.1.dev0/tests/maskers/test_composite.py +239 -0
  184. shap_gpu-0.0.1.dev0/tests/maskers/test_custom.py +21 -0
  185. shap_gpu-0.0.1.dev0/tests/maskers/test_fixed.py +74 -0
  186. shap_gpu-0.0.1.dev0/tests/maskers/test_fixed_composite.py +57 -0
  187. shap_gpu-0.0.1.dev0/tests/maskers/test_image.py +183 -0
  188. shap_gpu-0.0.1.dev0/tests/maskers/test_masker.py +66 -0
  189. shap_gpu-0.0.1.dev0/tests/maskers/test_masker_with_explainers.py +207 -0
  190. shap_gpu-0.0.1.dev0/tests/maskers/test_output_composite.py +225 -0
  191. shap_gpu-0.0.1.dev0/tests/maskers/test_tabular.py +256 -0
  192. shap_gpu-0.0.1.dev0/tests/maskers/test_text.py +269 -0
  193. shap_gpu-0.0.1.dev0/tests/models/test_teacher_forcing_logits.py +90 -0
  194. shap_gpu-0.0.1.dev0/tests/models/test_text_generation.py +41 -0
  195. shap_gpu-0.0.1.dev0/tests/plots/__init__.py +12 -0
  196. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_bar.png +0 -0
  197. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_bar_local_feature_importance.png +0 -0
  198. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_bar_with_clustering.png +0 -0
  199. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_bar_with_cohorts_dict.png +0 -0
  200. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_beeswarm.png +0 -0
  201. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_beeswarm_no_group_remaining.png +0 -0
  202. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_blue.png +0 -0
  203. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_blue_circle.png +0 -0
  204. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_blue_no_bounds.png +0 -0
  205. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_blue_transparent.png +0 -0
  206. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_transparent_blue.png +0 -0
  207. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_red_white_blue.png +0 -0
  208. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_transparent_blue.png +0 -0
  209. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_colormaps_transparent_red.png +0 -0
  210. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_decision_multioutput.png +0 -0
  211. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_decision_plot.png +0 -0
  212. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_decision_plot_interactions.png +0 -0
  213. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_decision_plot_single_instance.png +0 -0
  214. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_force_array_js.png +0 -0
  215. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_force_js.png +0 -0
  216. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_force_plot_negative_sign.png +0 -0
  217. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_force_plot_positive_sign.png +0 -0
  218. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_group_difference.png +0 -0
  219. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_heatmap.png +0 -0
  220. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_heatmap_feature_order.png +0 -0
  221. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_image_multi.png +0 -0
  222. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_image_multi_labels_per_row_list.png +0 -0
  223. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_image_multi_labels_per_row_ndarray.png +0 -0
  224. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_image_multi_no_labels.png +0 -0
  225. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_image_single.png +0 -0
  226. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_categorical.png +0 -0
  227. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_custom.png +0 -0
  228. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_dotchain.png +0 -0
  229. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_interaction.png +0 -0
  230. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_multiple_cols_overlay.png +0 -0
  231. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_plot_value_input_input0.png +0 -0
  232. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_plot_value_input_input1.png +0 -0
  233. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_plot_value_input_input2.png +0 -0
  234. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_scatter_single.png +0 -0
  235. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary.png +0 -0
  236. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_bar_multiclass.png +0 -0
  237. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_bar_with_data.png +0 -0
  238. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_compact_dot_with_data.png +0 -0
  239. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_dot_with_data.png +0 -0
  240. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_layered_violin_with_data.png +0 -0
  241. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_multi_class.png +0 -0
  242. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_multi_class_legend.png +0 -0
  243. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_multi_class_legend_decimals.png +0 -0
  244. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_multiclass_explanation.png +0 -0
  245. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_plot.png +0 -0
  246. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_plot_interaction.png +0 -0
  247. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_plot_twice.png +0 -0
  248. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_violin_regression.png +0 -0
  249. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_violin_with_data.png +0 -0
  250. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_with_data.png +0 -0
  251. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_summary_with_log_scale.png +0 -0
  252. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_violin.png +0 -0
  253. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_waterfall.png +0 -0
  254. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_waterfall_bounds.png +0 -0
  255. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_waterfall_custom_style.png +0 -0
  256. shap_gpu-0.0.1.dev0/tests/plots/baseline/test_waterfall_legacy.png +0 -0
  257. shap_gpu-0.0.1.dev0/tests/plots/conftest.py +31 -0
  258. shap_gpu-0.0.1.dev0/tests/plots/test_bar.py +112 -0
  259. shap_gpu-0.0.1.dev0/tests/plots/test_beeswarm.py +121 -0
  260. shap_gpu-0.0.1.dev0/tests/plots/test_colors.py +38 -0
  261. shap_gpu-0.0.1.dev0/tests/plots/test_decision.py +444 -0
  262. shap_gpu-0.0.1.dev0/tests/plots/test_dependence.py +43 -0
  263. shap_gpu-0.0.1.dev0/tests/plots/test_dependence_string_features.py +74 -0
  264. shap_gpu-0.0.1.dev0/tests/plots/test_force.py +152 -0
  265. shap_gpu-0.0.1.dev0/tests/plots/test_force_js.py +192 -0
  266. shap_gpu-0.0.1.dev0/tests/plots/test_group_difference.py +19 -0
  267. shap_gpu-0.0.1.dev0/tests/plots/test_heatmap.py +49 -0
  268. shap_gpu-0.0.1.dev0/tests/plots/test_image.py +127 -0
  269. shap_gpu-0.0.1.dev0/tests/plots/test_scatter.py +114 -0
  270. shap_gpu-0.0.1.dev0/tests/plots/test_style.py +69 -0
  271. shap_gpu-0.0.1.dev0/tests/plots/test_summary.py +312 -0
  272. shap_gpu-0.0.1.dev0/tests/plots/test_text.py +53 -0
  273. shap_gpu-0.0.1.dev0/tests/plots/test_utils.py +24 -0
  274. shap_gpu-0.0.1.dev0/tests/plots/test_violin.py +103 -0
  275. shap_gpu-0.0.1.dev0/tests/plots/test_waterfall.py +120 -0
  276. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_coalition_test_tabular_coalition_multiple_output_baseline.npz +0 -0
  277. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_coalition_test_tabular_coalition_single_output_baseline.npz +0 -0
  278. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_interactions_baseline.npz +0 -0
  279. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_serialization_baseline.npz +0 -0
  280. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_serialization_custom_model_save_baseline.npz +0 -0
  281. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_serialization_no_model_or_masker_baseline.npz +0 -0
  282. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_serialization_no_model_or_masker_reduced_baseline.npz +0 -0
  283. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_multi_output_auto_masker_baseline.npz +0 -0
  284. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_multi_output_independent_masker_baseline.npz +0 -0
  285. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_multi_output_partition_masker_baseline.npz +0 -0
  286. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_single_output_auto_masker_baseline.npz +0 -0
  287. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_single_output_auto_masker_minimal_baseline.npz +0 -0
  288. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_single_output_auto_masker_single_value_baseline.npz +0 -0
  289. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_single_output_independent_masker_baseline.npz +0 -0
  290. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_exact_test_tabular_single_output_partition_masker_baseline.npz +0 -0
  291. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_kernel_test_serialization_baseline.npz +0 -0
  292. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_serialization_baseline.npz +0 -0
  293. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_serialization_custom_model_save_baseline.npz +0 -0
  294. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_serialization_no_model_or_masker_baseline.npz +0 -0
  295. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_tabular_multi_output_baseline.npz +0 -0
  296. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_tabular_single_output_baseline.npz +0 -0
  297. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_translation_algorithm_arg_baseline.npz +0 -0
  298. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_translation_auto_baseline.npz +0 -0
  299. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_partition_test_translation_baseline.npz +0 -0
  300. shap_gpu-0.0.1.dev0/tests/shap_values_baselines/test_permutation_test_tabular_single_output_auto_masker_baseline.npz +0 -0
  301. shap_gpu-0.0.1.dev0/tests/test_datasets.py +148 -0
  302. shap_gpu-0.0.1.dev0/tests/test_explanation.py +247 -0
  303. shap_gpu-0.0.1.dev0/tests/test_install.py +16 -0
  304. shap_gpu-0.0.1.dev0/tests/utils/test_clustering.py +42 -0
  305. shap_gpu-0.0.1.dev0/tests/utils/test_general.py +124 -0
  306. shap_gpu-0.0.1.dev0/tests/utils/test_masked_model.py +18 -0
@@ -0,0 +1,13 @@
1
+ # This file helps clean up the git "blame" view, by ignoring repo-wide style & refactoring commits.
2
+ # Sorted imports with isort
3
+ 6be5b996cc7f048bf04875a8dc7775b2233dbeb4
4
+ # Removed trailing whitespace
5
+ b2a60a31edcc22ed41778cbe3ef93a499d76277f
6
+ # Fixed end-of-file line endings
7
+ 9438e81732d04f9e9c56d98074e6b35615e21a9a
8
+ # Renormalised file endings
9
+ edb34644a218127437f9e6bb1588bc3246a2c222
10
+ # Bulk update of docstrings with pydocstyle
11
+ 56394f1c208e384ad3302d596e90f6818943c840
12
+ # Applied ruff formatter
13
+ fc8a60f9b0854279014ff668db3d84a1d11bbc7e
@@ -0,0 +1,5 @@
1
+ # Ensure consistent treatment of line endings
2
+ * text=auto
3
+
4
+ # Do not raise merge conflicts for multiple changelog edits
5
+ CHANGELOG.md merge=union
@@ -0,0 +1,75 @@
1
+ name: Bug Report
2
+ description: Report incorrect behavior in the shap library
3
+ title: "BUG: "
4
+ labels: ["bug"]
5
+
6
+ body:
7
+ - type: markdown
8
+ attributes:
9
+ value: Thanks for taking the time to fill out this bug report!
10
+ - type: textarea
11
+ id: problem
12
+ attributes:
13
+ label: Issue Description
14
+ description: Please describe the issue.
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: example
19
+ attributes:
20
+ label: Minimal Reproducible Example
21
+ description: |
22
+ Please provide a minimal, self-contained example that reproduces the issue.
23
+ placeholder: |
24
+ import shap
25
+
26
+ ...
27
+ render: python
28
+ validations:
29
+ required: true
30
+ - type: markdown
31
+ attributes:
32
+ value: |
33
+ **Note**: without a working Minimal Reproducible Example, the maintainers will not be able to help you and your issue will be closed!
34
+
35
+ Your example should be:
36
+
37
+ 1. **Minimal**: Use as little code as possible that still produces the same problem.
38
+ 2. **Self-contained**: Provide all minimal imports, data and code needed to reproduce the problem.
39
+ 3. **Verifiable**: Test the example to make sure it reproduces the problem.
40
+
41
+ See [Matt's guide](https://matthewrocklin.com/minimal-bug-reports) for further information on how to write helpful bug reports.
42
+ - type: textarea
43
+ id: traceback
44
+ attributes:
45
+ label: Traceback
46
+ description: Copy & paste the traceback of the error (if relevant).
47
+ placeholder: |
48
+ Traceback (most recent call last):
49
+ File "/shap/__init__.py", line 4, in <module>
50
+ import foo
51
+ NameError: name 'foo' is not defined
52
+ render: shell
53
+ - type: textarea
54
+ id: expected-behavior
55
+ attributes:
56
+ label: Expected Behavior
57
+ description: Please describe or show a code example of the expected behavior.
58
+ - type: checkboxes
59
+ id: checks
60
+ attributes:
61
+ label: Bug report checklist
62
+ options:
63
+ - label: I have checked that this issue has not already been reported.
64
+ required: true
65
+ - label: I have confirmed this bug exists on the [latest release](https://github.com/shap/shap/releases) of shap.
66
+ required: true
67
+ - label: I have confirmed this bug exists on the [master branch](https://github.com/shap/shap/blob/master/CONTRIBUTING.md#installing-from-the-master-branch) of shap.
68
+ - label: I'd be interested in making a PR to fix this bug
69
+ - type: textarea
70
+ id: version
71
+ attributes:
72
+ label: Installed Versions
73
+ description: What version of the shap library are you using?
74
+ validations:
75
+ required: true
@@ -0,0 +1,8 @@
1
+ # For reference, see
2
+ # https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/
3
+
4
+ blank_issues_enabled: true # In future, may disable to force use of standardised issue forms
5
+ contact_links:
6
+ - name: Discussions and Q&A
7
+ url: https://github.com/shap/shap/discussions
8
+ about: Ask general questions about shap and get help from other users
@@ -0,0 +1,40 @@
1
+ name: Feature Request
2
+ description: Suggest an idea for shap
3
+ title: "ENH: "
4
+ labels: [enhancement]
5
+
6
+ body:
7
+ - type: markdown
8
+ attributes:
9
+ value: Thanks for taking the time to fill out this feature request form!
10
+ - type: textarea
11
+ id: description
12
+ attributes:
13
+ label: Problem Description
14
+ description: >
15
+ Please describe what problem the feature would solve (e.g. "I wish I could
16
+ use shap to ..."), and how the new feature would be used. Use pseudo-code if relevant.
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: alternative
21
+ attributes:
22
+ label: Alternative Solutions
23
+ description: >
24
+ Please describe any alternative solutions (existing functionality, workarounds,
25
+ 3rd party packages, etc.) that would satisfy the feature request.
26
+ - type: textarea
27
+ id: context
28
+ attributes:
29
+ label: Additional Context
30
+ description: >
31
+ Please provide any relevant GitHub issues, code examples or references
32
+ that help describe and support the feature request.
33
+ - type: checkboxes
34
+ id: checks
35
+ attributes:
36
+ label: Feature request checklist
37
+ options:
38
+ - label: I have checked the issue tracker for duplicate issues.
39
+ required: true
40
+ - label: I'd be interested in making a PR to implement this feature
@@ -0,0 +1,12 @@
1
+ ## Overview
2
+
3
+ Closes #XXXX <!--Add issue number here, or delete as appropriate-->
4
+
5
+ Description of the changes proposed in this pull request:
6
+
7
+
8
+
9
+ ## Checklist
10
+
11
+ - [ ] All [pre-commit checks](https://pre-commit.com/#install) pass.
12
+ - [ ] Unit tests added (if fixing a bug or adding a new feature)
@@ -0,0 +1,13 @@
1
+ codecov:
2
+ notify:
3
+ after_n_builds: 7
4
+ wait_for_ci: yes
5
+ coverage:
6
+ range: 70..90
7
+ comment:
8
+ require_changes: true
9
+ after_n_builds: 7
10
+ ignore:
11
+ # Ignore coverage on vendored code
12
+ - "shap/plots/colors/_colorconv.py"
13
+ - "shap/explainers/other/_maple.py"
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/javascript/"
5
+ schedule:
6
+ interval: "monthly"
7
+ groups:
8
+ # Group all minor and patch updates in a single PR
9
+ js-minor:
10
+ update-types:
11
+ - "minor"
12
+ - "patch"
@@ -0,0 +1,26 @@
1
+ changelog:
2
+ exclude:
3
+ labels:
4
+ - skip-changelog
5
+ authors:
6
+ - dependabot
7
+ - pre-commit-ci
8
+ categories:
9
+ - title: Breaking changes
10
+ labels:
11
+ - BREAKING
12
+ - title: Added
13
+ labels:
14
+ - enhancement
15
+ - title: Fixed
16
+ labels:
17
+ - bug
18
+ - title: Documentation
19
+ labels:
20
+ - documentation
21
+ - title: Maintenance
22
+ labels:
23
+ - ci
24
+ - title: Other Changes
25
+ labels:
26
+ - "*"
@@ -0,0 +1,27 @@
1
+ # Dummy release workflow to reserve the "shap-gpu" name on PyPI.
2
+ # Builds an sdist (no CUDA/C compilation) with the name overridden to
3
+ # "shap-gpu" and a placeholder version, then publishes via trusted publishing.
4
+ name: release
5
+ on:
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ environment: pypi
12
+ permissions:
13
+ id-token: write # for PyPI trusted publishing
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0 # setuptools_scm needs full history/tags
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v7
20
+ - name: Override package name to shap-gpu
21
+ run: sed -i 's/^name = "shap"/name = "shap-gpu"/' pyproject.toml
22
+ - name: Build sdist
23
+ env:
24
+ SETUPTOOLS_SCM_PRETEND_VERSION: "0.0.1.dev0"
25
+ run: uv build --sdist
26
+ - name: Publish to PyPI
27
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,188 @@
1
+ name: Build wheels
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ # Enable manual run
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ # we need this test since we run into 403 errors on MacOS, see GH #4179
12
+ prepare_data:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 10
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python 3.12
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v7
23
+ - name: Install dependencies for dataset download
24
+ run: |
25
+ uv pip install --system '.[download_datasets]'
26
+ - name: Pre-download datasets
27
+ run: python tests/datasets_to_cache.py
28
+ - name: Create unified cache directory
29
+ run: |
30
+ mkdir -p /tmp/test_data_cache
31
+ cp -r ~/scikit_learn_data /tmp/test_data_cache/ || true
32
+ cp -r shap/cached_data /tmp/test_data_cache/ || true
33
+ ls -la /tmp/test_data_cache/
34
+ - name: Upload cached datasets
35
+ uses: actions/upload-artifact@v4
36
+ with:
37
+ name: test-data-cache
38
+ path: /tmp/test_data_cache
39
+ retention-days: 1
40
+
41
+ build_wheels:
42
+ name: Build ${{ matrix.os }} wheels
43
+ needs: [prepare_data]
44
+ strategy:
45
+ fail-fast: false
46
+ matrix:
47
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-14, macos-15-intel, windows-latest]
48
+
49
+ runs-on: ${{ matrix.os }}
50
+ steps:
51
+ # Ensure all git tags are present so version number is extracted.
52
+ # https://github.com/actions/checkout/issues/1471
53
+ # Careful: the "fetch-tags" option to the checkout action is broken
54
+ # when the workflow is triggered by a tag!
55
+ # https://github.com/actions/checkout/issues/1467
56
+ - name: Check out the repo
57
+ uses: actions/checkout@v4
58
+ with:
59
+ fetch-depth: 0
60
+ - name: Fetch all tags
61
+ run: git fetch --tags
62
+
63
+ - name: Download pre-cached datasets
64
+ uses: actions/download-artifact@v4
65
+ with:
66
+ name: test-data-cache
67
+ path: ${{ runner.temp }}/test_data_cache
68
+
69
+ - name: Install libomp (macOS)
70
+ if: runner.os == 'macOS'
71
+ run: |
72
+ brew install libomp
73
+ # Set DYLD_LIBRARY_PATH to avoid OpenMP conflicts, see https://github.com/unit8co/darts/pull/3050
74
+ _libomp_path=$(brew --prefix libomp 2>/dev/null)/lib
75
+ echo "DYLD_LIBRARY_PATH=$_libomp_path:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
76
+ unset _libomp_path
77
+
78
+ - name: "Install uv"
79
+ uses: astral-sh/setup-uv@v7
80
+
81
+ - name: Build wheels
82
+ uses: pypa/cibuildwheel@v3.2.1
83
+ env:
84
+ CIBW_ARCHS_LINUX: ${{ contains(matrix.os, '-arm') && 'aarch64' || 'x86_64' }}
85
+ CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-14' && 'arm64' || 'x86_64' }}
86
+ CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
87
+ CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2
88
+ # Pass the cache location to cibuildwheel tests
89
+ CIBW_BEFORE_TEST: |
90
+ python -c "import os, shutil; cache_path = os.environ.get('CACHE_PATH', '${{ runner.temp }}/test_data_cache'); home = os.path.expanduser('~'); sklearn_cache = os.path.join(home, 'scikit_learn_data'); os.makedirs(sklearn_cache, exist_ok=True); shutil.copytree(os.path.join(cache_path, 'scikit_learn_data'), sklearn_cache, dirs_exist_ok=True) if os.path.exists(os.path.join(cache_path, 'scikit_learn_data')) else None"
91
+ CIBW_TEST_COMMAND_MACOS: |
92
+ python -c "import shap, os, shutil; cache_path = '${{ runner.temp }}/test_data_cache'; shap_cache = os.path.join(os.path.dirname(shap.__file__), 'cached_data'); os.makedirs(shap_cache, exist_ok=True); shutil.copytree(os.path.join(cache_path, 'cached_data'), shap_cache, dirs_exist_ok=True) if os.path.exists(os.path.join(cache_path, 'cached_data')) else None" && pytest -v {project}/tests --import-mode=append
93
+ CIBW_TEST_COMMAND_LINUX: |
94
+ python -c "import shap, os, shutil; cache_path = '${{ runner.temp }}/test_data_cache'; shap_cache = os.path.join(os.path.dirname(shap.__file__), 'cached_data'); os.makedirs(shap_cache, exist_ok=True); shutil.copytree(os.path.join(cache_path, 'cached_data'), shap_cache, dirs_exist_ok=True) if os.path.exists(os.path.join(cache_path, 'cached_data')) else None" && pytest -v {project}/tests --import-mode=append
95
+ CIBW_TEST_COMMAND_WINDOWS: |
96
+ python -c "import shap, os, shutil; cache_path = r'${{ runner.temp }}\test_data_cache'; shap_cache = os.path.join(os.path.dirname(shap.__file__), 'cached_data'); os.makedirs(shap_cache, exist_ok=True); shutil.copytree(os.path.join(cache_path, 'cached_data'), shap_cache, dirs_exist_ok=True) if os.path.exists(os.path.join(cache_path, 'cached_data')) else None" && pytest -v {project}/tests --import-mode=append
97
+
98
+ - uses: actions/upload-artifact@v4
99
+ with:
100
+ path: ./wheelhouse/*.whl
101
+ name: bdist_files_${{ matrix.os }}
102
+
103
+ build_sdist:
104
+ name: Build source distribution
105
+ runs-on: ubuntu-latest
106
+ steps:
107
+ # Ensure all git tags are present so version number is extracted.
108
+ # https://github.com/actions/checkout/issues/1471
109
+ # Careful: the "fetch-tags" option to the checkout action is broken
110
+ # when the workflow is triggered by a tag!
111
+ # https://github.com/actions/checkout/issues/1467
112
+ - name: Check out the repo
113
+ uses: actions/checkout@v4
114
+ with:
115
+ fetch-depth: 0
116
+ - name: Fetch all tags
117
+ run: git fetch --tags
118
+
119
+ - name: Set up Python 3.12
120
+ uses: actions/setup-python@v5
121
+ with:
122
+ python-version: '3.12'
123
+
124
+ - name: Install uv
125
+ uses: astral-sh/setup-uv@v7
126
+
127
+ - name: Build sdist (pep517)
128
+ run: |
129
+ uv build --sdist
130
+
131
+ - name: Upload sdist
132
+ uses: actions/upload-artifact@v4
133
+ with:
134
+ name: sdist_files
135
+ path: dist/*.tar.gz
136
+
137
+ publish_test_pypi:
138
+ name: Publish wheels to TestPyPI
139
+ needs: [build_wheels, build_sdist]
140
+ runs-on: ubuntu-latest
141
+ environment:
142
+ name: testpypi
143
+ url: https://test.pypi.org/p/shap
144
+ permissions:
145
+ id-token: write
146
+ steps:
147
+ - uses: actions/download-artifact@v4
148
+ with:
149
+ path: dist
150
+ pattern: bdist_files_*
151
+ merge-multiple: true
152
+
153
+ - uses: actions/download-artifact@v4
154
+ with:
155
+ name: sdist_files
156
+ path: dist
157
+
158
+ - name: Publish package to TestPyPI
159
+ uses: pypa/gh-action-pypi-publish@release/v1
160
+ with:
161
+ verbose: true
162
+ repository-url: https://test.pypi.org/legacy/
163
+
164
+ publish_pypi:
165
+ name: Publish wheels to PyPI
166
+ needs: [build_wheels, build_sdist]
167
+ runs-on: ubuntu-latest
168
+ # Only publish tagged releases to PyPI
169
+ if: startsWith(github.ref, 'refs/tags')
170
+ environment:
171
+ name: pypi
172
+ url: https://pypi.org/p/shap
173
+ permissions:
174
+ id-token: write
175
+ steps:
176
+ - uses: actions/download-artifact@v4
177
+ with:
178
+ path: dist
179
+ pattern: bdist_files_*
180
+ merge-multiple: true
181
+
182
+ - uses: actions/download-artifact@v4
183
+ with:
184
+ name: sdist_files
185
+ path: dist
186
+
187
+ - name: Publish package to PyPI
188
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,86 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+
8
+ name: "CodeQL"
9
+
10
+ on:
11
+ push:
12
+ branches: [ "master" ]
13
+ pull_request:
14
+ # The branches below must be a subset of the branches above
15
+ branches: [ "master" ]
16
+ paths:
17
+ - "shap/**"
18
+ - "javascript/**"
19
+ - "tests/**"
20
+ - "data/**"
21
+ - ".github/workflows/codeql-analysis.yml"
22
+ - "**.py"
23
+ - "**.js"
24
+ - "**.cc"
25
+ - "**.cu"
26
+ - "**.h"
27
+ schedule:
28
+ - cron: '16 9 * * 1'
29
+
30
+ jobs:
31
+ analyze:
32
+ name: Analyze
33
+ runs-on: ubuntu-latest
34
+ permissions:
35
+ actions: read
36
+ contents: read
37
+ security-events: write
38
+
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ language: [ 'cpp', 'javascript', 'python' ]
43
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
44
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
45
+
46
+ steps:
47
+ - name: Checkout repository
48
+ uses: actions/checkout@v4
49
+
50
+ # Initializes the CodeQL tools for scanning.
51
+ - name: Initialize CodeQL
52
+ uses: github/codeql-action/init@v3
53
+ with:
54
+ languages: ${{ matrix.language }}
55
+ # If you wish to specify custom queries, you can do so here or in a config file.
56
+ # By default, queries listed here will override any specified in a config file.
57
+ # Prefix the list here with "+" to use these queries and those in the config file.
58
+
59
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
60
+ # queries: security-extended,security-and-quality
61
+
62
+
63
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
64
+ # If this step fails, then you should remove it and run the build manually (see below)
65
+ # - name: Autobuild
66
+ # uses: github/codeql-action/autobuild@v2
67
+
68
+ - name: Build python package
69
+ run: |
70
+ pip install build
71
+ python -m build
72
+
73
+ # ℹ️ Command-line programs to run using the OS shell.
74
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
75
+
76
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
77
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
78
+
79
+ # - run: |
80
+ # echo "Run, Build Application using script"
81
+ # ./location_of_script_within_repo/buildscript.sh
82
+
83
+ - name: Perform CodeQL Analysis
84
+ uses: github/codeql-action/analyze@v3
85
+ with:
86
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,41 @@
1
+ name: notebooks
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ paths:
11
+ - "shap/**"
12
+ - "notebooks/**"
13
+ - ".github/workflows/run_notebooks.yml"
14
+ - "scripts/**"
15
+ - "pyproject.toml"
16
+ - "CMakeLists.txt"
17
+ workflow_dispatch:
18
+
19
+ concurrency:
20
+ group: ${{ github.workflow }}-${{ github.ref }}
21
+ # Cancel only PR intermediate builds
22
+ cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
23
+
24
+ jobs:
25
+ run_notebooks:
26
+ runs-on: "ubuntu-latest"
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - name: Set up Python 3.12
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: '3.12'
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v7
35
+ - name: Install dependencies
36
+ run: |
37
+ python -m pip install --upgrade uv
38
+ uv pip install --system '.[test,plots,test_notebooks,nbtest]'
39
+ - name: Run notebooks
40
+ run: |
41
+ python scripts/run_notebooks_timeouts.py