Skip to content

Commit 20684b0

Browse files
authored
Expand build matrix (#144)
* Expand build matrix * relax dependency resolution * bring in hdf5-static * pin biom * back to 3.6 * ls hdf5 libs * fix config * now do 3.8 * pin hdf5 * re-expand build matrix, remove biom pin * repin biom * pin h5py * unpin biom-format * BUG: fixed widths were problematic * change pin * change pin * change pin * or not and
1 parent fc32d22 commit 20684b0

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/main.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ jobs:
2929
needs: lint
3030
strategy:
3131
matrix:
32+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
3233
os: [ubuntu-latest, macos-latest]
3334
runs-on: ${{ matrix.os }}
3435
steps:
3536
- uses: actions/checkout@v2
3637
- uses: conda-incubator/setup-miniconda@v2
3738
with:
3839
auto-update-conda: true
39-
python-version: 3.6
40+
python-version: ${{ matrix.python-version }}
4041
- name: Install
4142
shell: bash -l {0}
4243
run: |
@@ -48,7 +49,7 @@ jobs:
4849
# the system tools are unusable, hide them
4950
sudo mv -f /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.org
5051
fi
51-
conda create --yes -n unifrac -c conda-forge -c bioconda python=3.6
52+
conda create --yes -n unifrac -c conda-forge -c bioconda python=${{ matrix.python-version }}
5253
conda activate unifrac
5354
conda config --add channels conda-forge
5455
conda config --add channels bioconda
@@ -57,8 +58,9 @@ jobs:
5758
conda install --yes -c conda-forge -c bioconda gxx_linux-64
5859
else
5960
conda install --yes -c conda-forge -c bioconda clangxx_osx-64
60-
fi
61-
conda install --yes -c conda-forge -c bioconda cython "hdf5>=1.8.17" biom-format numpy "h5py>=2.7.0" "scikit-bio>=0.5.1" unifrac-binaries flake8 nose
61+
fi
62+
conda install --yes -c conda-forge -c bioconda unifrac-binaries
63+
conda install --yes -c conda-forge -c bioconda cython "hdf5<1.12.1" biom-format numpy "h5py<3.0.0 | >3.3.0" "scikit-bio>=0.5.1" nose
6264
echo "$(uname -s)"
6365
if [[ "$(uname -s)" == "Linux" ]];
6466
then
@@ -77,8 +79,8 @@ jobs:
7779
shell: bash -l {0}
7880
run: |
7981
conda activate unifrac
82+
ls -lrt $CONDA_PREFIX/lib/libhdf5_cpp*
8083
nosetests
81-
flake8 unifrac setup.py
8284
8385
- name: Sanity checks
8486
shell: bash -l {0}

unifrac/_api.pyx

+8-2
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,14 @@ cdef support_biom* construct_support_biom(object table):
447447
np.ndarray[np.int32_t, ndim=1] table_indptr
448448
np.ndarray[np.double_t, ndim=1] table_data
449449

450-
table_obs_ids = table.ids(axis='observation')
451-
table_samp_ids = table.ids(axis='sample')
450+
# it seems that even if we use fixed width upstream, we cannot readily
451+
# utilize it within cython. Casting to 'object' now. It likely would be
452+
# beneficial to operate directly on fixed width.
453+
# https://stackoverflow.com/questions/42543485/cython-specify-numpy-array-of-fixed-length-strings#comment72258848_
454+
455+
table_obs_ids = table.ids(axis='observation').astype(object)
456+
table_samp_ids = table.ids(axis='sample').astype(object)
457+
452458
table_indices = table.matrix_data.indices
453459
table_indptr = table.matrix_data.indptr
454460
table_data = table.matrix_data.data

0 commit comments

Comments
 (0)