Skip to content

Commit 651c444

Browse files
committed
2.0.0rc1
2 parents c18878a + 1e996a7 commit 651c444

File tree

327 files changed

+20258
-39528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+20258
-39528
lines changed

.bcipy/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Experiments and Fields
2+
3+
BciPy experiments and fields allow users to collect metadata that may be integrated alongside core BciPy data. This is particularly useful when the experiment has completed and a researcher wants to curate their files for sharing with the community.
4+
5+
## Experiments
6+
7+
An experiment defines the name, summary and fields to collect. At this level, the requirement for collection during every task and whether or not to anonymize later will be set. The anonymization does not encrypt the data at rest, but instead defines how to handle the field later when uploading/sharing. The registered experiments are defined in `.bcipy/experiment/experiments.json` in the following format:
8+
9+
```js
10+
{
11+
name: {
12+
fields : {
13+
name: "",
14+
required: bool,
15+
anonymize: bool
16+
},
17+
summary: ""
18+
}
19+
}
20+
```
21+
22+
## Fields
23+
24+
A field is a unit of data collection for an experiment. It has a name, help text and type. The type will determine how it is collected and validated. The registered fields are defined in `.bcipy/field/fields.json` in the following format:
25+
26+
27+
```js
28+
{
29+
name: {
30+
help_text: "",
31+
type: "FieldType"
32+
}
33+
}
34+
```
35+
36+
where FieldType may be str, bool, int, or float.

.github/pull_request_template.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ Link a pivotal ticket here
1717
## Documentation
1818

1919
- Are documentation updates required? In-line, README, or [documentation](https://github.com/BciPy/bcipy.github.io)? Verify the updates you did here.
20+
21+
## Changelog
22+
23+
- Is the CHANGELOG.md updated with your detailed changes?

.github/workflows/main.yml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: BciPy
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- '**'
13+
14+
jobs:
15+
build-ubuntu:
16+
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: [3.7, 3.8]
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install dependencies
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install libgtk-3-dev
33+
sudo apt-get install freeglut3-dev
34+
sudo apt-get install freetype*
35+
sudo apt-get install portaudio*
36+
sudo apt-get install libsndfile*
37+
sudo apt-get install xvfb
38+
python -m pip install --upgrade pip
39+
pip install -r dev_requirements.txt
40+
pip install -e .
41+
- name: Lint with flake8
42+
run: |
43+
# stop the build if there are Python syntax errors or undefined names
44+
flake8 bcipy
45+
- name: Unit test
46+
if: always()
47+
run: |
48+
set +e
49+
xvfb-run coverage run --branch --source=bcipy -m pytest --mpl -k "not slow"
50+
if [ $? -eq 0 ]
51+
then
52+
echo "Ubuntu run complete!"
53+
elif [ $? -eq 134 ]
54+
then
55+
echo "Ubuntu tests run successfully, memory issues may be present"
56+
exit 0
57+
else
58+
echo "Ubuntu test failure"
59+
fi
60+
61+
build-windows:
62+
63+
runs-on: windows-latest
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
python-version: [3.7, 3.8]
68+
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Set up Python ${{ matrix.python-version }}
72+
uses: actions/setup-python@v2
73+
with:
74+
python-version: ${{ matrix.python-version }}
75+
- name: Install dependencies
76+
run: |
77+
python -m pip install --upgrade pip
78+
pip install -r dev_requirements.txt
79+
pip install -e .
80+
- name: Lint with flake8
81+
run: |
82+
# stop the build if there are Python syntax errors or undefined names
83+
flake8 bcipy
84+
- name: Unit test
85+
if: always()
86+
run: |
87+
coverage run --branch --source=bcipy -m pytest --mpl -k "not slow"
88+
89+
build-macos:
90+
91+
runs-on: macos-latest
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
python-version: [3.7, 3.8]
96+
97+
steps:
98+
- uses: actions/checkout@v2
99+
- name: Set up Python ${{ matrix.python-version }}
100+
uses: actions/setup-python@v2
101+
with:
102+
python-version: ${{ matrix.python-version }}
103+
- name: Install dependencies
104+
run: |
105+
python -m pip install --upgrade pip
106+
pip install -r dev_requirements.txt
107+
pip install -e .
108+
- name: Lint with flake8
109+
run: |
110+
# stop the build if there are Python syntax errors or undefined names
111+
flake8 bcipy
112+
- name: Unit test
113+
if: always()
114+
run: |
115+
coverage run --branch --source=bcipy -m pytest --mpl -k "not slow"

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
data/
99
# Virtualenv
1010
venv/
11+
venv*/
1112
__pycache__/
1213
.cache/
1314

@@ -23,6 +24,5 @@ htmlcov/
2324
bcipy.egg-info/
2425
build/
2526
dist/
26-
.bcipy/*
2727

28-
bcipy/parameters/parameters_*
28+
bcipy/parameters/parameters_*

CHANGELOG.md

+94-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,106 @@
1+
# 2.0.0-rc.1
2+
3+
## Contributions
4+
5+
This version contains major refactoring efforts and features. We anticipate a few additional refactor efforts in the near term based on feature requests from the community and (CAMBI)[cambi.tech]. These will support multi-modality, data sharing, and more complex language modeling. We are utilizing a release candidate to make features and bugfixes available sooner despite the full second version being in-progress. Thank you for your understanding and continued support! All pull requests in Github from #123 until #217 represent the 2.0.0-rc.1 work.
6+
7+
The highlights:
8+
9+
- `Acquisition Enhancements`: multi-modal support and better performance overall! #171, #174
10+
- `Language Model Refactor`: deprecation of docker base models. Addition of `LanguageModel` base class, `UniformLanguageModel` and a hugggingface model `GPT2LanguageModel`. #207
11+
- `Signal Model Refactor`: Refactor with base class definitions and general cleanup. PcaRdaKde model updates to decrease training time and limit the magnitude of likelihood responses. #132, #140, #141, #147, #208
12+
- `Matrix Display: SCP`: A single character flash Matrix speller is now integrated. A `MatrixDisplay` and accompanying `MatrixCalibration` + `Matrix Time Test Calibration`. #192, #205, #213
13+
- `Inquiry Preview`: a mode in RSVP spelling that allows a user to see an inquiry before it is presented in a serial fashion. The user may also engage with the preview using a key press; either to confirm or skip an inquiry. See below for more details.
14+
- `GUI updates`: all BciPy core GUIs and methods are converted to PyQt5 for better cross-platform availability and tooling. See below for more details.
15+
- `Linux compatibility`: with the upgrading of dependencies and a helpful shell script (see `scripts/shell/linux_requirements.sh`) for setting up new machines, we are linux compatible. See below for more details.
16+
- `Prestimulus buffer and Inquiry Based Training` - support to add prestimulus data to reshaping and data queries to permit better filter application. Additionally, use this buffer and the inquiry reshaper to mimic data experienced in real time during training in offline_analysis.py #208
17+
18+
The details (incomplete, our apologies!):
19+
20+
### Added
21+
22+
- `Makefile`: `run-with-defaults` make command for running `bcipy` and `viewer` command for running the data viewer #149
23+
- `.bcipy/README.md`: describes experiments and fields in greater detail #156
24+
- `signal/process/filter.py`: add `Notch` and `Bandpass` as classes #147
25+
- `signal/process/transform.py`: add `Composition`, `Downsample`, and `get_default_transform` #147
26+
- `helpers/visualization.py`: moved plot_edf function from demo to this module #126
27+
- `helpers/raw_data.py`: module for raw data format support in BciPy #160
28+
- `helpers/load.py`: add `load_users` method for extracting user names from data save location #125 add extract_mode method for determining the mode #126
29+
- `helpers/task/`: add `Reshaper`, refactor trial reshaper and add inquiry reshaper #147 add `get_key_press` method with custom stamp argument. #129
30+
- `helpers/stimuli.StimuliOrder`: defined ordering of inquiry stimuli. The current approach is to randomize. This adds an alphabetical option. #153
31+
- `helpers/stimuli.alphabetize`: method for taking a list of strings and returning them in alphabetical order with characters last in the list. #153
32+
- `helpers/validate`: `_validate_experiment_fields` and `validate_experiments`: validates experiments and fields in the correct format #156
33+
- `bcipy/helpers/system_utils`: add report execution decorator #163
34+
- `scripts/shell/linux_requirements.sh`: add script for installing necessary dependencies on linux systems #167
35+
- `.github/workflows/main.yml`: adds support for CI in BciPy #166
36+
- `bcipy/gui/file_dialog.py`: PyQt5 window for prompting for file locations #168
37+
- `display/paradigm/matrix`: added MatrixDisplay class with single-character presentation (SCP). #180
38+
39+
### Updated
40+
41+
- `LICENSE.md`: to used the Hippocratic license 2.1
42+
- `CODE_OF_CONDUCT.md`: to latest version of the Contributor Covenant
43+
- `README.md`: Add new glossary terms: mode, session and task #126 #127 and cleanup #129
44+
- `bcipy/main.py`: formally, `bci_main.py`. To give a better console entry point and infrastructure for integration testing. In the terminal, you can now run `bcipy` instead of `python bci_main.py`
45+
- `parameters.json`: add stim_order #153 add max selections #175 remove max_inq_per_trial in favor of max_inq_per_series #176 add inquiry preview #177 with relevant stimuli units in help text, better starting stim_height, and inquiry preview keys #216
46+
- `demo_stimuli_generation.py`: update imports and add a case showing the new ordering functionality. #153
47+
- `copy_phrase_wrapper`: update logging and exception handling. add stim order. #153 BUGFIX: return transformed sampling rate #159
48+
- `random_rsvp_calibration_inq_gen`: rename to `calibration_inquiry_generator` #153
49+
- `ExperimentField.py`: updated to use new alert types with timeouts #156
50+
- `ExperimentRegistry.py`: add the ability to toggle anonymization of field data and use new alert types with timeouts #156
51+
- `FieldRegistry.py`: updated to use new alert types with timeout #156
52+
- `gui/BCInterface.py`: use `load_users` method to populate user dropdown and remove internal BCInterface load method #125
53+
- `gui/gui_main.py`: update to return a value in FormInput, set a value for IntegerInput only if provided #156
54+
- `gui/viewer/data_viewer.py`: Replaced the original WxPython version of the signal data viewer with the new PyQt version #157. Use signal process filters instead of duplicating logic #147.
55+
- `gui/viewer/file_viewer.py`: to use new raw data format #160
56+
- `bcipy/acquisition`: refactored acquisition to support multi-modal acquisition and more performant real-time acquisition. These changes were significant and across multiple PRs. Support for new raw data format #160
57+
- `ring_buffer_test.py` -> `test_ring_buffer.py`: to comply with naming conventions #156
58+
- `signal/model/base_model.py`: add reshaper to base model class, requiring it to be defined in all models and return a `Reshaper`. Fix return types. #147
59+
- `signal/model/offline_analysis.py`: updated to use new reshapers and transforms. #147 updated to report execution time and logging levels #163
60+
- `bcipy/language_model/` --> `bcipy/language/` refactor for clarity and add base class `LanguageModel` #164
61+
- `bcipy/tasks` --> `bcipy/task`: refactor for clarity, add README, organize tasks under paradigm #162 organize tasks operation objects into `control` module #162 #178
62+
- `task/paradigm/rsvp/copy_phrase.py`: refactored overall #146 to use new Session classes #127 and updated to use new reshapers and transforms #147 implements current state of inquiry preview #129 #177 to account for max selection parameter #175 fix targetness #179
63+
- `bcipy/task/data.py`: to track number of decisions made #175
64+
- `task/control/handler.py`: added the ability to set constants in defined stimuli agent #178
65+
- `task/control/query.py`: remove redundant best_selection in favor of one with constants. Implemented constants in return_stimuli methods. #178
66+
- `display/rsvp/display.py`: refactored to use new trigger pulse and ensure it occurs only on first display call (whether that be `do_inquiry` or `preview_inquiry`) #149 Overall refactoring of properties into `StimuliProperties`, `InformationProperties`, `TaskDisplayProperties`. Added `PreviewInquiryProperties` and `preview_inquiry` kwarg. Add full-screen parameter to help with scaling stimuli. Add textbox to self.`_create_stimulus`. Add `preview_inquiry` and `_generate_inquiry_preview` methods. #129
67+
- `static/images/gui_images`: updated to `gui` and refactored where defined #149
68+
- `bcipy/display/main.py`: move `StimuliProperties`, `InformationProperties`, `TaskDisplayProperties` and `PreviewInquiryProperties` to higher level #180
69+
70+
71+
- `helpers/stimuli.py `: refactored for clarity and add `get_fixation` method #149 glossary updates and remove unneeded code #178 fix targetness in copy phrase #179
72+
- `helpers/triggers.py`: refactored `_calibration_trigger for clarity` and add `CalibrationType`(deprecating sound and adding text) #149 add an offset correction method #126
73+
- `helpers/load.py`: updated to use new raw data format #160
74+
- `helpers/convert.py`: mode, write_targetness, and annotation_channels keyword arguments #126 add compression/decompression support for experiments and BciPy session data #173
75+
- `helpers/session.py`: refactored session helpers to use the new Session data structures. #127
76+
- `helpers/exceptions`: refactored Field and Experiment exceptions to corresponding base exception #156
77+
- `feedback/auditory_feedback`: to allow for easier setting of relevant parameters and testing #128
78+
- `feedback/visual_feedback`: deprecate shape feedback type, line_color (in the administer method), and compare assertion as both were unused and added unneeded complexity. Set hard-coded values on the class instance for easier changing later. #128
79+
80+
### Removed
81+
82+
- `target_rsvp_inquiry_generator`: #153 unused
83+
- `rsvp_copy_phrase_inq_generator`: #153 unused
84+
- `tasks/rsvp/icon_to_icon.py`: #129 unused
85+
- `tasks/rsvp/calibration/inter_inquiry_feedback_calibration.py`: unused
86+
- `generate_icon_match_images`: #153 deprecated task
87+
- `signal/process/demo/text_filter_demo.py`: #147 removes old matlab generated filter
88+
- `signal/process/filter/resources/filters.txt`: #147 in favor of new filters and transforms
89+
- `signal/process/filter/notch.py`: #147 in favor of new filters and transforms
90+
- `signal/process/filter/downsample.py`: #147 in favor of new filters and transforms
91+
- `signal/process/filter/bandpass.py`: #147 in favor of new filters and transforms
92+
193
# 1.5.0
294

395
## Contributions
496

5-
This version contains major refactoring and tooling improvements across the codebase. In addition, it indtrocudes the concept of BciPy Experiments and Fields. Below we describe the major changes along with a PR# in github where applicable.
97+
This version contains major refactoring and tooling improvements across the codebase. In addition, it introduces the concept of BciPy Experiments and Fields. Below we describe the major changes along with a PR# in github where applicable.
698

799
### Added
8100
- Language model histogram #91
9101
- BciPy official glossary (Sequence -> Inquiry & Epoch -> Series) #121
10102
- System information to `system_utils` (cpu, platform, etc) #98
11-
- BciPy Experiments and Fields: See PRs #113 #111 and #114 for more information on the additions!
103+
- BciPy Experiments and Fields: See PRs #113 #111, #114 for more information on the additions!
12104
- `.bcipy` system directory to support experiment and fields #100
13105
- support for python 3.7
14106
- `rsvp/query_mechanisms`: to model the way we build inquiries #108

0 commit comments

Comments
 (0)