Fix return type for get_medoids_final()
and expose get_labels()
#138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows - build package and run tests | |
on: | |
push: | |
branches: # prevents running on tag push | |
- '**' | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Clone for PR | |
if: ${{ github.event_name == 'pull_request' }} | |
run: git clone -b $env:GITHUB_HEAD_REF https://github.com/motiwari/BanditPAM | |
- name: Clone for Push | |
if: ${{ github.event_name != 'pull_request' }} | |
run: git clone -b ($env:GITHUB_REF -replace '^refs/heads/', '') https://github.com/motiwari/BanditPAM | |
- name: Downloading data files for tests | |
shell: bash | |
run: | | |
cd BanditPAM | |
mkdir -p data | |
curl -XGET https://motiwari.com/banditpam_data/scRNA_1k.csv > data/scRNA_1k.csv | |
curl -XGET https://motiwari.com/banditpam_data/scrna_reformat.csv.gz > data/scrna_reformat.csv.gz | |
curl -XGET https://motiwari.com/banditpam_data/MNIST_100.csv > data/MNIST_100.csv | |
curl -XGET https://motiwari.com/banditpam_data/MNIST_1k.csv > data/MNIST_1k.csv | |
curl -XGET https://motiwari.com/banditpam_data/MNIST_10k.tar.gz > data/MNIST_10k.tar.gz | |
tar -xzvf data/MNIST_10k.tar.gz -C data | |
curl -XGET https://motiwari.com/banditpam_data/MNIST_70k.tar.gz > data/MNIST_70k.tar.gz | |
tar -xzvf data/MNIST_70k.tar.gz -C data | |
- name: Install Armadillo 10.7.5+ | |
run: | | |
cd BanditPAM/headers | |
git clone https://gitlab.com/conradsnicta/armadillo-code.git armadillo | |
cd armadillo | |
cmake . | |
C:/"Program Files"/"Microsoft Visual Studio"/2022/Enterprise/Common7/IDE/devenv armadillo.sln /Build "Release|x64" | |
- name: Add environment variables | |
run: | | |
Add-Content $env:GITHUB_PATH "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\bin\HostX86\x86" | |
- name: Install carma | |
run: | | |
cd BanditPAM/headers | |
git clone https://github.com/RUrlus/carma.git | |
cd carma | |
mkdir build | |
cd build | |
cmake -DCARMA_INSTALL_LIB=ON .. | |
cmake --build . --config Release --target install | |
cd ../../.. | |
- name: Verify that the C++ executable compiles and runs # Building C++ first to avoid armadillo include issues | |
run: | | |
cd BanditPAM/scripts | |
sh retrieve_windows_cmake_files.sh | |
cd .. | |
mkdir build | |
cd build | |
cmake .. | |
C:/"Program Files"/"Microsoft Visual Studio"/2022/Enterprise/Common7/IDE/devenv BanditPAM.sln /Build "Release|x64" | |
cd src/Release | |
.\BanditPAM.exe -f ../../../data/MNIST_1k.csv -k 5 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install --upgrade pip setuptools wheel | |
- name: Install BanditPAM package | |
run: | | |
cd BanditPAM | |
# The flags are necessary to ignore the pyproject.toml | |
# See https://github.com/pypa/pip/issues/9738 | |
python -m pip install -vvvv --no-use-pep517 . | |
cd scripts | |
sh retrieve_windows_python_files.sh | |
cd .. | |
python -m pip install -vvvv --no-use-pep517 . | |
- name: Run smaller suite of test cases | |
run: | | |
cd BanditPAM | |
python tests/test_smaller.py | |
- name: Run tests cases for initialization | |
run: | | |
cd BanditPAM | |
python tests/test_initialization.py |