Skip to content

Commit

Permalink
Merge pull request #13 from SFB-ELAINE/LeadDBS_integration
Browse files Browse the repository at this point in the history
Lead-DBS integration
  • Loading branch information
j-zimmermann authored Feb 4, 2024
2 parents 84f0d87 + 28ed98a commit 3604c53
Show file tree
Hide file tree
Showing 159 changed files with 14,261 additions and 3,841 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- main
tags:
- "v*"
pull_request:
workflow_dispatch:
schedule:
# run every week (for --pre release tests)
- cron: "0 0 * * 0"

jobs:
check-manifest:
# check-manifest is a tool that checks that all files in version control are
# included in the sdist (unless explicitly excluded)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run check-manifest

test:
name: ${{ matrix.platform }} (${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: "pyproject.toml"
cache: "pip"

- name: Install Dependencies
run: |
python -m pip install -U pip
# if running a cron job, we add the --pre flag to test against pre-releases
python -m pip install .[test] ${{ github.event_name == 'schedule' && '--pre' || '' }}
- name: 🧪 Run Tests
run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing

- name: Coverage
uses: codecov/codecov-action@v3
# TODO add release
14 changes: 9 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ dist/
*.egg-info/
_build/
docs/._*
Results*/
.idea/
.ipynb_checkpoints/

# Ignore file
*.vol.gz
*.pyc
.coverage
.coveragerc
*.vtu
.DS_Store

case*/
ng.ini

*.swp
test_cases/input_case2/micro_probes_SNEX100_custom.json
input_files/impedance.csv
impedance.csv
*checkpoints.ipynb
*.nii.gz
*.nii
success_*.txt
fail_*.txt
7 changes: 4 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ stages:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install tox
- tox -e $PYTHONVERSION
- pip install ".[test]"
- pytest

.run:
script:
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install .
- pip install "."
- cd input_files
- ossdbs 'inputTest.json'
- ossdbs 'input_cc.json'

test-3.8:
extends: ".test"
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# enable pre-commit.ci at https://pre-commit.ci/
# it adds:
# 1. auto fixing pull requests
# 2. auto updating the pre-commit configuration
ci:
autoupdate_schedule: monthly
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"

repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.13
hooks:
- id: validate-pyproject

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.282
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
20 changes: 19 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
include requirements.txt
recursive-include docs *.dia
recursive-include docs *.ipynb
recursive-include docs *.md
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.svg
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include examples *.ipynb
recursive-include examples *.json
recursive-include examples *.md
recursive-include examples *.py
recursive-include input_files *.gz
recursive-include input_files *.h5
recursive-include input_files *.json
recursive-include input_test_cases *.json
recursive-include input_test_cases *.md
recursive-include input_test_cases *.sh
recursive-include ossdbs *.py
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
OSS-DBSv2
=========

This is a first draft of the OSS-DBS rebuild.
This is the development version of the OSS-DBS rewrite.
Use with caution and please wait for the first official release before deploying it.
Bug reports are highly welcome, though!


Installation
Expand All @@ -16,6 +18,30 @@ To install OSS-DBS, clone it into a local directory,
pip install -e .
```

To also run the test suite of OSS-DBS, run

```
pip install -e ".[test]"
```

To develop OSS-DBS, run

```
pip install -e ".[dev]"
```

To locally build the docs of OSS-DBS, run

```
pip install -e ".[doc]"
```

To do everything of the above, run

```
pip install -e ".[all]"
```

Run OSS-DBS
-----------

Expand All @@ -26,4 +52,21 @@ and start the simulation with
ossdbs input.json
```

Also check out the `examples` directory and the documentation.
Also check out the `examples` directory and the documentation.

Development
-----------

The code uses the `input_files` and `tests` directories to check the functionality
upon each commit. If you add a new feature, please add a test to `tests`.
Make sure that the test does not run long and does not consume much memory.
It shall be rather a unit test than a full simulation run.
Likewise, only change `input_files` after opening an issue.

The `examples` directory is meant for users to understand what has been implemented.
Place heavy and/or experimental code there (e.g., code that may crash or consume many resources).

The code development follows different coding styles that are checked
by git pre-commit hooks.
Install `pre-commit` via `pip install pre-commit` and run
`pre-commit install` to activate it.
90 changes: 0 additions & 90 deletions custom/CustomColeCole4Model.json

This file was deleted.

20 changes: 0 additions & 20 deletions custom/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions custom/abbott_stjude_active_tip_custom.json

This file was deleted.

7 changes: 0 additions & 7 deletions custom/abbott_stjude_directed_custom.json

This file was deleted.

7 changes: 0 additions & 7 deletions custom/boston_scientific_vercise_custom.json

This file was deleted.

7 changes: 0 additions & 7 deletions custom/boston_scientific_vercise_directed_custom.json

This file was deleted.

7 changes: 0 additions & 7 deletions custom/medtronic_custom.json

This file was deleted.

10 changes: 0 additions & 10 deletions custom/micro_probes_SNEX100_custom.json

This file was deleted.

6 changes: 0 additions & 6 deletions custom/micro_probes_custom_rodent_custom.json

This file was deleted.

7 changes: 0 additions & 7 deletions custom/pins_medical_custom.json

This file was deleted.

Loading

0 comments on commit 3604c53

Please sign in to comment.