buhito 0.0.1a1__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 (33) hide show
  1. buhito-0.0.1a1/.github/workflows/deploy.yml +60 -0
  2. buhito-0.0.1a1/.gitignore +11 -0
  3. buhito-0.0.1a1/AUTHORS.md +4 -0
  4. buhito-0.0.1a1/LICENSE.txt +24 -0
  5. buhito-0.0.1a1/PKG-INFO +152 -0
  6. buhito-0.0.1a1/README.md +107 -0
  7. buhito-0.0.1a1/assets/buhito_icon.svg +1281 -0
  8. buhito-0.0.1a1/combined_graphlets_peterson_graph.png +0 -0
  9. buhito-0.0.1a1/examples/plotting_example.py +98 -0
  10. buhito-0.0.1a1/examples/qm9/benchmark_graphlet_featurizers_train_test.py +662 -0
  11. buhito-0.0.1a1/examples/qm9/qm9data/qm9_processed.csv +130832 -0
  12. buhito-0.0.1a1/pyproject.toml +73 -0
  13. buhito-0.0.1a1/setup.cfg +4 -0
  14. buhito-0.0.1a1/setup.py +3 -0
  15. buhito-0.0.1a1/src/buhito/__init__.py +5 -0
  16. buhito-0.0.1a1/src/buhito/breadth_graphlet.py +213 -0
  17. buhito-0.0.1a1/src/buhito/converters.py +43 -0
  18. buhito-0.0.1a1/src/buhito/depth_graphlet.py +149 -0
  19. buhito-0.0.1a1/src/buhito/featurizers/bfs_graphlet_featurizer.py +287 -0
  20. buhito-0.0.1a1/src/buhito/featurizers/dfs_graphlet_featurizer.py +210 -0
  21. buhito-0.0.1a1/src/buhito/plotting.py +96 -0
  22. buhito-0.0.1a1/src/buhito/transformers.py +306 -0
  23. buhito-0.0.1a1/src/buhito/utilities.py +23 -0
  24. buhito-0.0.1a1/src/buhito.egg-info/PKG-INFO +152 -0
  25. buhito-0.0.1a1/src/buhito.egg-info/SOURCES.txt +31 -0
  26. buhito-0.0.1a1/src/buhito.egg-info/dependency_links.txt +1 -0
  27. buhito-0.0.1a1/src/buhito.egg-info/requires.txt +24 -0
  28. buhito-0.0.1a1/src/buhito.egg-info/scm_file_list.json +28 -0
  29. buhito-0.0.1a1/src/buhito.egg-info/scm_version.json +8 -0
  30. buhito-0.0.1a1/src/buhito.egg-info/top_level.txt +1 -0
  31. buhito-0.0.1a1/tests/test_basic.py +5 -0
  32. buhito-0.0.1a1/tests/test_buhito.py +123 -0
  33. buhito-0.0.1a1/uv.lock +1160 -0
@@ -0,0 +1,60 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v[0-9]+.[0-9]+.[0-9]+'
7
+ - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
8
+ - 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
9
+ - 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ name: Build distribution
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - name: Check out repository
21
+ uses: actions/checkout@v6
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.11"
27
+
28
+ - name: Install build tools
29
+ run: python -m pip install --upgrade build
30
+
31
+ - name: Build package
32
+ run: python -m build
33
+
34
+ - name: Upload distributions
35
+ uses: actions/upload-artifact@v4
36
+ with:
37
+ name: python-package-distributions
38
+ path: dist/
39
+
40
+ publish:
41
+ name: Publish to PyPI
42
+ needs: build
43
+ runs-on: ubuntu-latest
44
+
45
+ environment:
46
+ name: pypi
47
+ url: https://pypi.org/p/buhito
48
+
49
+ permissions:
50
+ id-token: write
51
+
52
+ steps:
53
+ - name: Download distributions
54
+ uses: actions/download-artifact@v5
55
+ with:
56
+ name: python-package-distributions
57
+ path: dist/
58
+
59
+ - name: Publish to PyPI
60
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+
2
+ *.DS_Store
3
+ *.pyc
4
+ build/*
5
+ **/buhito.egg-info/
6
+ **/.vscode/
7
+ **/*.pkl
8
+ **/data/*
9
+ **/*.ipynb_checkpoints/*
10
+ **/__pycache__/*
11
+ dist
@@ -0,0 +1,4 @@
1
+ - Yulia Pimonova (LANL)
2
+ - Nicholas Lubbers (LANL)
3
+ - Nathan Lemons (LANL)
4
+ - Pieter Swart (LANL)
@@ -0,0 +1,24 @@
1
+ This program is open source under the BSD-3 License.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and
5
+ the following disclaimer.
6
+
7
+ 2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions
8
+ and the following disclaimer in the documentation and/or other materials provided with the
9
+ distribution.
10
+
11
+ 3.Neither the name of the copyright holder nor the names of its contributors may be used to endorse
12
+ or promote products derived from this software without specific prior written permission.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
15
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21
+ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23
+ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: buhito
3
+ Version: 0.0.1a1
4
+ Summary: buhito is a Python library for graph analysis and machine learning
5
+ Author-email: Buhito Developers <un_graphlets@lanl.gov>
6
+ License: BSD 3-Clause License
7
+ Project-URL: Homepage, https://github.com/lanl/buhito
8
+ Project-URL: Bug Tracker, https://github.com/lanl/buhito/issues
9
+ Project-URL: Source Code, https://github.com/lanl/buhito
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: BSD License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: <3.12,>=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.txt
22
+ License-File: AUTHORS.md
23
+ Requires-Dist: numpy<2.0,>=1.21.0
24
+ Requires-Dist: networkx<3.0,>=2.8.0
25
+ Requires-Dist: pandas<2.0,>=1.5.0
26
+ Requires-Dist: scikit-learn<2.0,>=1.2.0
27
+ Requires-Dist: scipy<2.0,>=1.9.0
28
+ Requires-Dist: numba<1.0,>=0.56.0
29
+ Requires-Dist: joblib<2.0,>=1.2.0
30
+ Requires-Dist: tqdm<5.0,>=4.64.0
31
+ Requires-Dist: rdkit<2026.0,>=2022.9.0
32
+ Requires-Dist: matplotlib<4.0,>=3.6.0
33
+ Requires-Dist: pillow<10.0,>=9.0.0
34
+ Requires-Dist: pydot<5.0,>=4.0.1
35
+ Provides-Extra: docs
36
+ Requires-Dist: sphinx>=8.0; extra == "docs"
37
+ Requires-Dist: sphinx_rtd_theme>=3.0.0rc1; extra == "docs"
38
+ Requires-Dist: sphinxcontrib-bibtex>=2.6; extra == "docs"
39
+ Provides-Extra: test
40
+ Requires-Dist: pytest<10.0,>=8.3; extra == "test"
41
+ Provides-Extra: full
42
+ Requires-Dist: graphviz; extra == "full"
43
+ Requires-Dist: triton; extra == "full"
44
+ Dynamic: license-file
45
+
46
+ # buhito
47
+ <img src="https://raw.githubusercontent.com/lanl/buhito/main/assets/buhito_icon.svg" alt="Logo" width="500">
48
+
49
+ **buhito** is a Python library for enumerating graphlets and analyzing graphlet-based features from graphs.
50
+
51
+ ## Installation
52
+ ```bash
53
+ git clone https://github.com/lanl/buhito.git
54
+ cd buhito
55
+ uv sync --all-extras
56
+ ```
57
+
58
+ ## Quick Start
59
+
60
+ ### Enumerate graphlets with BFS
61
+
62
+ ```python
63
+ import networkx as nx
64
+ from buhito import generate_subgraphs_breadthwise
65
+
66
+ G = nx.petersen_graph()
67
+
68
+ nx.set_node_attributes(G, {n: "C" for n in G.nodes}, "atom_key")
69
+ nx.set_edge_attributes(G, {e: "1" for e in G.edges}, "bond_key")
70
+
71
+ fp, bitinfo = generate_subgraphs_breadthwise(
72
+ G,
73
+ depth=4,
74
+ return_nodewise=False,
75
+ full_hash=True,
76
+ node_key="atom_key",
77
+ edge_key="bond_key"
78
+ )
79
+
80
+ print("Graphlet fingerprint length:", len(fp))
81
+ ```
82
+
83
+ ### Enumerate graphlets with DFS
84
+
85
+ ```python
86
+ from buhito import generate_subgraphs_depthwise
87
+
88
+ subsets, counts = generate_subgraphs_depthwise(G, maxlen=4)
89
+ print("Found graphlet subsets:", len(subsets))
90
+ ```
91
+
92
+ ## Examples
93
+
94
+ Available example scripts:
95
+
96
+ - `examples/plotting_example.py` — visualize graphlets from the Petersen graph
97
+ - `examples/qm9/benchmark_graphlet_featurizers_train_test.py` — benchmark featurizers on QM9 chemical properties data
98
+
99
+ ## Run Examples
100
+ ### QM9
101
+ ```sh
102
+ python examples/qm9/benchmark_graphlet_featurizers_train_test.py \
103
+ --data examples/qm9/qm9data/qm9_processed.csv \
104
+ --max-len 2 3 4 5 6 \
105
+ --repeats 3 \
106
+ --n-jobs -1 \
107
+ --outdir bench_qm9
108
+ ```
109
+
110
+ ## Testing
111
+
112
+ ```bash
113
+ pytest tests/
114
+ ```
115
+
116
+ ## Package structure
117
+
118
+ - `src/buhito/` — core features
119
+ - `src/buhito/converters.py` — converters to NetworkX graphs
120
+ - `src/buhito/plotting.py` — graphlet visualization helpers
121
+
122
+ ## Authors
123
+
124
+ - Yulia Pimonova (LANL)
125
+ - Nicholas Lubbers (LANL)
126
+ - Nathan Lemons (LANL)
127
+ - Pieter Swart (LANL)
128
+
129
+ ## Citation
130
+
131
+ If you use `buhito` in your work, please cite this repository. A publication citation is coming.
132
+
133
+ ## Copyright and licensing
134
+
135
+ `buhito` is released under the BSD-3 License. See `LICENSE.txt` for the full license.
136
+
137
+
138
+ The copyright to `buhito` is owned by Triad National Security, LLC
139
+ and is released for open source use as project number O5043.
140
+
141
+
142
+ © 2026. Triad National Security, LLC. All rights reserved.
143
+ This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos
144
+ National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S.
145
+ Department of Energy/National Nuclear Security Administration. All rights in the program are.
146
+ reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear
147
+ Security Administration. The Government is granted for itself and others acting on its behalf a
148
+ nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare.
149
+ derivative works, distribute copies to the public, perform publicly and display publicly, and to permit.
150
+ others to do so.
151
+
152
+
@@ -0,0 +1,107 @@
1
+ # buhito
2
+ <img src="https://raw.githubusercontent.com/lanl/buhito/main/assets/buhito_icon.svg" alt="Logo" width="500">
3
+
4
+ **buhito** is a Python library for enumerating graphlets and analyzing graphlet-based features from graphs.
5
+
6
+ ## Installation
7
+ ```bash
8
+ git clone https://github.com/lanl/buhito.git
9
+ cd buhito
10
+ uv sync --all-extras
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ### Enumerate graphlets with BFS
16
+
17
+ ```python
18
+ import networkx as nx
19
+ from buhito import generate_subgraphs_breadthwise
20
+
21
+ G = nx.petersen_graph()
22
+
23
+ nx.set_node_attributes(G, {n: "C" for n in G.nodes}, "atom_key")
24
+ nx.set_edge_attributes(G, {e: "1" for e in G.edges}, "bond_key")
25
+
26
+ fp, bitinfo = generate_subgraphs_breadthwise(
27
+ G,
28
+ depth=4,
29
+ return_nodewise=False,
30
+ full_hash=True,
31
+ node_key="atom_key",
32
+ edge_key="bond_key"
33
+ )
34
+
35
+ print("Graphlet fingerprint length:", len(fp))
36
+ ```
37
+
38
+ ### Enumerate graphlets with DFS
39
+
40
+ ```python
41
+ from buhito import generate_subgraphs_depthwise
42
+
43
+ subsets, counts = generate_subgraphs_depthwise(G, maxlen=4)
44
+ print("Found graphlet subsets:", len(subsets))
45
+ ```
46
+
47
+ ## Examples
48
+
49
+ Available example scripts:
50
+
51
+ - `examples/plotting_example.py` — visualize graphlets from the Petersen graph
52
+ - `examples/qm9/benchmark_graphlet_featurizers_train_test.py` — benchmark featurizers on QM9 chemical properties data
53
+
54
+ ## Run Examples
55
+ ### QM9
56
+ ```sh
57
+ python examples/qm9/benchmark_graphlet_featurizers_train_test.py \
58
+ --data examples/qm9/qm9data/qm9_processed.csv \
59
+ --max-len 2 3 4 5 6 \
60
+ --repeats 3 \
61
+ --n-jobs -1 \
62
+ --outdir bench_qm9
63
+ ```
64
+
65
+ ## Testing
66
+
67
+ ```bash
68
+ pytest tests/
69
+ ```
70
+
71
+ ## Package structure
72
+
73
+ - `src/buhito/` — core features
74
+ - `src/buhito/converters.py` — converters to NetworkX graphs
75
+ - `src/buhito/plotting.py` — graphlet visualization helpers
76
+
77
+ ## Authors
78
+
79
+ - Yulia Pimonova (LANL)
80
+ - Nicholas Lubbers (LANL)
81
+ - Nathan Lemons (LANL)
82
+ - Pieter Swart (LANL)
83
+
84
+ ## Citation
85
+
86
+ If you use `buhito` in your work, please cite this repository. A publication citation is coming.
87
+
88
+ ## Copyright and licensing
89
+
90
+ `buhito` is released under the BSD-3 License. See `LICENSE.txt` for the full license.
91
+
92
+
93
+ The copyright to `buhito` is owned by Triad National Security, LLC
94
+ and is released for open source use as project number O5043.
95
+
96
+
97
+ © 2026. Triad National Security, LLC. All rights reserved.
98
+ This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos
99
+ National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S.
100
+ Department of Energy/National Nuclear Security Administration. All rights in the program are.
101
+ reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear
102
+ Security Administration. The Government is granted for itself and others acting on its behalf a
103
+ nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare.
104
+ derivative works, distribute copies to the public, perform publicly and display publicly, and to permit.
105
+ others to do so.
106
+
107
+