diff --git a/kymata/config/dataset3.yaml b/dataset_config/dataset3.yaml similarity index 100% rename from kymata/config/dataset3.yaml rename to dataset_config/dataset3.yaml diff --git a/kymata/config/dataset4.yaml b/dataset_config/dataset4.yaml similarity index 100% rename from kymata/config/dataset4.yaml rename to dataset_config/dataset4.yaml diff --git a/kymata/config/subject_name_recording_config (template).yaml b/dataset_config/subject_name_recording_config (template).yaml similarity index 100% rename from kymata/config/subject_name_recording_config (template).yaml rename to dataset_config/subject_name_recording_config (template).yaml diff --git a/invokers/invoker_create_trialwise_data.py b/invokers/invoker_create_trialwise_data.py index f470f0c5..40e08613 100644 --- a/invokers/invoker_create_trialwise_data.py +++ b/invokers/invoker_create_trialwise_data.py @@ -5,7 +5,7 @@ # noinspection DuplicatedCode def main(): - config = load_config(str(Path(Path(__file__).parent.parent, "kymata", "config", "dataset4.yaml"))) + config = load_config(str(Path(Path(__file__).parent.parent, "dataset_config", "dataset4.yaml"))) create_trialwise_data( dataset_directory_name=config['dataset_directory_name'], diff --git a/invokers/invoker_estimate_noise_cov_matrix.py b/invokers/invoker_estimate_noise_cov_matrix.py index c0f8570c..c8354062 100644 --- a/invokers/invoker_estimate_noise_cov_matrix.py +++ b/invokers/invoker_estimate_noise_cov_matrix.py @@ -6,7 +6,7 @@ # noinspection DuplicatedCode def main(): - config = load_config(str(Path(Path(__file__).parent.parent, "kymata", "config", "dataset4.yaml"))) + config = load_config(str(Path(Path(__file__).parent.parent, "dataset_config", "dataset4.yaml"))) if config['data_location'] == "local": data_root_dir = str(Path(Path(__file__).parent.parent, "kymata-toolbox-data", "emeg_study_data")) + "/" @@ -15,7 +15,7 @@ def main(): elif config['data_location'] == "cbu-local": data_root_dir = '//cbsu/data/imaging/projects/cbu/kymata/data/' else: - raise Exception("The 'data_location' parameter in the config file must be either 'cbu' or 'local' or 'cbu-local'.") + raise Exception("The 'data_location' parameter in the dataset_config file must be either 'cbu' or 'local' or 'cbu-local'.") estimate_noise_cov( data_root_dir = data_root_dir, emeg_machine_used_to_record_data = config['emeg_machine_used_to_record_data'], diff --git a/invokers/invoker_run_data_cleansing.py b/invokers/invoker_run_data_cleansing.py index 60af6f8f..a0b8388d 100644 --- a/invokers/invoker_run_data_cleansing.py +++ b/invokers/invoker_run_data_cleansing.py @@ -8,7 +8,7 @@ # noinspection DuplicatedCode def main(): - config = load_config(str(Path(Path(__file__).parent.parent, "kymata", "config", "dataset4.yaml"))) + config = load_config(str(Path(Path(__file__).parent.parent, "dataset_config", "dataset4.yaml"))) if config['data_location'] == "local": data_root_dir = str(Path(Path(__file__).parent.parent, "kymata-toolbox-data", "emeg_study_data")) + "/" @@ -17,7 +17,7 @@ def main(): elif config['data_location'] == "cbu-local": data_root_dir = '//cbsu/data/imaging/projects/cbu/kymata/data/' else: - raise Exception("The 'data_location' parameter in the config file must be either 'cbu' or 'local' or 'cbu-local'.") + raise Exception("The 'data_location' parameter in the dataset_config file must be either 'cbu' or 'local' or 'cbu-local'.") run_first_pass_cleansing_and_maxwell_filtering( data_root_dir = data_root_dir, diff --git a/invokers/invoker_run_hexel_current_estimation.py b/invokers/invoker_run_hexel_current_estimation.py index 119c7a1f..b1f8b4ae 100644 --- a/invokers/invoker_run_hexel_current_estimation.py +++ b/invokers/invoker_run_hexel_current_estimation.py @@ -8,7 +8,7 @@ # noinspection DuplicatedCode def main(): - config = load_config(str(Path(Path(__file__).parent.parent, "kymata", "config", "dataset4.yaml"))) + config = load_config(str(Path(Path(__file__).parent.parent, "dataset_config", "dataset4.yaml"))) if config['data_location'] == "local": data_root_dir = str(Path(Path(__file__).parent.parent, "kymata-toolbox-data", "emeg_study_data")) + "/" @@ -17,7 +17,7 @@ def main(): elif config['data_location'] == "cbu-local": data_root_dir = '//cbsu/data/imaging/projects/cbu/kymata/data/' else: - raise Exception("The 'data_location' parameter in the config file must be either 'cbu' or 'local' or 'cbu-local'.") + raise Exception("The 'data_location' parameter in the dataset_config file must be either 'cbu' or 'local' or 'cbu-local'.") # create_current_estimation_prerequisites(data_root_dir, config=config) diff --git a/invokers/run_gridsearch.py b/invokers/run_gridsearch.py index d38b93d8..e80f3cb5 100644 --- a/invokers/run_gridsearch.py +++ b/invokers/run_gridsearch.py @@ -63,7 +63,7 @@ def main(): args = parser.parse_args() # TODO: use config for ppt lists etc - #config = load_config(str(Path(Path(__file__).parent.parent, "kymata", "config", "dataset4.yaml"))) + #dataset_config = load_config(str(Path(Path(__file__).parent.parent, "dataset_config", "dataset4.yaml"))) participants = [ 'pilot_01', diff --git a/kymata/io/yaml.py b/kymata/io/yaml.py index b521ea01..db9bbcba 100644 --- a/kymata/io/yaml.py +++ b/kymata/io/yaml.py @@ -2,13 +2,13 @@ def load_config(config_location: str): - """Load config parameters""" + """Load dataset_config parameters""" with open(config_location, "r") as stream: return yaml.safe_load(stream) def modify_param_config(config_location: str, key: str, value): with open(config_location, 'r') as stream: - """Load config parameter""" + """Load dataset_config parameter""" data = yaml.safe_load(stream) data[key] = value yaml.emitter.Emitter.process_tag = lambda self, *args, **kw: None diff --git a/kymata/preproc/data_cleansing.py b/kymata/preproc/data_cleansing.py index ce2ecd2c..a9b85989 100755 --- a/kymata/preproc/data_cleansing.py +++ b/kymata/preproc/data_cleansing.py @@ -674,10 +674,10 @@ def apply_automatic_bad_channel_detection(raw_fif_data: mne.io.Raw, machine_used raw_check = raw_fif_data.copy() fine_cal_file = Path(Path(__file__).parent.parent, - 'config', 'cbu_specific_files', + 'kymata-toolbox-data', 'cbu_specific_files', 'sss_cal' + machine_used + '.dat') crosstalk_file = Path(Path(__file__).parent.parent, - 'config', 'cbu_specific_files', + 'kymata-toolbox-data', 'cbu_specific_files', 'ct_sparse' + machine_used + '.fif') auto_noisy_chs, auto_flat_chs, auto_scores = mne.preprocessing.find_bad_channels_maxwell( diff --git a/kymata/preproc/hexel_current_estimation.py b/kymata/preproc/hexel_current_estimation.py index 28cd2a1e..bef8ef9a 100644 --- a/kymata/preproc/hexel_current_estimation.py +++ b/kymata/preproc/hexel_current_estimation.py @@ -192,7 +192,7 @@ def create_forward_model_and_inverse_solution(data_root_dir, config: dict): elif config['eeg']: mne.write_forward_solution(Path(intrim_preprocessing_directory_name, "4_hexel_current_reconstruction","forward_sol_files", participant + '-fwd-eegonly.fif'), fwd) else: - raise Exception('eeg and meg in the config file cannot be both False') + raise Exception('eeg and meg in the dataset_config file cannot be both False') # Compute inverse operator