andrey-core 0.1.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 (107) hide show
  1. andrey_core-0.1.0/.gitignore +60 -0
  2. andrey_core-0.1.0/LICENSE +202 -0
  3. andrey_core-0.1.0/PKG-INFO +224 -0
  4. andrey_core-0.1.0/README.md +180 -0
  5. andrey_core-0.1.0/pyproject.toml +137 -0
  6. andrey_core-0.1.0/src/andrey/__init__.py +81 -0
  7. andrey_core-0.1.0/src/andrey/api/__init__.py +49 -0
  8. andrey_core-0.1.0/src/andrey/api/_adapt.py +123 -0
  9. andrey_core-0.1.0/src/andrey/api/_experimental.py +16 -0
  10. andrey_core-0.1.0/src/andrey/api/_irregular.py +180 -0
  11. andrey_core-0.1.0/src/andrey/api/_marks.py +99 -0
  12. andrey_core-0.1.0/src/andrey/api/_temporal.py +133 -0
  13. andrey_core-0.1.0/src/andrey/api/constraint.py +439 -0
  14. andrey_core-0.1.0/src/andrey/api/irregular.py +115 -0
  15. andrey_core-0.1.0/src/andrey/api/latent.py +99 -0
  16. andrey_core-0.1.0/src/andrey/api/lingam.py +315 -0
  17. andrey_core-0.1.0/src/andrey/api/permutation.py +252 -0
  18. andrey_core-0.1.0/src/andrey/api/score.py +416 -0
  19. andrey_core-0.1.0/src/andrey/api/temporal.py +186 -0
  20. andrey_core-0.1.0/src/andrey/cli.py +1372 -0
  21. andrey_core-0.1.0/src/andrey/constraint/__init__.py +7 -0
  22. andrey_core-0.1.0/src/andrey/constraint/_parallel_skeleton.py +128 -0
  23. andrey_core-0.1.0/src/andrey/constraint/_skeleton.py +200 -0
  24. andrey_core-0.1.0/src/andrey/constraint/cdnod.py +85 -0
  25. andrey_core-0.1.0/src/andrey/constraint/fci.py +1009 -0
  26. andrey_core-0.1.0/src/andrey/constraint/pc.py +239 -0
  27. andrey_core-0.1.0/src/andrey/core/__init__.py +47 -0
  28. andrey_core-0.1.0/src/andrey/core/_bitset.py +194 -0
  29. andrey_core-0.1.0/src/andrey/core/backend.py +651 -0
  30. andrey_core-0.1.0/src/andrey/core/ci.py +281 -0
  31. andrey_core-0.1.0/src/andrey/core/env.py +127 -0
  32. andrey_core-0.1.0/src/andrey/core/independence.py +271 -0
  33. andrey_core-0.1.0/src/andrey/core/orient.py +439 -0
  34. andrey_core-0.1.0/src/andrey/core/output.py +601 -0
  35. andrey_core-0.1.0/src/andrey/core/score.py +229 -0
  36. andrey_core-0.1.0/src/andrey/core/score_delta.py +801 -0
  37. andrey_core-0.1.0/src/andrey/core/seeding.py +69 -0
  38. andrey_core-0.1.0/src/andrey/core/stats.py +487 -0
  39. andrey_core-0.1.0/src/andrey/core/structure.py +1477 -0
  40. andrey_core-0.1.0/src/andrey/core/warning_policy.py +81 -0
  41. andrey_core-0.1.0/src/andrey/data/__init__.py +48 -0
  42. andrey_core-0.1.0/src/andrey/data/benchmarks.py +101 -0
  43. andrey_core-0.1.0/src/andrey/data/dataset.py +125 -0
  44. andrey_core-0.1.0/src/andrey/data/functional.py +212 -0
  45. andrey_core-0.1.0/src/andrey/data/generate.py +81 -0
  46. andrey_core-0.1.0/src/andrey/data/graphs.py +451 -0
  47. andrey_core-0.1.0/src/andrey/data/latent.py +227 -0
  48. andrey_core-0.1.0/src/andrey/data/noise.py +119 -0
  49. andrey_core-0.1.0/src/andrey/data/qa.py +93 -0
  50. andrey_core-0.1.0/src/andrey/data/real.py +440 -0
  51. andrey_core-0.1.0/src/andrey/data/scm.py +345 -0
  52. andrey_core-0.1.0/src/andrey/data/sortability.py +154 -0
  53. andrey_core-0.1.0/src/andrey/data/storage.py +182 -0
  54. andrey_core-0.1.0/src/andrey/data/temporal.py +134 -0
  55. andrey_core-0.1.0/src/andrey/irregular/__init__.py +18 -0
  56. andrey_core-0.1.0/src/andrey/irregular/anm.py +57 -0
  57. andrey_core-0.1.0/src/andrey/irregular/bottom_up_parce.py +198 -0
  58. andrey_core-0.1.0/src/andrey/irregular/camuv.py +224 -0
  59. andrey_core-0.1.0/src/andrey/irregular/pnl.py +152 -0
  60. andrey_core-0.1.0/src/andrey/irregular/rcd.py +441 -0
  61. andrey_core-0.1.0/src/andrey/latent/__init__.py +7 -0
  62. andrey_core-0.1.0/src/andrey/latent/gin.py +229 -0
  63. andrey_core-0.1.0/src/andrey/lingam/__init__.py +9 -0
  64. andrey_core-0.1.0/src/andrey/lingam/adjacency.py +35 -0
  65. andrey_core-0.1.0/src/andrey/lingam/direct.py +26 -0
  66. andrey_core-0.1.0/src/andrey/lingam/ica.py +90 -0
  67. andrey_core-0.1.0/src/andrey/lingam/multi_group.py +79 -0
  68. andrey_core-0.1.0/src/andrey/lingam/pwling.py +111 -0
  69. andrey_core-0.1.0/src/andrey/lingam/var.py +59 -0
  70. andrey_core-0.1.0/src/andrey/metrics/__init__.py +54 -0
  71. andrey_core-0.1.0/src/andrey/metrics/_common.py +123 -0
  72. andrey_core-0.1.0/src/andrey/metrics/graph.py +224 -0
  73. andrey_core-0.1.0/src/andrey/metrics/latent.py +140 -0
  74. andrey_core-0.1.0/src/andrey/metrics/order.py +93 -0
  75. andrey_core-0.1.0/src/andrey/metrics/pairwise.py +52 -0
  76. andrey_core-0.1.0/src/andrey/metrics/resolve.py +159 -0
  77. andrey_core-0.1.0/src/andrey/metrics/temporal.py +139 -0
  78. andrey_core-0.1.0/src/andrey/metrics/weights.py +44 -0
  79. andrey_core-0.1.0/src/andrey/search/__init__.py +8 -0
  80. andrey_core-0.1.0/src/andrey/search/_parallel.py +259 -0
  81. andrey_core-0.1.0/src/andrey/search/_parallel_ges.py +493 -0
  82. andrey_core-0.1.0/src/andrey/search/_parallel_hc.py +176 -0
  83. andrey_core-0.1.0/src/andrey/search/boss.py +282 -0
  84. andrey_core-0.1.0/src/andrey/search/calibrate.py +227 -0
  85. andrey_core-0.1.0/src/andrey/search/calm.py +356 -0
  86. andrey_core-0.1.0/src/andrey/search/exact.py +253 -0
  87. andrey_core-0.1.0/src/andrey/search/ges.py +158 -0
  88. andrey_core-0.1.0/src/andrey/search/gfci.py +96 -0
  89. andrey_core-0.1.0/src/andrey/search/gies.py +42 -0
  90. andrey_core-0.1.0/src/andrey/search/grasp.py +432 -0
  91. andrey_core-0.1.0/src/andrey/search/hc.py +277 -0
  92. andrey_core-0.1.0/src/andrey/search/operators.py +285 -0
  93. andrey_core-0.1.0/src/andrey/spec/__init__.py +47 -0
  94. andrey_core-0.1.0/src/andrey/spec/environment.py +151 -0
  95. andrey_core-0.1.0/src/andrey/spec/generate.py +424 -0
  96. andrey_core-0.1.0/src/andrey/spec/models.py +114 -0
  97. andrey_core-0.1.0/src/andrey/spec/registry.py +659 -0
  98. andrey_core-0.1.0/src/andrey/temporal/__init__.py +16 -0
  99. andrey_core-0.1.0/src/andrey/temporal/granger.py +38 -0
  100. andrey_core-0.1.0/src/andrey/temporal/longitudinal.py +215 -0
  101. andrey_core-0.1.0/src/andrey/temporal/varma.py +202 -0
  102. andrey_core-0.1.0/src/andrey/viz/__init__.py +362 -0
  103. andrey_core-0.1.0/src/andrey/viz/_graphviz.py +111 -0
  104. andrey_core-0.1.0/src/andrey/viz/_layout.py +80 -0
  105. andrey_core-0.1.0/src/andrey/viz/_svg.py +299 -0
  106. andrey_core-0.1.0/src/andrey/viz/mpl.py +202 -0
  107. andrey_core-0.1.0/src/andrey/viz/theme.py +132 -0
@@ -0,0 +1,60 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.so
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+
7
+ *.egg-info/
8
+ build/
9
+ dist/
10
+
11
+ .venv*/
12
+ venv/
13
+ # The bench venv is built by benchmarks/start.sh, which pins competitor versions there.
14
+ # Its lockfile is an artifact of that build, and travels with a batch's results, not the repo.
15
+ benchmarks/uv.lock
16
+ # The R package library benchmarks/start_r.sh builds for the R lane, beside the venv.
17
+ benchmarks/.r-lib-bench/
18
+ env/
19
+
20
+ .vscode/
21
+ .idea/
22
+ *.swp
23
+ *.code-workspace
24
+ .DS_Store
25
+ Thumbs.db
26
+
27
+ .env
28
+ .envrc
29
+
30
+ *.log
31
+ *.out
32
+ tmp/
33
+ temp/
34
+ .cache/
35
+
36
+ # Local job scripts (e.g., SLURM submit scripts).
37
+ jobs/
38
+
39
+ outputs/
40
+
41
+ .claude/*
42
+ !.claude/CLAUDE.md
43
+ !.claude/commands
44
+ !.claude/skills
45
+
46
+
47
+ docs/PR/
48
+
49
+ # docs site: generated build artifacts (never committed, never shipped in the wheel)
50
+ docs/_build/
51
+ docs/_generated/
52
+ docs/docs/examples/*.ipynb
53
+ docs/docs/code/generated/
54
+ docs/_static/andrey-tokens.css
55
+ docs/_static/graph-comparison.html
56
+ docs/_static/graph-types-*.html
57
+
58
+ .ipynb_checkpoints/
59
+ apps/live-discovery/brand/
60
+ apps/live-discovery/data/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.5
2
+ Name: andrey-core
3
+ Version: 0.1.0
4
+ Summary: Andrey, a very fast causal discovery package
5
+ Project-URL: Homepage, https://andrey.abel.ai
6
+ Project-URL: Documentation, https://andrey.abel.ai/docs/
7
+ Project-URL: Source, https://github.com/Abel-ai-lab/andrey
8
+ Project-URL: Issues, https://github.com/Abel-ai-lab/andrey/issues
9
+ Project-URL: Changelog, https://andrey.abel.ai/docs/changelog.html
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Python: >=3.11
18
+ Requires-Dist: networkx>=3
19
+ Requires-Dist: numpy>=1.26
20
+ Requires-Dist: pandas>=2.2
21
+ Requires-Dist: pydantic>=2
22
+ Requires-Dist: pyyaml>=6
23
+ Requires-Dist: scikit-learn>=1.5
24
+ Requires-Dist: scipy>=1.13
25
+ Requires-Dist: statsmodels>=0.14
26
+ Requires-Dist: threadpoolctl>=3
27
+ Requires-Dist: typer>=0.12
28
+ Provides-Extra: all
29
+ Requires-Dist: matplotlib>=3.7; extra == 'all'
30
+ Requires-Dist: numba>=0.61; extra == 'all'
31
+ Requires-Dist: pygraphviz>=2; extra == 'all'
32
+ Requires-Dist: safetensors>=0.4; extra == 'all'
33
+ Requires-Dist: torch>=2.2; extra == 'all'
34
+ Provides-Extra: data
35
+ Requires-Dist: safetensors>=0.4; extra == 'data'
36
+ Provides-Extra: numba
37
+ Requires-Dist: numba>=0.61; extra == 'numba'
38
+ Provides-Extra: torch
39
+ Requires-Dist: torch>=2.2; extra == 'torch'
40
+ Provides-Extra: viz
41
+ Requires-Dist: matplotlib>=3.7; extra == 'viz'
42
+ Requires-Dist: pygraphviz>=2; extra == 'viz'
43
+ Description-Content-Type: text/markdown
44
+
45
+ <!-- One image on its own dark ground reads on both GitHub themes; PyPI keeps a plain <img>. -->
46
+ <p align="center">
47
+ <img alt="Andrey, a very fast causal discovery package"
48
+ src="https://raw.githubusercontent.com/Abel-ai-lab/andrey/v0.1.0/.github/readme/banner.svg" width="830">
49
+ </p>
50
+
51
+ <p align="center">
52
+ <a href="https://github.com/Abel-ai-lab/andrey/actions/workflows/ci.yml"><img alt="CI status"
53
+ src="https://img.shields.io/github/actions/workflow/status/Abel-ai-lab/andrey/ci.yml?branch=main&amp;label=CI"></a>
54
+ <img alt="Python 3.11, 3.12, 3.13, 3.14"
55
+ src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3b5bdb">
56
+ <a href="https://github.com/Abel-ai-lab/andrey/blob/main/LICENSE"><img alt="License: Apache 2.0"
57
+ src="https://img.shields.io/badge/license-Apache%202.0-3b5bdb"></a>
58
+ </p>
59
+
60
+ Andrey is a causal discovery package for Python.
61
+
62
+ <!-- PITCH:START -->
63
+ <!-- Generated by apps/build_launch.py; do not edit. -->
64
+
65
+ - **Fast**: Over 100x faster on PC, and faster on most other supported methods.
66
+ - **Just as accurate**: the same errors or fewer in 38 of 42 comparisons with other packages.
67
+ - **One API**: 18 methods, each one function call.
68
+ - **Agent-ready**: a command line that answers in JSON, and a skill for coding agents.
69
+
70
+ <!-- PITCH:END -->
71
+
72
+ ```shell
73
+ uv add andrey-core
74
+ ```
75
+
76
+ - **With pip**: `pip install andrey-core`
77
+ - **Optional extras**: `andrey-core[numba]` for compiled CPU code, `andrey-core[torch]` for GPUs
78
+ - **Development version**: `uv add git+https://github.com/Abel-ai-lab/andrey`
79
+ - **[Installation guide](https://andrey.abel.ai/docs/guides/getting-started.html#install)**: the
80
+ extras, a PyTorch build for your GPU, and building Andrey from source
81
+
82
+ <!-- CHART:START -->
83
+ <!-- Generated from summary.json by apps/build_launch.py; do not edit. -->
84
+
85
+ <p align="center">
86
+ <picture>
87
+ <source media="(prefers-color-scheme: dark)"
88
+ srcset="https://raw.githubusercontent.com/Abel-ai-lab/andrey/v0.1.0/.github/readme/benchmark-chart-dark.svg">
89
+ <img alt="Andrey's speedup over the slowest package on the same data: PC 941x at 400 variables,
90
+ FCI 8.7x at 800 variables, GES 4.3x at 150 variables, BOSS 3.4x at 800 variables, GRaSP
91
+ 1.4x at 400 variables, DirectLiNGAM 3.3x at 200 variables"
92
+ src="https://raw.githubusercontent.com/Abel-ai-lab/andrey/v0.1.0/.github/readme/benchmark-chart-light.svg" width="100%">
93
+ </picture>
94
+ </p>
95
+
96
+ <p align="center"><a href="https://andrey.abel.ai/docs/benchmarks.html">Benchmark report</a></p>
97
+
98
+ <!-- CHART:END -->
99
+
100
+ <!-- WHY_FAST:START -->
101
+ <!-- Generated from site/why_fast.py by apps/build_launch.py; do not edit. -->
102
+
103
+ Four ideas make it fast; each is animated in
104
+ [a blog post](https://andrey.abel.ai/blog/why-andrey-is-fast.html):
105
+
106
+ - **Do many things at once**: thousands of independence tests run as one array operation, with the
107
+ same results.
108
+ - **Never compute twice**: the correlation matrix is computed once and cached; GES memoizes its
109
+ local scores.
110
+ - **Skip what can't matter**: tests with a closed form settle most edges before any matrix is
111
+ inverted.
112
+ - **Use the hardware you have**: with the optional extras, Numba compiles GES's path checks and a
113
+ GPU computes large tables.
114
+
115
+ <!-- WHY_FAST:END -->
116
+
117
+ ## What's inside
118
+
119
+ <!-- METHODS:START -->
120
+ <!-- Generated from andrey.spec by apps/build_launch.py; do not edit. -->
121
+
122
+ | Family | Methods | Returns |
123
+ |---|---|---|
124
+ | Constraint-based | [`pc`](https://andrey.abel.ai/docs/code/generated/andrey.pc.html), [`fci`](https://andrey.abel.ai/docs/code/generated/andrey.fci.html), [`gfci`](https://andrey.abel.ai/docs/code/generated/andrey.gfci.html)\*, [`cdnod`](https://andrey.abel.ai/docs/code/generated/andrey.cdnod.html)\* | CPDAG, PAG |
125
+ | Score-based | [`ges`](https://andrey.abel.ai/docs/code/generated/andrey.ges.html), [`gies`](https://andrey.abel.ai/docs/code/generated/andrey.gies.html)\*, [`hc`](https://andrey.abel.ai/docs/code/generated/andrey.hc.html)\*, [`exact_search`](https://andrey.abel.ai/docs/code/generated/andrey.exact_search.html)\*, [`calm`](https://andrey.abel.ai/docs/code/generated/andrey.calm.html)\* | CPDAG, DAG |
126
+ | Permutation-based | [`boss`](https://andrey.abel.ai/docs/code/generated/andrey.boss.html), [`grasp`](https://andrey.abel.ai/docs/code/generated/andrey.grasp.html) | CPDAG |
127
+ | Linear non-Gaussian | [`direct_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.direct_lingam.html), [`ica_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.ica_lingam.html), [`multi_group_direct_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.multi_group_direct_lingam.html)\* | DAG |
128
+ | Time series | [`varma_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.varma_lingam.html)\*, [`longitudinal_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.longitudinal_lingam.html)\* | Temporal graph |
129
+ | Latent variables | [`gin`](https://andrey.abel.ai/docs/code/generated/andrey.gin.html)\* | DAG |
130
+ | Pairwise direction | [`pnl`](https://andrey.abel.ai/docs/code/generated/andrey.pnl.html)\* | Two-node DAG |
131
+
132
+ \* [Experimental](https://andrey.abel.ai/docs/code/index.html#experimental-methods):
133
+ no published benchmark yet, and the API may change.
134
+
135
+ <!-- METHODS:END -->
136
+
137
+ ## Quick start
138
+
139
+ <!-- QUICKSTART:START -->
140
+ <!-- Generated by apps/build_launch.py, which runs the code; do not edit. -->
141
+
142
+ Learn the protein-signalling network of Sachs et al. (2005) from 853 cells, and score it against
143
+ the known network:
144
+
145
+ ```python
146
+ import andrey
147
+ from andrey.data import load_dataset
148
+ from andrey.metrics import score
149
+
150
+ sachs = load_dataset("sachs") # 853 cells, 11 proteins, and the known network
151
+ out = andrey.pc(sachs.data) # learn a graph
152
+ print(out)
153
+
154
+ scores = score(out.structure, sachs.graph)
155
+ print({k: round(scores[k], 2) for k in ("shd", "skeleton_precision", "skeleton_recall")})
156
+ ```
157
+
158
+ ```text
159
+ PC cpdag | 11 nodes | 8 edges (6 undirected, 2 directed)
160
+
161
+ raf -- mek
162
+ plc -- pip3
163
+ pip2 -- pip3
164
+ erk -- akt
165
+ erk -- pka
166
+ akt -- pka
167
+ p38 -> pkc
168
+ jnk -> pkc
169
+ {'shd': 11, 'skeleton_precision': 1.0, 'skeleton_recall': 0.47}
170
+ ```
171
+
172
+ PC finds 8 edges, all among the known network's 17. The structural Hamming distance (SHD) counts
173
+ the edges to add, remove, or reorient to reach the known network: 11 here (9 edges are missing, and
174
+ 2 are oriented that the known network leaves undirected), and 17 for a graph with no edges.
175
+
176
+ <!-- QUICKSTART:END -->
177
+
178
+ For your own data, pass a pandas DataFrame or a NumPy array: one row per sample, one column per
179
+ variable. From a shell or an agent:
180
+
181
+ ```shell
182
+ andrey run pc --data your_data.csv # JSON when piped, a summary in a terminal
183
+ andrey --skill # a guide an agent loads as a skill
184
+ ```
185
+
186
+ ## Learn more
187
+
188
+ - [Documentation](https://andrey.abel.ai/docs/): guides and the API reference.
189
+ - [Examples](https://andrey.abel.ai/docs/examples/): notebooks, one method or task each.
190
+ - [Demos](https://andrey.abel.ai/docs/demos/): step through methods and explore results in your
191
+ browser.
192
+ - [Benchmarks](https://andrey.abel.ai/docs/benchmarks.html): every size, time, and error count.
193
+ - [Launch post](https://andrey.abel.ai/blog/introducing-andrey.html),
194
+ [FAQ](https://andrey.abel.ai/docs/faq.html), and
195
+ [changelog](https://andrey.abel.ai/docs/changelog.html).
196
+
197
+ Andrey is in alpha: the API may change between releases, so pin the version you use. Linux is fully
198
+ tested; macOS and Windows install and run on the CPU, but the full test suite and the GPU speedups
199
+ (CUDA / MPS) are not tested there yet.
200
+
201
+ ## Citing, license, contributing
202
+
203
+ If you use Andrey in your work, please cite it, or use the
204
+ [citation file](https://github.com/Abel-ai-lab/andrey/blob/main/CITATION.cff):
205
+
206
+ ```bibtex
207
+ @software{andrey,
208
+ author = {{Abel AI Lab}},
209
+ title = {Andrey: A very fast causal discovery package},
210
+ year = {2026},
211
+ version = {0.1.0},
212
+ url = {https://andrey.abel.ai},
213
+ }
214
+ ```
215
+
216
+ Andrey is released under the
217
+ [Apache License 2.0](https://github.com/Abel-ai-lab/andrey/blob/main/LICENSE). Bug reports and pull
218
+ requests are welcome in the [issue tracker](https://github.com/Abel-ai-lab/andrey/issues); the
219
+ [contributing guide](https://github.com/Abel-ai-lab/andrey/blob/main/CONTRIBUTING.md) explains how
220
+ to set up a development environment.
221
+
222
+ Andrey is inspired by
223
+ [causal-learn](https://github.com/py-why/causal-learn), [pgmpy](https://github.com/pgmpy/pgmpy),
224
+ [Tetrad](https://github.com/cmu-phil/tetrad), and many other causal discovery packages.
@@ -0,0 +1,180 @@
1
+ <!-- One image on its own dark ground reads on both GitHub themes; PyPI keeps a plain <img>. -->
2
+ <p align="center">
3
+ <img alt="Andrey, a very fast causal discovery package"
4
+ src=".github/readme/banner.svg" width="830">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/Abel-ai-lab/andrey/actions/workflows/ci.yml"><img alt="CI status"
9
+ src="https://img.shields.io/github/actions/workflow/status/Abel-ai-lab/andrey/ci.yml?branch=main&amp;label=CI"></a>
10
+ <img alt="Python 3.11, 3.12, 3.13, 3.14"
11
+ src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3b5bdb">
12
+ <a href="https://github.com/Abel-ai-lab/andrey/blob/main/LICENSE"><img alt="License: Apache 2.0"
13
+ src="https://img.shields.io/badge/license-Apache%202.0-3b5bdb"></a>
14
+ </p>
15
+
16
+ Andrey is a causal discovery package for Python.
17
+
18
+ <!-- PITCH:START -->
19
+ <!-- Generated by apps/build_launch.py; do not edit. -->
20
+
21
+ - **Fast**: Over 100x faster on PC, and faster on most other supported methods.
22
+ - **Just as accurate**: the same errors or fewer in 38 of 42 comparisons with other packages.
23
+ - **One API**: 18 methods, each one function call.
24
+ - **Agent-ready**: a command line that answers in JSON, and a skill for coding agents.
25
+
26
+ <!-- PITCH:END -->
27
+
28
+ ```shell
29
+ uv add andrey-core
30
+ ```
31
+
32
+ - **With pip**: `pip install andrey-core`
33
+ - **Optional extras**: `andrey-core[numba]` for compiled CPU code, `andrey-core[torch]` for GPUs
34
+ - **Development version**: `uv add git+https://github.com/Abel-ai-lab/andrey`
35
+ - **[Installation guide](https://andrey.abel.ai/docs/guides/getting-started.html#install)**: the
36
+ extras, a PyTorch build for your GPU, and building Andrey from source
37
+
38
+ <!-- CHART:START -->
39
+ <!-- Generated from summary.json by apps/build_launch.py; do not edit. -->
40
+
41
+ <p align="center">
42
+ <picture>
43
+ <source media="(prefers-color-scheme: dark)"
44
+ srcset=".github/readme/benchmark-chart-dark.svg">
45
+ <img alt="Andrey's speedup over the slowest package on the same data: PC 941x at 400 variables,
46
+ FCI 8.7x at 800 variables, GES 4.3x at 150 variables, BOSS 3.4x at 800 variables, GRaSP
47
+ 1.4x at 400 variables, DirectLiNGAM 3.3x at 200 variables"
48
+ src=".github/readme/benchmark-chart-light.svg" width="100%">
49
+ </picture>
50
+ </p>
51
+
52
+ <p align="center"><a href="https://andrey.abel.ai/docs/benchmarks.html">Benchmark report</a></p>
53
+
54
+ <!-- CHART:END -->
55
+
56
+ <!-- WHY_FAST:START -->
57
+ <!-- Generated from site/why_fast.py by apps/build_launch.py; do not edit. -->
58
+
59
+ Four ideas make it fast; each is animated in
60
+ [a blog post](https://andrey.abel.ai/blog/why-andrey-is-fast.html):
61
+
62
+ - **Do many things at once**: thousands of independence tests run as one array operation, with the
63
+ same results.
64
+ - **Never compute twice**: the correlation matrix is computed once and cached; GES memoizes its
65
+ local scores.
66
+ - **Skip what can't matter**: tests with a closed form settle most edges before any matrix is
67
+ inverted.
68
+ - **Use the hardware you have**: with the optional extras, Numba compiles GES's path checks and a
69
+ GPU computes large tables.
70
+
71
+ <!-- WHY_FAST:END -->
72
+
73
+ ## What's inside
74
+
75
+ <!-- METHODS:START -->
76
+ <!-- Generated from andrey.spec by apps/build_launch.py; do not edit. -->
77
+
78
+ | Family | Methods | Returns |
79
+ |---|---|---|
80
+ | Constraint-based | [`pc`](https://andrey.abel.ai/docs/code/generated/andrey.pc.html), [`fci`](https://andrey.abel.ai/docs/code/generated/andrey.fci.html), [`gfci`](https://andrey.abel.ai/docs/code/generated/andrey.gfci.html)\*, [`cdnod`](https://andrey.abel.ai/docs/code/generated/andrey.cdnod.html)\* | CPDAG, PAG |
81
+ | Score-based | [`ges`](https://andrey.abel.ai/docs/code/generated/andrey.ges.html), [`gies`](https://andrey.abel.ai/docs/code/generated/andrey.gies.html)\*, [`hc`](https://andrey.abel.ai/docs/code/generated/andrey.hc.html)\*, [`exact_search`](https://andrey.abel.ai/docs/code/generated/andrey.exact_search.html)\*, [`calm`](https://andrey.abel.ai/docs/code/generated/andrey.calm.html)\* | CPDAG, DAG |
82
+ | Permutation-based | [`boss`](https://andrey.abel.ai/docs/code/generated/andrey.boss.html), [`grasp`](https://andrey.abel.ai/docs/code/generated/andrey.grasp.html) | CPDAG |
83
+ | Linear non-Gaussian | [`direct_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.direct_lingam.html), [`ica_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.ica_lingam.html), [`multi_group_direct_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.multi_group_direct_lingam.html)\* | DAG |
84
+ | Time series | [`varma_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.varma_lingam.html)\*, [`longitudinal_lingam`](https://andrey.abel.ai/docs/code/generated/andrey.longitudinal_lingam.html)\* | Temporal graph |
85
+ | Latent variables | [`gin`](https://andrey.abel.ai/docs/code/generated/andrey.gin.html)\* | DAG |
86
+ | Pairwise direction | [`pnl`](https://andrey.abel.ai/docs/code/generated/andrey.pnl.html)\* | Two-node DAG |
87
+
88
+ \* [Experimental](https://andrey.abel.ai/docs/code/index.html#experimental-methods):
89
+ no published benchmark yet, and the API may change.
90
+
91
+ <!-- METHODS:END -->
92
+
93
+ ## Quick start
94
+
95
+ <!-- QUICKSTART:START -->
96
+ <!-- Generated by apps/build_launch.py, which runs the code; do not edit. -->
97
+
98
+ Learn the protein-signalling network of Sachs et al. (2005) from 853 cells, and score it against
99
+ the known network:
100
+
101
+ ```python
102
+ import andrey
103
+ from andrey.data import load_dataset
104
+ from andrey.metrics import score
105
+
106
+ sachs = load_dataset("sachs") # 853 cells, 11 proteins, and the known network
107
+ out = andrey.pc(sachs.data) # learn a graph
108
+ print(out)
109
+
110
+ scores = score(out.structure, sachs.graph)
111
+ print({k: round(scores[k], 2) for k in ("shd", "skeleton_precision", "skeleton_recall")})
112
+ ```
113
+
114
+ ```text
115
+ PC cpdag | 11 nodes | 8 edges (6 undirected, 2 directed)
116
+
117
+ raf -- mek
118
+ plc -- pip3
119
+ pip2 -- pip3
120
+ erk -- akt
121
+ erk -- pka
122
+ akt -- pka
123
+ p38 -> pkc
124
+ jnk -> pkc
125
+ {'shd': 11, 'skeleton_precision': 1.0, 'skeleton_recall': 0.47}
126
+ ```
127
+
128
+ PC finds 8 edges, all among the known network's 17. The structural Hamming distance (SHD) counts
129
+ the edges to add, remove, or reorient to reach the known network: 11 here (9 edges are missing, and
130
+ 2 are oriented that the known network leaves undirected), and 17 for a graph with no edges.
131
+
132
+ <!-- QUICKSTART:END -->
133
+
134
+ For your own data, pass a pandas DataFrame or a NumPy array: one row per sample, one column per
135
+ variable. From a shell or an agent:
136
+
137
+ ```shell
138
+ andrey run pc --data your_data.csv # JSON when piped, a summary in a terminal
139
+ andrey --skill # a guide an agent loads as a skill
140
+ ```
141
+
142
+ ## Learn more
143
+
144
+ - [Documentation](https://andrey.abel.ai/docs/): guides and the API reference.
145
+ - [Examples](https://andrey.abel.ai/docs/examples/): notebooks, one method or task each.
146
+ - [Demos](https://andrey.abel.ai/docs/demos/): step through methods and explore results in your
147
+ browser.
148
+ - [Benchmarks](https://andrey.abel.ai/docs/benchmarks.html): every size, time, and error count.
149
+ - [Launch post](https://andrey.abel.ai/blog/introducing-andrey.html),
150
+ [FAQ](https://andrey.abel.ai/docs/faq.html), and
151
+ [changelog](https://andrey.abel.ai/docs/changelog.html).
152
+
153
+ Andrey is in alpha: the API may change between releases, so pin the version you use. Linux is fully
154
+ tested; macOS and Windows install and run on the CPU, but the full test suite and the GPU speedups
155
+ (CUDA / MPS) are not tested there yet.
156
+
157
+ ## Citing, license, contributing
158
+
159
+ If you use Andrey in your work, please cite it, or use the
160
+ [citation file](https://github.com/Abel-ai-lab/andrey/blob/main/CITATION.cff):
161
+
162
+ ```bibtex
163
+ @software{andrey,
164
+ author = {{Abel AI Lab}},
165
+ title = {Andrey: A very fast causal discovery package},
166
+ year = {2026},
167
+ version = {0.1.0},
168
+ url = {https://andrey.abel.ai},
169
+ }
170
+ ```
171
+
172
+ Andrey is released under the
173
+ [Apache License 2.0](https://github.com/Abel-ai-lab/andrey/blob/main/LICENSE). Bug reports and pull
174
+ requests are welcome in the [issue tracker](https://github.com/Abel-ai-lab/andrey/issues); the
175
+ [contributing guide](https://github.com/Abel-ai-lab/andrey/blob/main/CONTRIBUTING.md) explains how
176
+ to set up a development environment.
177
+
178
+ Andrey is inspired by
179
+ [causal-learn](https://github.com/py-why/causal-learn), [pgmpy](https://github.com/pgmpy/pgmpy),
180
+ [Tetrad](https://github.com/cmu-phil/tetrad), and many other causal discovery packages.