Skip to content

Commit

Permalink
Merge pull request #3085 from JoeZiminski/add_kilosort4_wrapper_tests
Browse files Browse the repository at this point in the history
Add kilosort4 wrapper tests
  • Loading branch information
alejoe91 authored Aug 21, 2024
2 parents a2f157c + 642eea9 commit 73f6151
Show file tree
Hide file tree
Showing 7 changed files with 808 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This folder contains test scripts for running in the CI, that are not run as part of the usual
CI because they are too long / heavy. These are run on cron-jobs once per week.
35 changes: 35 additions & 0 deletions .github/scripts/check_kilosort4_releases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import re
from pathlib import Path
import requests
import json
from packaging.version import parse
import spikeinterface

def get_pypi_versions(package_name):
"""
Make an API call to pypi to retrieve all
available versions of the kilosort package.
"""
url = f"https://pypi.org/pypi/{package_name}/json"
response = requests.get(url)
response.raise_for_status()
data = response.json()
versions = list(sorted(data["releases"].keys()))

assert parse(spikeinterface.__version__) < parse("0.101.1"), (
"Kilosort 4.0.5-12 are supported in SpikeInterface < 0.101.1."
"At version 0.101.1, this should be updated to support newer"
"kilosort verrsions."
)
versions = [ver for ver in versions if parse("4.0.12") >= parse(ver) >= parse("4.0.5")]
return versions


if __name__ == "__main__":
# Get all KS4 versions from pipi and write to file.
package_name = "kilosort"
versions = get_pypi_versions(package_name)
with open(Path(os.path.realpath(__file__)).parent / "kilosort4-latest-version.json", "w") as f:
print(versions)
json.dump(versions, f)
1 change: 1 addition & 0 deletions .github/scripts/kilosort4-latest-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["4.0.10", "4.0.11", "4.0.12", "4.0.5", "4.0.6", "4.0.7", "4.0.8", "4.0.9"]
Loading

0 comments on commit 73f6151

Please sign in to comment.