Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiegu committed Feb 12, 2024
2 parents da6bb28 + be6e414 commit d927f09
Show file tree
Hide file tree
Showing 295 changed files with 60,010 additions and 26,559 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto

.git_archival.txt export-subst
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Description

Please include a summary of the changes and the related issue. Please also
include relevant motivation and context. Please list issues fixed or closed by
This PR.

- Fixes #000: How this PR fixes the issue
- `path/file.py`: Description of the change
- `path/file.py`: Description of the change
- Fixes #000: How this PR fixes the issue
- `path/file.py`: Description of the change
- `path/file.py`: Description of the change

# Checklist:

- [ ] This PR should be accompanied by a release: (yes/no/unsure)
- [ ] (If release) I have updated the `CITATION.cff`
- [ ] I have updated the `CHANGELOG.md`
- [ ] I have added/edited docs/notebooks to reflect the changes
47 changes: 47 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish docs
on:
push:
tags: # See PEP 440 for valid version format
- "*.*.*" # For docs bump, use X.X.XaX
branches:
- test_branch

permissions:
contents: write
pull-requests: write
issues: write
repository-projects: write

jobs:
deploy:
runs-on: ubuntu-latest
env:
REPO_OWNER: ${{ github.repository_owner }}
permissions:
contents: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: 3.9
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup - pip & config
run: |
pip install .[docs]
git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Deploy
run: |
echo "OWNER: ${REPO_OWNER}"
bash ./docs/build-docs.sh push $REPO_OWNER
env:
USERNAME: github-actions[bot]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 13 additions & 15 deletions .github/workflows/workflow.yml → .github/workflows/test-conda.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: Test conda env and run tests

on:
push:
Expand All @@ -17,16 +17,6 @@ jobs:
env:
OS: ${{ matrix.os }}
PYTHON: '3.8'
# SPYGLASS_BASE_DIR: ./data
# KACHERY_STORAGE_DIR: ./data/kachery-storage
# DJ_SUPPORT_FILEPATH_MANAGEMENT: True
# services:
# datajoint_test_server:
# image: datajoint/mysql
# ports:
# - 3306:3306
# options: >-
# -e MYSQL_ROOT_PASSWORD=tutorial
steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
Expand All @@ -46,12 +36,20 @@ jobs:
environment-file: environment.yml
miniforge-variant: Mambaforge
miniforge-version: latest
- name: Install test requirements
run: |
pip install -r requirements-dev.txt
- name: Install spyglass
run: |
pip install -e .
pip install -e .[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
RAW_DIR: /home/runner/work/spyglass/spyglass/tests/_data/raw/
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
- name: Run tests
run: |
pytest -rP # env vars are set within certain tests
98 changes: 98 additions & 0 deletions .github/workflows/test-package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Test package building

on:
push:
branches:
- master
- maint/*
tags:
- "*"
pull_request:
branches:
- master
- maint/*
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install --upgrade build twine
- name: Build sdist and wheel
run: python -m build
- run: twine check dist/*
- name: Upload sdist and wheel artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
- name: Build git archive
run: mkdir archive && git archive -v -o archive/archive.tgz HEAD
- name: Upload git archive artifact
uses: actions/upload-artifact@v3
with:
name: archive
path: archive/
test-package:
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
package: ['wheel', 'sdist', 'archive']
steps:
- name: Download sdist and wheel artifacts
if: matrix.package != 'archive'
uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Download git archive artifact
if: matrix.package == 'archive'
uses: actions/download-artifact@v3
with:
name: archive
path: archive/
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Update pip
run: pip install --upgrade pip
- name: Install wheel
if: matrix.package == 'wheel'
run: pip install dist/*.whl
- name: Install sdist
if: matrix.package == 'sdist'
run: pip install dist/*.tar.gz
- name: Install archive
if: matrix.package == 'archive'
run: pip install archive/archive.tgz
# - name: Install test extras
# run: pip install spyglass[test]
# - name: Run tests
# run: pytest --doctest-modules -v --pyargs spyglass
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [test-package]
environment:
name: pypi
url: https://pypi.org/p/spyglass-neuro
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
48 changes: 22 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,7 @@ mysql_config

# Notebooks
*.ipynb

!notebooks/00_intro.ipynb
!notebooks/01_spikesorting.ipynb
!notebooks/02_curation.ipynb
!notebooks/03_lfp.ipynb
!notebooks/04_Trodes_position.ipynb
!notebooks/05_DLC_from_scratch.ipynb
!notebooks/06_DLC_from_dir.ipynb
!notebooks/4_position_info.ipynb
!notebooks/07_linearization.ipynb
!notebooks/08_Extract_Mark_indicators.ipynb
!notebooks/09_Decoding_with_GPUs_on_the_GPU_cluster.ipynb
!notebooks/10_1D_Clusterless_Decoding.ipynb
!notebooks/11_2D_Clusterless_Decoding.ipynb
!notebooks/12_Ripple_Detection.ipynb
!notebooks/13_Theta_phase_and_power.ipynb

!notebooks/[0-9]*.ipynb

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -92,9 +76,6 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

Expand Down Expand Up @@ -137,9 +118,6 @@ venv.bak/
# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
Expand All @@ -165,7 +143,6 @@ dmypy.json
temp_nwb/*s

*.mp4
dj_local_conf.json
*.png
*.npy
*.nc
Expand All @@ -174,8 +151,27 @@ dj_local_conf.json
*.json
*.gz
*.pdf
*.lock
*.npz
*.xz
*.zip
*.pb
*.pem
dj_local_conf*
!dj_local_conf_example.json

!/.vscode/extensions.json
!/.vscode/settings.json
!/notebooks/dlc_scratch.png
!/notebooks/dlc_existing.png
!/notebooks/notebook-images/dlc_scratch.png
!/notebooks/notebook-images/dlc_existing.png

# Documentation
docs/site/
docs/src/CHANGELOG.md
docs/src/LICENSE.md
docs/src/notebooks/
!docs/src/images/*png
temp*

# Version
_version.py
13 changes: 13 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://github.com/DavidAnson/markdownlint
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
MD007: false # permit indenting 4 spaces instead of 2
MD013:
line_length: "80" # Line length limits
tables: false # disable for tables
code_blocks: false # disable for code blocks
MD025: false # permit adjacent headings
MD026: false # permit trailing punctuation in headings
MD033: # HTML elements allowed
allowed_elements:
- "img"
MD034: false # Bare URLs OK
Loading

0 comments on commit d927f09

Please sign in to comment.