Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some dependencies for easy installation #47

Merged
merged 4 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 3
matrix:
platform: [ubuntu-latest]
python-version: [3.5, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoud be str type (to use 3.10, which currently incompatible with pqkmeans ...)


steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ python setup.py install


```
# evaluation needs extra texmex package
pip install pqkmeans[texmex]
# with artificial data
python bin/run_experiment.py --dataset artificial --algorithm bkmeans pqkmeans --k 100
# with texmex dataset (http://corpus-texmex.irisa.fr/)
Expand Down
5 changes: 4 additions & 1 deletion pqkmeans/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import six.moves.urllib
import tarfile
import texmex_python


def get_gmm_random_dataset(k, dimension=100, test_size=5000, train_size=500):
Expand Down Expand Up @@ -39,6 +38,10 @@ def get_sift1m_dataset(cache_directory="."):


def get_texmex_dataset(url, filename, member_names, cache_directory="."):
try:
import texmex_python
except ImportError:
raise ImportError("Missing optional dependency 'texmex_python'. You must install it to use this dataset.")
path = os.path.join(cache_directory, filename)
if not os.path.exists(path):
print("downloading {}".format(url))
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy
numpy<1.21
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors occur with recent numpy

scikit-learn
pipe
pipe<2.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaking changes on 2.0

scipy
six
texmex_python==1.0.0
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@ def build_extension(self, ext):
cmdclass=dict(build_ext=CMakeBuild),
test_suite='test',
zip_safe=False,
extras_require={
"texmex": ["texmex-python>=1.0.0"],
},
)
Loading