arrowspace 0.13.3__tar.gz → 0.15.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.
Potentially problematic release.
This version of arrowspace might be problematic. Click here for more details.
- arrowspace-0.15.0/.github/workflows/python-publish.yml +137 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/Cargo.lock +3 -3
- {arrowspace-0.13.3 → arrowspace-0.15.0}/Cargo.toml +2 -2
- {arrowspace-0.13.3 → arrowspace-0.15.0}/PKG-INFO +1 -1
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/test_0.py +7 -6
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/test_2_CVE_db.py +2 -2
- {arrowspace-0.13.3 → arrowspace-0.15.0}/.github/workflows/CI.yml +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/.gitignore +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/GRAPH_VARIABLES.md +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/LICENSE +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/NORMALISATION.md +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/README.md +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/TAUMODE.md +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/pyproject.toml +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/src/lib.rs +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/src/tests.rs +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/src/tests_python.rs +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/__init__.py +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/embeddings_model.py +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/requirements.txt +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/small_datasets/vectors_data_3000.txt +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/svdecomposition.py +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/test_1_quora_questions.py +0 -0
- {arrowspace-0.13.3 → arrowspace-0.15.0}/tests/test_3_beir.py +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# .github/workflows/publish.yml
|
|
2
|
+
# Publishes pyarrowspace Python package to PyPI using maturin when a release is created
|
|
3
|
+
|
|
4
|
+
name: Publish to PyPI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
workflow_dispatch: # Allow manual trigger for testing
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
linux:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
target: [x86_64, aarch64]
|
|
20
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Build wheels
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
target: ${{ matrix.target }}
|
|
32
|
+
args: --release --out dist --find-interpreter
|
|
33
|
+
sccache: 'true'
|
|
34
|
+
manylinux: auto
|
|
35
|
+
|
|
36
|
+
- name: Upload wheels
|
|
37
|
+
uses: actions/upload-artifact@v4
|
|
38
|
+
with:
|
|
39
|
+
name: wheels-linux-${{ matrix.target }}-py${{ matrix.python-version }}
|
|
40
|
+
path: dist
|
|
41
|
+
|
|
42
|
+
windows:
|
|
43
|
+
runs-on: windows-latest
|
|
44
|
+
strategy:
|
|
45
|
+
matrix:
|
|
46
|
+
target: [x64]
|
|
47
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
architecture: ${{ matrix.target }}
|
|
55
|
+
|
|
56
|
+
- name: Build wheels
|
|
57
|
+
uses: PyO3/maturin-action@v1
|
|
58
|
+
with:
|
|
59
|
+
target: ${{ matrix.target }}
|
|
60
|
+
args: --release --out dist --find-interpreter
|
|
61
|
+
sccache: 'true'
|
|
62
|
+
|
|
63
|
+
- name: Upload wheels
|
|
64
|
+
uses: actions/upload-artifact@v4
|
|
65
|
+
with:
|
|
66
|
+
name: wheels-windows-${{ matrix.target }}-py${{ matrix.python-version }}
|
|
67
|
+
path: dist
|
|
68
|
+
|
|
69
|
+
macos:
|
|
70
|
+
runs-on: macos-latest
|
|
71
|
+
strategy:
|
|
72
|
+
matrix:
|
|
73
|
+
target: [x86_64, aarch64]
|
|
74
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ matrix.python-version }}
|
|
81
|
+
|
|
82
|
+
- name: Build wheels
|
|
83
|
+
uses: PyO3/maturin-action@v1
|
|
84
|
+
with:
|
|
85
|
+
target: ${{ matrix.target }}
|
|
86
|
+
args: --release --out dist --find-interpreter
|
|
87
|
+
sccache: 'true'
|
|
88
|
+
|
|
89
|
+
- name: Upload wheels
|
|
90
|
+
uses: actions/upload-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: wheels-macos-${{ matrix.target }}-py${{ matrix.python-version }}
|
|
93
|
+
path: dist
|
|
94
|
+
|
|
95
|
+
sdist:
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
|
|
100
|
+
- name: Build sdist
|
|
101
|
+
uses: PyO3/maturin-action@v1
|
|
102
|
+
with:
|
|
103
|
+
command: sdist
|
|
104
|
+
args: --out dist
|
|
105
|
+
|
|
106
|
+
- name: Upload sdist
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: wheels-sdist
|
|
110
|
+
path: dist
|
|
111
|
+
|
|
112
|
+
release:
|
|
113
|
+
name: Release to PyPI
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
needs: [linux, windows, macos, sdist]
|
|
116
|
+
permissions:
|
|
117
|
+
# IMPORTANT: mandatory for trusted publishing
|
|
118
|
+
id-token: write
|
|
119
|
+
environment:
|
|
120
|
+
name: pypi
|
|
121
|
+
url: https://pypi.org/project/pyarrowspace
|
|
122
|
+
steps:
|
|
123
|
+
- name: Download all artifacts
|
|
124
|
+
uses: actions/download-artifact@v4
|
|
125
|
+
with:
|
|
126
|
+
path: dist
|
|
127
|
+
pattern: wheels-*
|
|
128
|
+
merge-multiple: true
|
|
129
|
+
|
|
130
|
+
- name: List distributions
|
|
131
|
+
run: ls -lh dist/
|
|
132
|
+
|
|
133
|
+
- name: Publish to PyPI
|
|
134
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
135
|
+
with:
|
|
136
|
+
skip-existing: true
|
|
137
|
+
verbose: true
|
|
@@ -92,9 +92,9 @@ dependencies = [
|
|
|
92
92
|
|
|
93
93
|
[[package]]
|
|
94
94
|
name = "arrowspace"
|
|
95
|
-
version = "0.
|
|
95
|
+
version = "0.15.0"
|
|
96
96
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
|
-
checksum = "
|
|
97
|
+
checksum = "05f0d5ec06ec0ff1d04461bf07210c05a72670b43e3888842cef04567b593b50"
|
|
98
98
|
dependencies = [
|
|
99
99
|
"approx 0.5.1",
|
|
100
100
|
"dashmap",
|
|
@@ -515,7 +515,7 @@ dependencies = [
|
|
|
515
515
|
|
|
516
516
|
[[package]]
|
|
517
517
|
name = "pyarrowspace"
|
|
518
|
-
version = "0.
|
|
518
|
+
version = "0.15.0"
|
|
519
519
|
dependencies = [
|
|
520
520
|
"arrowspace",
|
|
521
521
|
"numpy",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "pyarrowspace"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.15.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
|
|
@@ -14,6 +14,6 @@ name = "arrowspace"
|
|
|
14
14
|
crate-type = ["cdylib"]
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
|
-
arrowspace = "0.
|
|
17
|
+
arrowspace = "0.15.0"
|
|
18
18
|
pyo3 = { version = "*", features = ["extension-module"] }
|
|
19
19
|
numpy = "0.19"
|
|
@@ -24,6 +24,7 @@ aspace, gl = ArrowSpaceBuilder.build(graph_params, items)
|
|
|
24
24
|
query1 = np.array(items[2] * 1.05, dtype=np.float64)
|
|
25
25
|
hits = aspace.search(query1, gl, 1.0) # list[(idx, score)]
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
print(hits)
|
|
28
29
|
assert(len(hits) == 3)
|
|
29
30
|
assert(hits[0][0] == 2)
|
|
@@ -37,8 +38,8 @@ hits = aspace.search(query2, gl, 0.9) # list[(idx, score)]
|
|
|
37
38
|
print(hits)
|
|
38
39
|
assert(len(hits) == 3)
|
|
39
40
|
assert(hits[0][0] == 1)
|
|
40
|
-
assert(hits[1][0] ==
|
|
41
|
-
assert(hits[2][0] ==
|
|
41
|
+
assert(hits[1][0] == 2)
|
|
42
|
+
assert(hits[2][0] == 0)
|
|
42
43
|
|
|
43
44
|
# Search comparable items (defaults: k = nitems, alpha = 0.6, beta = 0.4)
|
|
44
45
|
query3 = np.array(items[2] * 1.05, dtype=np.float64)
|
|
@@ -47,8 +48,8 @@ hits = aspace.search(query3, gl, 0.6) # list[(idx, score)]
|
|
|
47
48
|
print(hits)
|
|
48
49
|
assert(len(hits) == 3)
|
|
49
50
|
assert(hits[0][0] == 1)
|
|
50
|
-
assert(hits[1][0] ==
|
|
51
|
-
assert(hits[2][0] ==
|
|
51
|
+
assert(hits[1][0] == 3)
|
|
52
|
+
assert(hits[2][0] == 2)
|
|
52
53
|
|
|
53
54
|
query4 = np.array(items[2] * 1.05, dtype=np.float64)
|
|
54
55
|
hits = aspace.search(query4, gl, 0.55) # list[(idx, score)]
|
|
@@ -56,5 +57,5 @@ hits = aspace.search(query4, gl, 0.55) # list[(idx, score)]
|
|
|
56
57
|
print(hits)
|
|
57
58
|
assert(len(hits) == 3)
|
|
58
59
|
assert(hits[0][0] == 1)
|
|
59
|
-
assert(hits[1][0] ==
|
|
60
|
-
assert(hits[2][0] ==
|
|
60
|
+
assert(hits[1][0] == 3)
|
|
61
|
+
assert(hits[2][0] == 2)
|
|
@@ -20,8 +20,8 @@ from arrowspace import ArrowSpaceBuilder, set_debug
|
|
|
20
20
|
|
|
21
21
|
set_debug(True) # optional: Rust-side debug prints to stderr
|
|
22
22
|
|
|
23
|
-
START_YEAR =
|
|
24
|
-
END_YEAR =
|
|
23
|
+
START_YEAR = 1999
|
|
24
|
+
END_YEAR = 1999
|
|
25
25
|
|
|
26
26
|
def iter_cve_json(root_dir, start=START_YEAR, end=END_YEAR):
|
|
27
27
|
for path in glob.glob(os.path.join(root_dir, "**", "*.json"), recursive=True):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|