From 9a8a4f029c514cdab1704f4ad4591abe8a3c9479 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Fri, 26 Jan 2024 14:33:56 -0500 Subject: [PATCH] FIX: More --- .circleci/config.yml | 32 +++++++++---------- docs/source/examples/gen_examples.py | 8 ++++- .../configs/config_MNE_phantom_KIT_data.py | 2 +- mne_bids_pipeline/tests/datasets.py | 2 +- mne_bids_pipeline/tests/test_run.py | 4 ++- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d1e4f1b80..2a44484e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -297,23 +297,23 @@ jobs: paths: - ~/mne_data/eeg_matchingpennies - cache_MNE-phantom-KIT-data: + cache_MNE_phantom_KIT_data: <<: *imageconfig steps: - attach_workspace: at: ~/ - restore_cache: keys: - - data-cache-MNE-phantom-KIT-data-1 + - data-cache-MNE_phantom_KIT_data-1 - bash_env - gitconfig # email address is needed for datalad - run: - name: Get MNE-phantom-KIT-data + name: Get MNE_phantom_KIT_data command: | - $DOWNLOAD_DATA MNE-phantom-KIT-data + $DOWNLOAD_DATA MNE_phantom_KIT_data - codecov/upload - save_cache: - key: data-cache-MNE-phantom-KIT-data-1 + key: data-cache-MNE_phantom_KIT_data-1 paths: - ~/mne_data/MNE-phantom-KIT-data @@ -785,7 +785,7 @@ jobs: paths: - mne_data/derivatives/mne-bids-pipeline/eeg_matchingpennies/*/*/*.html - test_MNE-phantom-KIT-data: + test_MNE_phantom_KIT_data: <<: *imageconfig steps: - attach_workspace: @@ -793,10 +793,10 @@ jobs: - bash_env - restore_cache: keys: - - data-cache-MNE-phantom-KIT-data-1 + - data-cache-MNE_phantom_KIT_data-1 - run: - name: test MNE-phantom-KIT-data - command: $RUN_TESTS MNE-phantom-KIT-data + name: test MNE_phantom_KIT_data + command: $RUN_TESTS MNE_phantom_KIT_data - codecov/upload - store_test_results: path: ./test-results @@ -804,12 +804,12 @@ jobs: path: ./test-results destination: test-results - store_artifacts: - path: /home/circleci/reports/MNE-phantom-KIT-data - destination: reports/MNE-phantom-KIT-data + path: /home/circleci/reports/MNE_phantom_KIT_data + destination: reports/MNE_phantom_KIT_data - persist_to_workspace: root: ~/ paths: - - mne_data/derivatives/mne-bids-pipeline/MNE-phantom-KIT-data/*/*/*.html + - mne_data/derivatives/mne-bids-pipeline/MNE_phantom_KIT_data/*/*/*.html test_ERP_CORE_N400: <<: *imageconfig @@ -1237,13 +1237,13 @@ workflows: - cache_eeg_matchingpennies <<: *filter_tags - - cache_MNE-phantom-KIT-data: + - cache_MNE_phantom_KIT_data: requires: - setup_env <<: *filter_tags - - test_MNE-phantom-KIT-data: + - test_MNE_phantom_KIT_data: requires: - - cache_MNE-phantom-KIT-data + - cache_MNE_phantom_KIT_data <<: *filter_tags - cache_ERP_CORE: @@ -1297,7 +1297,7 @@ workflows: - test_ds003392 - test_ds004229 - test_eeg_matchingpennies - - test_MNE-phantom-KIT-data + - test_MNE_phantom_KIT_data - test_ERP_CORE_N400 - test_ERP_CORE_ERN - test_ERP_CORE_LRP diff --git a/docs/source/examples/gen_examples.py b/docs/source/examples/gen_examples.py index 622c88597..e4cf259b6 100755 --- a/docs/source/examples/gen_examples.py +++ b/docs/source/examples/gen_examples.py @@ -144,6 +144,7 @@ def _gen_demonstrated_funcs(example_config_path: Path) -> dict: logger.warning(f"Dataset {dataset_name} has no HTML report.") continue + assert dataset_options_key in DATASET_OPTIONS, dataset_options_key options = DATASET_OPTIONS[dataset_options_key].copy() # we modify locally report_str = "\n## Generated output\n\n" @@ -200,13 +201,18 @@ def _gen_demonstrated_funcs(example_config_path: Path) -> dict: f"{fname.name} :fontawesome-solid-square-poll-vertical:\n\n" ) - assert sum(key in options for key in ("openneuro", "git", "web", "datalad")) == 1 + assert ( + sum(key in options for key in ("openneuro", "git", "web", "datalad", "mne")) + == 1 + ) if "openneuro" in options: url = f'https://openneuro.org/datasets/{options["openneuro"]}' elif "git" in options: url = options["git"] elif "web" in options: url = options["web"] + elif "mne" in options: + url = f"https://mne.tools/dev/generated/mne.datasets.{options['mne']}.data_path.html" # noqa: E501 else: assert "datalad" in options # guaranteed above url = "" diff --git a/mne_bids_pipeline/tests/configs/config_MNE_phantom_KIT_data.py b/mne_bids_pipeline/tests/configs/config_MNE_phantom_KIT_data.py index ef3347a53..78eea377d 100644 --- a/mne_bids_pipeline/tests/configs/config_MNE_phantom_KIT_data.py +++ b/mne_bids_pipeline/tests/configs/config_MNE_phantom_KIT_data.py @@ -6,7 +6,7 @@ study_name = "MNE-phantom-KIT-data" bids_root = "~/mne_data/MNE-phantom-KIT-data" -deriv_root = "~/mne_data/derivatives/mne-bids-pipeline/MNE-phantom-KIT-data" +deriv_root = "~/mne_data/derivatives/mne-bids-pipeline/MNE_phantom_KIT_data" task = "phantom" ch_types = ["meg"] diff --git a/mne_bids_pipeline/tests/datasets.py b/mne_bids_pipeline/tests/datasets.py index 7b3b40807..3460d90b4 100644 --- a/mne_bids_pipeline/tests/datasets.py +++ b/mne_bids_pipeline/tests/datasets.py @@ -123,7 +123,7 @@ class DATASET_OPTIONS_T(TypedDict, total=False): "sub-emptyroom/ses-20000101", ], }, - "MNE-phantom-KIT-data": { + "MNE_phantom_KIT_data": { "mne": "phantom_kit", }, } diff --git a/mne_bids_pipeline/tests/test_run.py b/mne_bids_pipeline/tests/test_run.py index a5b29140c..6db152acf 100644 --- a/mne_bids_pipeline/tests/test_run.py +++ b/mne_bids_pipeline/tests/test_run.py @@ -123,7 +123,9 @@ class _TestOptionsT(TypedDict, total=False): "config": "config_ERP_CORE.py", "task": "P3", }, - "MNE_phantom_KIT_data": {}, + "MNE_phantom_KIT_data": { + "dataset": "MNE_phantom_KIT_data", + }, }