Skip to content

Commit

Permalink
fix split strings (presumably from autoformatter) (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
drammock authored Jul 22, 2024
1 parent 41e641e commit 7bbec62
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 19 deletions.
4 changes: 1 addition & 3 deletions docs/source/examples/gen_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ def _gen_demonstrated_funcs(example_config_path: Path) -> dict:
assert "mne" in options
url = f"https://mne.tools/dev/generated/mne.datasets.{options['mne']}.data_path.html" # noqa: E501

source_str = (
f"## Dataset source\n\nThis dataset was acquired from " f"[{url}]({url})\n"
)
source_str = f"## Dataset source\n\nThis dataset was acquired from [{url}]({url})\n"

if "openneuro" in options:
for key in ("include", "exclude"):
Expand Down
1 change: 1 addition & 0 deletions docs/source/v1.9.md.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@
### :medical_symbol: Code health and infrastructure
- Use GitHub's `dependabot` service to automatically keep GitHub Actions up-to-date. (#893 by @hoechenberger)
- Clean up some strings that our autoformatter failed to correctly merge. (#965 by @drammock)
2 changes: 1 addition & 1 deletion mne_bids_pipeline/_config_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create_template_config(
config.append(line)

target_path.write_text("".join(config), encoding="utf-8")
message = f"Successfully created template configuration file at: " f"{target_path}"
message = f"Successfully created template configuration file at: {target_path}"
logger.info(**gen_log_kwargs(message=message, emoji="✅"))

message = "Please edit the file before running the pipeline."
Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/_config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_runs(
inclusion = set(runs).issubset(set(valid_runs))
if not inclusion:
raise ValueError(
f"Invalid run. It can be a subset of {valid_runs} but " f"got {runs}"
f"Invalid run. It can be a subset of {valid_runs} but got {runs}"
)
return runs

Expand Down
4 changes: 2 additions & 2 deletions mne_bids_pipeline/_import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def make_epochs(
try:
idx_keep = epochs.metadata.eval(metadata_query, engine="python")
except pandas.core.computation.ops.UndefinedVariableError:
msg = f"Metadata query failed to select any columns: " f"{metadata_query}"
msg = f"Metadata query failed to select any columns: {metadata_query}"
logger.warn(**gen_log_kwargs(message=msg))
return epochs

Expand Down Expand Up @@ -327,7 +327,7 @@ def _set_eeg_montage(
"""
montage = cfg.eeg_template_montage
if cfg.datatype == "eeg" and montage:
msg = f"Setting EEG channel locations to template montage: " f"{montage}."
msg = f"Setting EEG channel locations to template montage: {montage}."
logger.info(**gen_log_kwargs(message=msg))
raw.set_montage(montage, match_case=False, match_alias=True)

Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def setup_dask_client(*, exec_params: SimpleNamespace) -> None:
client.auto_restart = False # don't restart killed workers

dashboard_url = client.dashboard_link
msg = "Dask client dashboard: " f"[link={dashboard_url}]{dashboard_url}[/link]"
msg = f"Dask client dashboard: [link={dashboard_url}]{dashboard_url}[/link]"
logger.info(**gen_log_kwargs(message=msg, emoji="🌎"))

if exec_params.dask_open_dashboard:
Expand Down
4 changes: 1 addition & 3 deletions mne_bids_pipeline/_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ def _plot_time_by_time_decoding_scores_gavg(*, cfg, decoding_data):

# Only add the label once
if n_significant_clusters_plotted == 0:
label = (
f"$p$ < {cfg.cluster_permutation_p_threshold} " f"(cluster pemutation)"
)
label = f"$p$ < {cfg.cluster_permutation_p_threshold} (cluster pemutation)"
else:
label = None

Expand Down
4 changes: 1 addition & 3 deletions mne_bids_pipeline/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def __mne_bids_pipeline_failsafe_wrapper__(*args, **kwargs):
for k in ("subject", "session", "task", "run")
if k in kwargs
}
message = (
f"A critical error occurred. " f"The error message was: {str(e)}"
)
message = f"A critical error occurred. The error message was: {str(e)}"
log_info["success"] = False
log_info["error_message"] = str(e)

Expand Down
6 changes: 3 additions & 3 deletions mne_bids_pipeline/steps/preprocessing/_04_frequency_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def bandpass_filter(
) -> None:
"""Filter data channels (MEG and EEG)."""
if l_freq is not None and h_freq is None:
msg = f"High-pass filtering {run_type} data; lower bound: " f"{l_freq} Hz"
msg = f"High-pass filtering {run_type} data; lower bound: {l_freq} Hz"
elif l_freq is None and h_freq is not None:
msg = f"Low-pass filtering {run_type} data; upper bound: " f"{h_freq} Hz"
msg = f"Low-pass filtering {run_type} data; upper bound: {h_freq} Hz"
elif l_freq is not None and h_freq is not None:
msg = f"Band-pass filtering {run_type} data; range: " f"{l_freq}{h_freq} Hz"
msg = f"Band-pass filtering {run_type} data; range: {l_freq}{h_freq} Hz"
else:
msg = f"Not applying frequency filtering to {run_type} data."

Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/steps/sensor/_02_decoding_full_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def run_epochs_decoding(
"contrast",
"decoding",
*[
f"{_sanitize_cond_tag(cond_1)}" f"{_sanitize_cond_tag(cond_2)}"
f"{_sanitize_cond_tag(cond_1)}{_sanitize_cond_tag(cond_2)}"
for cond_1, cond_2 in cfg.contrasts
],
),
Expand Down
2 changes: 1 addition & 1 deletion mne_bids_pipeline/steps/sensor/_05_decoding_csp.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def _fmt_contrast(cond1, cond2, fmin, fmax, freq_range_name, tmin=None, tmax=Non
f_min = float(freq_bin[0])
f_max = float(freq_bin[1])
contrast_names.append(
f"{freq_range_name}\n" f"({f_min:0.1f}-{f_max:0.1f} Hz)"
f"{freq_range_name}\n({f_min:0.1f}-{f_max:0.1f} Hz)"
)
fig, caption, _ = _plot_full_epochs_decoding_scores(
contrast_names=contrast_names,
Expand Down

0 comments on commit 7bbec62

Please sign in to comment.