Skip to content

Commit

Permalink
ENH: Add overwrite (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Sep 12, 2024
1 parent de4ebbf commit efd19bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 2
version: 2.1
jobs:
build_docs:
docker:
- image: cimg/python:3.9.12
- image: cimg/python:3.12.6
steps:
# Get our data and merge with upstream
- checkout
- run: sudo apt update && sudo apt install graphviz-dev graphviz
- run: python -m pip install --quiet --upgrade --user pip
- run: python -m pip install --quiet --upgrade --user numpy scipy git+https://github.com/mne-tools/mne-python@main numpydoc sphinx sphinx_fontawesome sphinx_bootstrap_theme pygraphviz
- run: python -c "import mne; mne.sys_info()"
- run: python setup.py develop --user
- run: cd doc && make html
- run: python -m pip install --upgrade --user git+https://github.com/mne-tools/mne-python@main numpydoc sphinx sphinx_fontawesome sphinx_bootstrap_theme pygraphviz
- run: mne sys_info
- run: pip install -ve .
- run: make -C doc html

- store_artifacts:
path: doc/_build/html/
Expand All @@ -25,7 +25,7 @@ jobs:

deploy:
docker:
- image: cimg/python:3.9.12
- image: cimg/python:3.12.6
steps:
- add_ssh_keys:
fingerprints:
Expand Down Expand Up @@ -55,7 +55,6 @@ jobs:
git push origin main
workflows:
version: 2
build_and_deploy:
jobs:
- build_docs
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
actions:
patterns:
- "*"
10 changes: 8 additions & 2 deletions mnefun/_ssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,21 @@ def do_preprocessing_combined(p, subjects, run_indices):
print(' obtained %d epochs from %d events.' % (len(ecg_epochs),
len(ecg_events)))
if len(ecg_epochs) >= 20:
write_events(ecg_eve, ecg_epochs.events)
kwargs = dict()
if "overwrite" in get_args(write_events):
kwargs["overwrite"] = True
write_events(ecg_eve, ecg_epochs.events, **kwargs)
ecg_epochs.save(ecg_epo, **_get_epo_kwargs())
desc_prefix = 'ECG-%s-%s' % tuple(ecg_t_lims)
pr = compute_proj_wrap(
ecg_epochs, p.proj_ave, n_grad=proj_nums[0][0],
n_mag=proj_nums[0][1], n_eeg=proj_nums[0][2],
desc_prefix=desc_prefix, **proj_kwargs)
assert len(pr) == np.sum(proj_nums[0][::p_sl])
write_proj(ecg_proj, pr)
kwargs = dict()
if "overwrite" in get_args(write_events):
kwargs["overwrite"] = True
write_proj(ecg_proj, pr, **kwargs)
projs.extend(pr)
else:
_raise_bad_epochs(raw, ecg_epochs, ecg_events, 'ECG',
Expand Down

0 comments on commit efd19bb

Please sign in to comment.