Skip to content
Merged

2.0.0 #394

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
e1255f5
Fixed simulator regression
lawhead Nov 18, 2024
99d7d5e
Added temporary script to update parameters files to our latest format
lawhead Nov 18, 2024
4a5b466
Added an interactive command line tool for running the simulator
lawhead Nov 20, 2024
dd85fb6
Initial implementation for simulator GUI
lawhead Nov 22, 2024
797e8f9
GUI Refactoring
lawhead Nov 23, 2024
9f89065
Added parent widgets
lawhead Nov 25, 2024
7f2a714
Fixes to output a command
lawhead Nov 25, 2024
8393137
Sim GUI cleanup; added a bcipy command; type fixes and linting
lawhead Nov 26, 2024
f2eec3b
Fix types for Python 3.8
lawhead Nov 26, 2024
49f9bbb
Bug fix in directory filter
lawhead Nov 26, 2024
a8e7fb8
Fix bug in data engine
lawhead Dec 2, 2024
bc651c0
Fix linting issue
lawhead Dec 2, 2024
3990c4b
Added sim parameter for sampler
lawhead Dec 2, 2024
931123b
Fix type issue
lawhead Dec 3, 2024
d751f48
Refactored to remove bcipy-sim-gui setup script
lawhead Dec 3, 2024
1d08e1d
Updated type
lawhead Dec 3, 2024
88b9245
BIDS export and refactor modules (#362)
tab-cmd Nov 25, 2024
69e3e0d
update imports
tab-cmd Dec 9, 2024
6013d2f
BIDS DSI-24, ET Data, and 1020 support (#369)
tab-cmd Dec 10, 2024
8d7e4db
Update to use pyproject.toml (#367)
tab-cmd Dec 10, 2024
3c7eb2c
Adjusted the coverage tools
lawhead Dec 11, 2024
2661379
Fix toml syntax
lawhead Dec 11, 2024
613f69c
Added simulator metrics across runs
lawhead Dec 16, 2024
2eccf90
Fixed typing issues
lawhead Dec 16, 2024
6cb091c
Changed sim logging level; added boxplots
lawhead Dec 17, 2024
e71c244
Add duration metrics
lawhead Dec 17, 2024
2cf2b75
Increase test coverage
lawhead Dec 17, 2024
9c3ebeb
Cleanup and documentation
lawhead Dec 19, 2024
8176fe0
#188673150 ; add session and session_inquiry to simulator Trials data…
lawhead Dec 19, 2024
5345fbf
Dedup list test
lawhead Dec 23, 2024
7d354b1
fixes from rebase
tab-cmd Jan 3, 2025
bfbd196
Fixed issues with simulator logging
lawhead Jan 8, 2025
ec419b7
Attempting to fix a Windows bug
lawhead Jan 8, 2025
3d71d8f
Added code to clean up file handlers in logging tests
lawhead Jan 8, 2025
f5d4e2c
Refactor to address Windows bug
lawhead Jan 8, 2025
247a1b4
Merge pull request #373 from CAMBI-tech/sim-logging-bug
lawhead Jan 8, 2025
6389f7a
Restructured simulation samplers; added a sampler for limiting which …
lawhead Jan 10, 2025
0daa272
Added sampler filtering for series start and end
lawhead Jan 11, 2025
4eab3e8
Added simulator command line support for providing parameters to the …
lawhead Jan 11, 2025
a60abf5
Added GUI utilities for dynamically adding inputs for sampler args
lawhead Jan 11, 2025
93c7f5a
Added GUI support for selecting a sampler with arguments
lawhead Jan 18, 2025
51c9d21
Refactored args for InquiryRangeSampler for better understandability
lawhead Jan 30, 2025
813ef27
Refactored task_runner to make it more testable
lawhead Jan 30, 2025
247fc0e
Fix mypy issues
lawhead Jan 30, 2025
a8d5c96
Merge pull request #374 from CAMBI-tech/inquiry-range-sampler
lawhead Jan 30, 2025
73b9289
Simulator change to remove empty triggers.txt file at the end of each…
lawhead Jan 31, 2025
c3df0ea
Added verbosity setting to simulator to control logging
lawhead Feb 6, 2025
ffadfa3
Updated sim readme with new parameter
lawhead Feb 6, 2025
41aedd7
#188805610 integrate replay script into simulator
lawhead Feb 12, 2025
0649ec1
Add documentation
lawhead Feb 12, 2025
18a1d03
Merge pull request #375 from CAMBI-tech/sim-verbose
lawhead Feb 18, 2025
7a689e1
Merge latest upstream
lawhead Feb 18, 2025
1b035a6
Added console script for replay session; updated documentation
lawhead Feb 18, 2025
9f35c66
Merge pull request #376 from CAMBI-tech/sim-replay
lawhead Feb 18, 2025
27974f4
Lm cleanup (#378)
dcgaines Mar 4, 2025
37b1f6e
Updated tests for button press calculations for easier understanding.
lawhead Mar 8, 2025
ae35c70
Added missing flag to README
lawhead Mar 8, 2025
6c9f62b
Fixed data_engine type signature
lawhead Mar 8, 2025
5de0b29
Added missing verbose flag to simulator GUI
lawhead Mar 8, 2025
4486fe6
Refactoring RawDataProcessor to support more subclass specialization
lawhead Mar 8, 2025
507fbb5
Added demo modules for simulating a button press model to test multim…
lawhead Mar 8, 2025
a49124f
Refactor for multimodal simulation; documentation; bug fixes
lawhead Mar 10, 2025
2635567
Documentation and linting
lawhead Mar 15, 2025
df4451c
Added documentation
lawhead Mar 17, 2025
19b764f
Added tests for demo code
lawhead Mar 17, 2025
11362f7
Fix README markup
lawhead Mar 17, 2025
3e5556f
Fix README markup
lawhead Mar 17, 2025
aa216ca
Causal LM Integration (#377)
tab-cmd Mar 20, 2025
cb38494
Renamed button press to switch
lawhead Mar 27, 2025
e29a111
Added code to generate raw data files for switch data; added convenie…
lawhead Mar 28, 2025
913a1d5
Refactored switch data processor to parse switch raw data
lawhead Apr 1, 2025
0d3601f
Refactored switch-related code into different modules
lawhead Apr 1, 2025
a42e738
Added parameter to evidence evaluators for passing parameters. Added …
lawhead Apr 1, 2025
56a9665
Moved README for multimodal simulation into the main simulator README…
lawhead Apr 3, 2025
013f39f
Fixes to allow switch devices to work correctly in multimodal acquisi…
lawhead Apr 4, 2025
37bd183
Merge latest upstream
lawhead Apr 4, 2025
07e7222
Cleanup
lawhead Apr 7, 2025
bcf502d
Merge pull request #385 from CAMBI-tech/sim-multimodal
lawhead Apr 7, 2025
3bab3e3
LM Toolkit Refactor (#381)
dcgaines Apr 29, 2025
2341d0e
Support multi run experiments and additional 10-20 channels (#386)
tab-cmd May 2, 2025
b29116b
Online Multimodal Fusion (#384)
celikbasak May 12, 2025
040fd57
import cleanup (#393)
lawhead May 28, 2025
e40b9d3
Cleanup for 2.0 release (#391)
tab-cmd Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 0 additions & 36 deletions .bcipy/README.md

This file was deleted.

Binary file not shown.
25 changes: 0 additions & 25 deletions .coveragerc

This file was deleted.

32 changes: 17 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, 3.10.6]
python-version: [3.9, 3.10.6]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, 3.10.6]
python-version: [3.9, 3.10.6]

steps:
- uses: actions/checkout@v2
Expand All @@ -80,10 +80,6 @@ jobs:
- name: update pip & install custom dependencies
run: |
python -m pip install --upgrade pip
- name: install manually downloaded pyWinhook wheel for Python 3.9
if: matrix.python-version == 3.9
run: |
pip install ./.bcipy/downloads/pyWinhook-1.6.2-cp39-cp39-win_amd64.whl
- name: install dependencies
run: |
make dev-install
Expand All @@ -97,17 +93,17 @@ jobs:
- name: lint
run: |
make lint
- name: integration-test
- name: build
run: |
make integration-test
make build

build-macos:

runs-on: macos-latest
runs-on: macos-14
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, 3.10.6]
python-version: [3.9, 3.10.6]

steps:
- uses: actions/checkout@v4
Expand All @@ -117,24 +113,30 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: update pip & install custom dependencies
run: |
python -m pip install --upgrade pip
brew update
sh scripts/shell/m2chip_install.sh
brew install labstreaminglayer/tap/lsl
python -m pip install --upgrade pip
pip install psychopy --no-deps
make install
- name: install dependencies
run: |
make dev-install
- name: unittest
if: always()
run: |
make coverage-report
make coverage-xml
- name: type-check
run: |
make type
- name: lint
run: |
make lint
- name: integration-test
- name: build
run: |
make integration-test


make build
- name: codacy
run: |
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }}
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r "cobertura.xml"
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ mypy-html.css
index.html
htmlcov/
html/
*.xml

# Virtualenv
venv/
venv*/
__pycache__/
.pytest_cache/
.cache/

# BciPy files and directories
*.csv
*.pdf
buffer.db
lmwrap.log
env.txt
.idea
bcipy.egg-info/
data/
build/
dist/
bcipy/parameters/parameters_*
Expand All @@ -35,6 +35,9 @@ bcipy/language/lms/lm_dec19_char_large_12gram.*
bcipy/language/lms/out_*
bcipy/language/out/


bcipy/simulator/tests/resource/
!bcipy/simulator/data
# Ignore the data directory, which contains the raw data files, but not the data modules
data/
bids/
!bcipy/simulator/data

33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# 2.0.0

The next major BciPy release is here! All features included from release canidates rc1-rc4 and contributions described below.

## Contributions

- BIDS
- Bundling support and refactor of `convert` module. See `demo_convert.py` #362 Add support for 1020 channels and eye tracker data #369
- Library Refactor
- Refactor `helpers` into `io` and `core` #362
- Refactor to use `pyproject.toml` for installs #367
- Language Model Refactor to use lm-toolkit #381 #390
- Gaze Model integration #384
- Simulator
- Multimodal support #385
- Replay feature #376
- Verbose mode configuration #375 and logging fixes #373
- Inquiry- Ranger Sampler #374 Trial Sampler #372
- Metrics #371
- Dependencies
- Upgrade
- `seaborn` #362
- Add
- `mne-bids` #362
- `pybv` #362
- `EDFlib-Python` #362
- Remove
- `pyedflib` #362
- Drop support for python 3.8 #391
- General documentation improvements
- README updates #391
- Drop Twitter links #391

# 2.0.1-rc.4

Patch on final release candidate
Expand Down
34 changes: 6 additions & 28 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
BciPy Copyright 2021 (CAMBI)(Licensor)
Copyright 2025 (CAMBI)("Licensor")

Hippocratic License Version Number: 2.1.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Purpose. The purpose of this License is for the Licensor named above to permit the Licensee (as defined below) broad permission, if consistent with Human Rights Laws and Human Rights Principles (as each is defined below), to use and work with the Software (as defined below) within the full scope of Licensor’s copyright and patent rights, if any, in the Software, while ensuring attribution and protecting the Licensor from liability.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Permission and Conditions. The Licensor grants permission by this license (“License”), free of charge, to the extent of Licensor’s rights under applicable copyright and patent law, to any person or entity (the “Licensee”) obtaining a copy of this software and associated documentation files (the “Software”), to do everything with the Software that would otherwise infringe (i) the Licensor’s copyright in the Software or (ii) any patent claims to the Software that the Licensor can license or becomes able to license, subject to all of the following terms and conditions:
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Acceptance. This License is automatically offered to every person and entity subject to its terms and conditions. Licensee accepts this License and agrees to its terms and conditions by taking any action with the Software that, absent this License, would infringe any intellectual property right held by Licensor.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

* Notice. Licensee must ensure that everyone who gets a copy of any part of this Software from Licensee, with or without changes, also receives the License and the above copyright notice (and if included by the Licensor, patent, trademark and attribution notice). Licensee must cause any modified versions of the Software to carry prominent notices stating that Licensee changed the Software. For clarity, although Licensee is free to create modifications of the Software and distribute only the modified portion created by Licensee with additional or different terms, the portion of the Software not modified must be distributed pursuant to this License. If anyone notifies Licensee in writing that Licensee has not complied with this Notice section, Licensee can keep this License by taking all practical steps to comply within 30 days after the notice. If Licensee does not do so, Licensee’s License (and all rights licensed hereunder) shall end immediately.

* Compliance with Human Rights Principles and Human Rights Laws.

1. Human Rights Principles.

(a) Licensee is advised to consult the articles of the United Nations Universal Declaration of Human Rights and the United Nations Global Compact that define recognized principles of international human rights (the “Human Rights Principles”). Licensee shall use the Software in a manner consistent with Human Rights Principles.

(b) Unless the Licensor and Licensee agree otherwise, any dispute, controversy, or claim arising out of or relating to (i) Section 1(a) regarding Human Rights Principles, including the breach of Section 1(a), termination of this License for breach of the Human Rights Principles, or invalidity of Section 1(a) or (ii) a determination of whether any Law is consistent or in conflict with Human Rights Principles pursuant to Section 2, below, shall be settled by arbitration in accordance with the Hague Rules on Business and Human Rights Arbitration (the “Rules”); provided, however, that Licensee may elect not to participate in such arbitration, in which event this License (and all rights licensed hereunder) shall end immediately. The number of arbitrators shall be one unless the Rules require otherwise.

Unless both the Licensor and Licensee agree to the contrary: (1) All documents and information concerning the arbitration shall be public and may be disclosed by any party; (2) The repository referred to under Article 43 of the Rules shall make available to the public in a timely manner all documents concerning the arbitration which are communicated to it, including all submissions of the parties, all evidence admitted into the record of the proceedings, all transcripts or other recordings of hearings and all orders, decisions and awards of the arbitral tribunal, subject only to the arbitral tribunal's powers to take such measures as may be necessary to safeguard the integrity of the arbitral process pursuant to Articles 18, 33, 41 and 42 of the Rules; and (3) Article 26(6) of the Rules shall not apply.

2. Human Rights Laws. The Software shall not be used by any person or entity for any systems, activities, or other uses that violate any Human Rights Laws. “Human Rights Laws” means any applicable laws, regulations, or rules (collectively, “Laws”) that protect human, civil, labor, privacy, political, environmental, security, economic, due process, or similar rights; provided, however, that such Laws are consistent and not in conflict with Human Rights Principles (a dispute over the consistency or a conflict between Laws and Human Rights Principles shall be determined by arbitration as stated above). Where the Human Rights Laws of more than one jurisdiction are applicable or in conflict with respect to the use of the Software, the Human Rights Laws that are most protective of the individuals or groups harmed shall apply.

3. Indemnity. Licensee shall hold harmless and indemnify Licensor (and any other contributor) against all losses, damages, liabilities, deficiencies, claims, actions, judgments, settlements, interest, awards, penalties, fines, costs, or expenses of whatever kind, including Licensor’s reasonable attorneys’ fees, arising out of or relating to Licensee’s use of the Software in violation of Human Rights Laws or Human Rights Principles.

* Failure to Comply. Any failure of Licensee to act according to the terms and conditions of this License is both a breach of the License and an infringement of the intellectual property rights of the Licensor (subject to exceptions under Laws, e.g., fair use). In the event of a breach or infringement, the terms and conditions of this License may be enforced by Licensor under the Laws of any jurisdiction to which Licensee is subject. Licensee also agrees that the Licensor may enforce the terms and conditions of this License against Licensee through specific performance (or similar remedy under Laws) to the extent permitted by Laws. For clarity, except in the event of a breach of this License, infringement, or as otherwise stated in this License, Licensor may not terminate this License with Licensee.

* Enforceability and Interpretation. If any term or provision of this License is determined to be invalid, illegal, or unenforceable by a court of competent jurisdiction, then such invalidity, illegality, or unenforceability shall not affect any other term or provision of this License or invalidate or render unenforceable such term or provision in any other jurisdiction; provided, however, subject to a court modification pursuant to the immediately following sentence, if any term or provision of this License pertaining to Human Rights Laws or Human Rights Principles is deemed invalid, illegal, or unenforceable against Licensee by a court of competent jurisdiction, all rights in the Software granted to Licensee shall be deemed null and void as between Licensor and Licensee. Upon a determination that any term or provision is invalid, illegal, or unenforceable, to the extent permitted by Laws, the court may modify this License to affect the original purpose that the Software be used in compliance with Human Rights Principles and Human Rights Laws as closely as possible. The language in this License shall be interpreted as to its fair meaning and not strictly for or against any party.

* Disclaimer. TO THE FULL EXTENT ALLOWED BY LAW, THIS SOFTWARE COMES “AS IS,” WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED, AND LICENSOR AND ANY OTHER CONTRIBUTOR SHALL NOT BE LIABLE TO ANYONE FOR ANY DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THIS LICENSE, UNDER ANY KIND OF LEGAL CLAIM.

This Hippocratic License is an Ethical Source license (https://ethicalsource.dev) and is offered for use by licensors and licensees at their own risk, on an “AS IS” basis, and with no warranties express or implied, to the maximum extent permitted by Laws.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 18 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ install:
pip install -e .

dev-install:
pip install -r dev_requirements.txt
pip install kenlm==0.1 --global-option="--max_order=12"
pip install -e ".[dev]"
make install

build:
make dev-install
python setup.py sdist bdist_wheel
pip install -e ".[release]"
python -m build --sdist --wheel

test-all:
make coverage-report
make type
make lint
make integration-test

unit-test:
pytest --mpl -k "not slow"
Expand All @@ -23,18 +21,21 @@ integration-test:
pytest --mpl -k "slow"

coverage-report:
coverage run --branch --source=bcipy -m pytest --mpl -k "not slow"
coverage run --branch -m pytest --mpl -k "not slow"
coverage report

coverage-xml:
coverage xml -o "cobertura.xml"

coverage-html:
coverage run --branch --source=bcipy -m pytest --mpl -k "not slow"
coverage run --branch -m pytest --mpl -k "not slow"
coverage html

lint:
flake8 bcipy

lint-fix:
autopep8 --in-place --aggressive -r bcipy
autopep8 --in-place --aggressive --max-line-length 120 --ignore "E402,E226,E24,W50,W690" -r bcipy
flake8 bcipy

type:
Expand All @@ -47,6 +48,15 @@ clean:
find . -name "*.py[co]" -o -name __pycache__ -exec rm -rf {} +
find . -path "*/*.pyo" -delete
find . -path "*/*.pyc" -delete
find . -path "*/*/__pycache__" -delete
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .coverage
rm -rf htmlcov
rm -rf dist
rm -rf build
rm -rf bcipy.egg-info
rm -rf bcipy_cache

bci-gui:
python bcipy/gui/BCInterface.py
Expand Down
Loading
Loading