Skip to content

Commit a7b4201

Browse files
committed
Fixed build and test failures
1 parent cd01041 commit a7b4201

File tree

15 files changed

+169
-184
lines changed

15 files changed

+169
-184
lines changed

.gitignore

Lines changed: 13 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,12 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
1+
*.lock
382

39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43-
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
3+
# Generated by Cargo
4+
# will have compiled files and executables
5+
debug/
766
target/
777

78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
103-
104-
# pdm
105-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106-
#pdm.lock
107-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108-
# in version control.
109-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110-
.pdm.toml
111-
.pdm-python
112-
.pdm-build/
113-
114-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115-
__pypackages__/
116-
117-
# Celery stuff
118-
celerybeat-schedule
119-
celerybeat.pid
120-
121-
# SageMath parsed files
122-
*.sage.py
8+
# These are backup files generated by rustfmt
9+
**/*.rs.bk
12310

12411
# Environments
12512
.env
@@ -129,34 +16,12 @@ venv/
12916
ENV/
13017
env.bak/
13118
venv.bak/
19+
.python-version
13220

133-
# Spyder project settings
134-
.spyderproject
135-
.spyproject
136-
137-
# Rope project settings
138-
.ropeproject
139-
140-
# mkdocs documentation
141-
/site
142-
143-
# mypy
144-
.mypy_cache/
145-
.dmypy.json
146-
dmypy.json
147-
148-
# Pyre type checker
149-
.pyre/
150-
151-
# pytype static type analyzer
152-
.pytype/
153-
154-
# Cython debug symbols
155-
cython_debug/
21+
# Python
22+
__pycache__/
23+
*.py[cod]
24+
*$py.class
15625

157-
# PyCharm
158-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160-
# and can be added to the global gitignore or merged into this file. For a more nuclear
161-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162-
#.idea/
26+
# C extensions
27+
*.so

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
[package]
2-
name = "slim_mse"
2+
name = "rtrec"
33
version = "0.1.0"
4-
edition = "2018"
4+
edition = "2021"
55

6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
67
[lib]
78
name = "rtrec" # This should match the module name
8-
path = "src/rtrec/lib.rs"
9+
path = "src/lib.rs"
910
crate-type = ["cdylib"]
1011

1112
[dependencies]
12-
ndarray = "0.15" # For numerical operations
13+
# ndarray = "0.15"
1314

1415
[dependencies.pyo3]
15-
version = "0.18"
16+
version = "0.19"
1617
features = ["extension-module"]
1718

1819
[package.metadata.maturin]

dockerfiles/requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ numpy
22
scipy
33
scikit-learn
44
pandas
5-
matplotlib
6-
7-
hnswlib
5+
#hnswlib
86

97
pytest
108

@@ -16,3 +14,4 @@ jupyter
1614
jupyterlab
1715
ipywidgets
1816

17+
matplotlib

pyproject.toml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,32 @@ description = "An realtime recommendation system supporting online updates"
55
authors = [
66
{ name = "myui", email = "[email protected]" }
77
]
8-
dependencies = [
9-
"cython>=3.0.11",
10-
"numpy>=2.1.0",
11-
"pandas>=2.2.2"
12-
]
138
readme = "README.md"
149
requires-python = ">= 3.8"
10+
dependencies = [
11+
"numpy>=2.1.1",
12+
"scipy>=1.14.1",
13+
"scikit-learn>=1.5.2",
14+
"pandas>=2.2.2",
15+
]
16+
17+
[project.urls]
18+
homepage = "https://github.com/myui/rtrec"
19+
repository = "https://github.com/myui/rtrec"
1520

1621
[build-system]
17-
requires = ["maturin>=0.13"]
22+
requires = ["maturin>=0.13,<2.0"]
1823
build-backend = "maturin"
24+
25+
[tool.rye]
26+
managed = true
27+
dev-dependencies = [
28+
"pytest>=8.3.3",
29+
]
30+
31+
[tool.maturin]
32+
python-source = "."
33+
module-name = "rtrec._lowlevel"
34+
35+
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
36+
features = ["pyo3/extension-module"]

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
pythonpath = .

rtrec/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from rtrec._lowlevel import SlimMSE
2+
3+
__all__ = ["SlimMSE"]

rtrec/utils/datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_user_items(self, user_id: int) -> Counter[float]:
2323
"""
2424
return self.interactions.get(user_id, self.empty)
2525

26-
def get_user_item_rating(self, user_id: int, item_id: int, default_count: float = 0.0) -> float:
26+
def get_user_item_count(self, user_id: int, item_id: int, default_count: float = 0.0) -> float:
2727
"""
2828
Get the interaction count for a specific user-item pair.
2929
"""

rtrec/utils/matrix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def row_sum(self, row: int) -> float:
4646
def get_column(self, col: int) -> List[float]:
4747
return [self.data.get((row, col), 0) for row in range(self.max_row)]
4848

49-
@DeprecationWarning
5049
def to_csr(self) -> csr_matrix:
5150
if not self.data:
5251
return csr_matrix((0, 0))
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)