Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Commit cbf13cf

Browse files
authored
Merge pull request #147 from 36000/make_table_optional
[ENH] make table optional
2 parents 6ad27c9 + 51709b7 commit cbf13cf

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/docbuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install
2121
run: |
2222
python -m pip install --upgrade pip
23-
python -m pip install .[dev]
23+
python -m pip install .[dev,tables]
2424
- name: Build docs
2525
run: |
2626
cd doc

afqinsight/h5io.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@
3636
"""
3737

3838
import numpy as np
39-
import tables
4039
import warnings
4140
from scipy import sparse
41+
from dipy.utils.optpkg import optional_package
42+
43+
44+
tables_msg = (
45+
"To use AFQ-Insight's h5io classes, you will need to have tables "
46+
"installed. You can do this by installing afqinsight with `pip install "
47+
"afqinsight[tables]`, or by separately installing these packages with "
48+
"`pip install tables`."
49+
)
50+
tables, HAS_TABLES, _ = optional_package("tables", trip_msg=tables_msg)
51+
4252

4353
try:
4454
import pandas as pd

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ install_requires =
4141
seaborn==0.13.0
4242
scikit-learn==1.2.1
4343
sklearn_pandas>=2.0.0
44-
tables==3.9.1
4544
tqdm
4645
statsmodels==0.14.0
4746
copt==0.9.1
@@ -50,6 +49,8 @@ include_package_data = True
5049
packages = find:
5150

5251
[options.extras_require]
52+
tables =
53+
tables==3.9.1
5354
torch =
5455
torch
5556
tf =
@@ -77,6 +78,7 @@ maint =
7778
rapidfuzz
7879

7980
all =
81+
%(tables)s
8082
%(torch)s
8183
%(tf)s
8284
%(dev)s

0 commit comments

Comments
 (0)