Skip to content

Commit

Permalink
texmex-python as extra package
Browse files Browse the repository at this point in the history
  • Loading branch information
Keisuke Ogaki committed Oct 14, 2023
1 parent 8a3cbfe commit aa95a04
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
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.7, 3.8, 3.9, 3.10]
python-version: ["3.7", "3.8", "3.9", "3.10"]

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
8 changes: 4 additions & 4 deletions pqkmeans/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import os
import six.moves.urllib
import tarfile
try:
import texmex_python
except ImportError:
pass


def get_gmm_random_dataset(k, dimension=100, test_size=5000, train_size=500):
Expand Down Expand Up @@ -42,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
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"],
},
)

0 comments on commit aa95a04

Please sign in to comment.