-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: Add vid downloader, start position pytests * WIP: Full coverage on common_position.py * WIP: Start add tests for DLC * WIP: pytests for position 2 * WIP: Align yml files * WIP: Add DLC Centroid tests * WIP: tests for centoid, model, orietation * WIP: Subpackage coverage 72% * WIP: Run tests on main * WIP: Add prints to debug data download * WIP: remove redundant slash * WIP: download full directory * WIP: let pytests down dlc items * WIP: gh-action managed container * WIP: use mysql as service * WIP: fix container ID * WIP: revise no-docker arg name * WIP: Box vars available to test step * WIP: Only first test * WIP: remove duplicate installs from conda deps -> pyproject * WIP: Add cuda driver * WIP: Cuda method selective * WIP: unpin DLC * WIP: parameterize skipping dlc tests * WIP: Add back Checkout * WIP: All download in action * WIP: custom wget func * WIP: revise data downloader * WIP: Run all * WIP: no docker container id in test database_settings * WIP: revise utils tests for --no-docker * WIP: add password to DatabaseSettings no-docker run * WIP: Spellcheck * WIP: debug mysql add role command * WIP: fix typo * 🎉 : Update changelog * Edit PR template to remind of local tests * Revert conda-installed dependencies * Return mountainsort to conda pip list * Upgrade action versions per node.js 16 deprecation
- Loading branch information
Showing
44 changed files
with
1,599 additions
and
252 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Test conda env and run tests | ||
name: Tests | ||
|
||
on: | ||
push: | ||
|
@@ -7,52 +7,74 @@ on: | |
- '!documentation' | ||
schedule: # once a day at midnight UTC | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: # Manually trigger with 'Run workflow' button | ||
|
||
concurrency: # Replace Cancel Workflow Action | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] #, macos-latest, windows-latest] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: '3.8' | ||
OS: ubuntu-latest | ||
PYTHON: '3.9' | ||
UCSF_BOX_TOKEN: ${{ secrets.UCSF_BOX_TOKEN }} # for download and testing | ||
UCSF_BOX_USER: ${{ secrets.UCSF_BOX_USER }} | ||
services: | ||
mysql: | ||
image: datajoint/mysql:8.0 | ||
env: # args: mysql -h 127.0.0.1 -P 3308 -uroot -ptutorial -e "CMD;" | ||
MYSQL_DATABASE: localhost | ||
MYSQL_ROOT_PASSWORD: tutorial | ||
ports: | ||
- 3308:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
steps: | ||
- name: Cancel Workflow Action | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
all_but_latest: true | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON }} | ||
- name: Set up conda environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- name: Set up conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: spyglass | ||
environment-file: environment.yml | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
- name: Install spyglass | ||
use-mamba: true | ||
- name: Install apt dependencies | ||
run: | | ||
pip install -e .[test] | ||
sudo apt-get update # First mysql options | ||
sudo apt-get install mysql-client libmysqlclient-dev libgirepository1.0-dev -y | ||
sudo apt-get install ffmpeg libsm6 libxext6 -y # non-dlc position deps | ||
- name: Run pip install for test deps | ||
run: | | ||
pip install --quiet .[test] | ||
- name: Download data | ||
env: | ||
UCSF_BOX_TOKEN: ${{ secrets.UCSF_BOX_TOKEN }} | ||
UCSF_BOX_USER: ${{ secrets.UCSF_BOX_USER }} | ||
WEBSITE: ftps://ftp.box.com/trodes_to_nwb_test_data/minirec20230622.nwb | ||
BASEURL: ftps://ftp.box.com/trodes_to_nwb_test_data/ | ||
NWBFILE: minirec20230622.nwb # Relative to Base URL | ||
VID_ONE: 20230622_sample_01_a1/20230622_sample_01_a1.1.h264 | ||
VID_TWO: 20230622_sample_02_a1/20230622_sample_02_a1.1.h264 | ||
RAW_DIR: /home/runner/work/spyglass/spyglass/tests/_data/raw/ | ||
VID_DIR: /home/runner/work/spyglass/spyglass/tests/_data/video/ | ||
run: | | ||
mkdir -p $RAW_DIR | ||
wget --recursive --no-verbose --no-host-directories --no-directories \ | ||
--user $UCSF_BOX_USER --password $UCSF_BOX_TOKEN \ | ||
-P $RAW_DIR $WEBSITE | ||
mkdir -p $RAW_DIR $VID_DIR | ||
wget_opts() { # Declare func with download options | ||
wget \ | ||
--recursive --no-verbose --no-host-directories --no-directories \ | ||
--user "$UCSF_BOX_USER" --password "$UCSF_BOX_TOKEN" \ | ||
-P "$1" "$BASEURL""$2" | ||
} | ||
wget_opts $RAW_DIR $NWBFILE | ||
wget_opts $VID_DIR $VID_ONE | ||
wget_opts $VID_DIR $VID_TWO | ||
- name: Run tests | ||
run: | | ||
pytest -rP # env vars are set within certain tests | ||
pytest --no-docker --no-dlc |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ coverage.xml | |
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
tests/_data/* | ||
|
||
# Translations | ||
*.mo | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
|
||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
identity and expression, level of experience, education, socioeconomic status, | ||
nationality, personal appearance, race, caste, color, religion, or sexual | ||
identity and orientation. | ||
|
||
|
@@ -18,24 +17,24 @@ diverse, inclusive, and healthy community. | |
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
- Demonstrating empathy and kindness toward other people | ||
- Being respectful of differing opinions, viewpoints, and experiences | ||
- Giving and gracefully accepting constructive feedback | ||
- Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
- Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
- The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
- Trolling, insulting or derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
|
@@ -61,8 +60,8 @@ representative at an online or offline event. | |
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[email protected]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
[email protected]. All complaints will be reviewed and investigated | ||
promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
@@ -120,14 +119,14 @@ version 2.1, available at | |
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
Community Impact Guidelines were inspired by | ||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
[Mozilla's code of conduct enforcement ladder][mozilla coc]. | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at | ||
[https://www.contributor-covenant.org/faq][faq]. Translations are available at | ||
[https://www.contributor-covenant.org/translations][translations]. | ||
|
||
[faq]: https://www.contributor-covenant.org/faq | ||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
[Mozilla CoC]: https://github.com/mozilla/diversity | ||
[FAQ]: https://www.contributor-covenant.org/faq | ||
[mozilla coc]: https://github.com/mozilla/diversity | ||
[translations]: https://www.contributor-covenant.org/translations | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html |
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
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
Oops, something went wrong.