Skip to content

Commit 01e380a

Browse files
authored
Merge pull request #76 from BaseModelAI/introduce-typed-bindings
Add types to python bindings.
2 parents 3276934 + cbf8b79 commit 01e380a

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.idea
55
cleora-light-rust.iml
66
*.out
7+
*.so

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pycleora"
3-
version = "2.0.0"
3+
version = "2.1.0"
44
edition = "2018"
55
license-file = "LICENSE"
66
readme = "README.md"

pycleora/py.typed

Whitespace-only changes.

pycleora/pycleora.pyi

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from typing import Any, Iterable, Optional, Self
2+
3+
import numpy as np
4+
from numpy.typing import NDArray
5+
6+
7+
class SparseMatrix:
8+
def __new__(cls, *args: Any) -> Self:
9+
pass
10+
11+
@classmethod
12+
def from_iterator(
13+
cls, hyperedges: Iterable[str], columns: str, hyperedge_trim_n: int = 16, num_workers: Optional[int] = None
14+
) -> Self:
15+
pass
16+
17+
@classmethod
18+
def from_files(
19+
cls, filepaths: list[str], columns: str, hyperedge_trim_n: int = 16, num_workers: Optional[int] = None
20+
) -> Self:
21+
pass
22+
23+
def left_markov_propagate(self, x: NDArray[np.float32], num_workers: Optional[int] = None) -> NDArray[np.float32]:
24+
pass
25+
26+
def symmetric_markov_propagate(
27+
self, x: NDArray[np.float32], num_workers: Optional[int] = None
28+
) -> NDArray[np.float32]:
29+
pass
30+
31+
def get_entity_column_mask(self, column_name: str) -> NDArray[np.bool]:
32+
pass
33+
34+
def entity_degrees(self) -> NDArray[np.float32]:
35+
pass
36+
37+
def initialize_deterministically(self, feature_dim: int, seed: int = 0) -> NDArray[np.float32]:
38+
pass

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ classifiers = [
1010
"Programming Language :: Python :: Implementation :: CPython",
1111
"Programming Language :: Python :: Implementation :: PyPy",
1212
]
13-
version = "2.0.0"
13+
version = "2.1.0"
1414
description = "Sparse hypergraph structure and markov-propagation for node embeddings embeddings exposed via Python bindings."
1515
readme = { file = "README.md", content-type = "text/markdown" }
1616
authors = [

0 commit comments

Comments
 (0)