tree-praxis 0.0.13__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Zakk Heile
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ recursive-include src/praxis/cpp *.cpp *.hpp *.h
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: tree-praxis
3
+ Version: 0.0.13
4
+ Summary: Rashomon set tools via PRAXIS, including approximation, exact calculation, and variable importance utilities.
5
+ Author: Zakk Heile, Hayden McTavish, Varun Babbar, Margo Seltzer, Cynthia Rudin
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/zakk-h/LicketyRESPLIT
8
+ Project-URL: Repository, https://github.com/zakk-h/LicketyRESPLIT
9
+ Project-URL: Issues, https://github.com/zakk-h/LicketyRESPLIT/issues
10
+ Keywords: interpretable machine learning,decision trees,rashomon set,optimization,variable importance
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: C++
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: numpy>=1.23
24
+ Requires-Dist: matplotlib>=3.6
25
+ Requires-Dist: scikit-learn>=1.1
26
+ Requires-Dist: pandas>=1.5
27
+ Dynamic: license-file
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64", "wheel", "pybind11>=2.13", "numpy>=1.23"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tree-praxis"
7
+ version = "0.0.13"
8
+ description = "Rashomon set tools via PRAXIS, including approximation, exact calculation, and variable importance utilities."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ { name = "Zakk Heile" },
14
+ { name = "Hayden McTavish" },
15
+ { name = "Varun Babbar" },
16
+ { name = "Margo Seltzer" },
17
+ { name = "Cynthia Rudin" }
18
+ ]
19
+ dependencies = [
20
+ "numpy>=1.23",
21
+ "matplotlib>=3.6",
22
+ "scikit-learn>=1.1",
23
+ "pandas>=1.5"
24
+ ]
25
+ keywords = [
26
+ "interpretable machine learning",
27
+ "decision trees",
28
+ "rashomon set",
29
+ "optimization",
30
+ "variable importance"
31
+ ]
32
+ classifiers = [
33
+ "Development Status :: 3 - Alpha",
34
+ "Intended Audience :: Science/Research",
35
+ "Programming Language :: Python :: 3",
36
+ "Programming Language :: Python :: 3.9",
37
+ "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.11",
39
+ "Programming Language :: Python :: 3.12",
40
+ "Programming Language :: C++",
41
+ "Topic :: Scientific/Engineering :: Artificial Intelligence"
42
+ ]
43
+
44
+ [project.urls]
45
+ Homepage = "https://github.com/zakk-h/LicketyRESPLIT"
46
+ Repository = "https://github.com/zakk-h/LicketyRESPLIT"
47
+ Issues = "https://github.com/zakk-h/LicketyRESPLIT/issues"
48
+
49
+ [tool.setuptools.packages.find]
50
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,103 @@
1
+ import os
2
+ import platform
3
+ from setuptools import setup, Extension
4
+ from setuptools.command.build_ext import build_ext
5
+ import pybind11
6
+
7
+
8
+ def is_truthy_env(name: str) -> bool:
9
+ return os.environ.get(name, "").lower() in ("1", "true", "yes", "on")
10
+
11
+
12
+ class BuildExt(build_ext):
13
+ c_opts = {
14
+ "msvc": [
15
+ "/O2",
16
+ "/std:c++17",
17
+ ],
18
+ "unix": [
19
+ "-O3",
20
+ "-DNDEBUG",
21
+ "-funroll-loops",
22
+ ],
23
+ }
24
+
25
+ l_opts = {
26
+ "msvc": [],
27
+ "unix": [],
28
+ }
29
+
30
+ def build_extensions(self):
31
+ ct = self.compiler.compiler_type
32
+ system = platform.system().lower() # "linux", "darwin", "windows"
33
+ machine = platform.machine().lower() # "x86_64", "amd64", "arm64", "aarch64"
34
+
35
+ opts = self.c_opts.get(ct, []).copy()
36
+ link_opts = self.l_opts.get(ct, []).copy()
37
+
38
+ if ct == "unix":
39
+ opts += ["-std=c++17", "-fPIC"]
40
+
41
+ if system != "darwin":
42
+ opts += ["-flto"]
43
+ link_opts += ["-flto", "-lm"]
44
+
45
+ # hardware popcount support.
46
+ if machine in ("x86_64", "amd64"):
47
+ # enables x86 POPCNT instruction.
48
+ opts += ["-mpopcnt"]
49
+ print("** Building PRAXIS with x86 POPCNT support")
50
+
51
+ elif machine in ("arm64", "aarch64"):
52
+ # Apple Silicon / ARM64 has popcount through ARM/NEON codegen.
53
+ print("** Building PRAXIS on ARM64; skipping x86 -mpopcnt")
54
+
55
+ else:
56
+ print(f"** Building PRAXIS on unknown Unix arch {machine}; skipping popcount-specific flags")
57
+
58
+ elif ct == "msvc":
59
+ # Windows x64
60
+ print("** Building PRAXIS with MSVC safe flags")
61
+
62
+ aggressive = is_truthy_env("AGGRESSIVE")
63
+
64
+ if aggressive and ct == "unix":
65
+ if machine in ("x86_64", "amd64"):
66
+ opts += [
67
+ "-mbmi",
68
+ "-mbmi2",
69
+ "-mavx2",
70
+ ]
71
+ print("** Building PRAXIS with additional aggressive x86 flags")
72
+ elif machine in ("arm64", "aarch64"):
73
+ # potential speedup for local builds
74
+ # opts += ["-mcpu=native"]
75
+ print("** AGGRESSIVE requested on ARM64; no extra portable flags added")
76
+ elif aggressive and ct != "unix":
77
+ print("** AGGRESSIVE requested on non-Unix compiler; using safe flags")
78
+
79
+ for ext in self.extensions:
80
+ ext.extra_compile_args = opts
81
+ ext.extra_link_args = link_opts
82
+
83
+ build_ext.build_extensions(self)
84
+
85
+
86
+ ext_modules = [
87
+ Extension(
88
+ "praxis._core",
89
+ sources=[
90
+ "src/praxis/_core.cpp",
91
+ ],
92
+ include_dirs=[
93
+ pybind11.get_include(),
94
+ "src/praxis/cpp",
95
+ ],
96
+ language="c++",
97
+ ),
98
+ ]
99
+
100
+ setup(
101
+ ext_modules=ext_modules,
102
+ cmdclass={"build_ext": BuildExt},
103
+ )