Skip to content

Commit

Permalink
misc minor fixes (#1272)
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
sappelhoff authored Jul 12, 2024
1 parent 313fe10 commit f4f903a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018, The MNE-BIDS developers
Copyright (c) 2017, The MNE-BIDS developers
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@

# General information about the project.
project = "MNE-BIDS"
td = date.today()
copyright = "2017-%s, MNE Developers. Last updated on %s" % (td.year, td.isoformat())
today = date.today().isoformat()
copyright = f"2017, The MNE-BIDS developers. Last updated on {today}"

author = "MNE Developers"
author = "The MNE-BIDS developers"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinxext/gen_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def generate_cli_rst(app=None):
# Add code styling for the "Usage: " line
for li, line in enumerate(output):
if line.startswith("Usage: mne_bids "):
output[li] = "Usage: ``%s``" % line[7:]
output[li] = f"Usage: ``{line[7:]}``"
break

# Turn "Options:" into field list
Expand Down
8 changes: 4 additions & 4 deletions mne_bids/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def print_help():
print("Usage : mne_bids command options\n")
print("Accepted commands :\n")
for c in valid_commands:
print("\t- %s" % c)
print(f"\t- {c}")
print(
"\nExample : mne_bids raw_to_bids --subject_id sub01 --task rest",
"--raw_file data.edf --bids_root new_path",
Expand All @@ -35,12 +35,12 @@ def main():
elif "help" in sys.argv[1] or "-h" in sys.argv[1]:
print_help()
elif sys.argv[1] == "--version":
print("MNE-BIDS %s" % mne_bids.__version__)
print(f"MNE-BIDS {mne_bids.__version__}")
elif sys.argv[1] not in valid_commands:
print('Invalid command: "%s"\n' % sys.argv[1])
print(f'Invalid command: "{sys.argv[1]}"\n')
print_help()
sys.exit(0)
else:
cmd = sys.argv[1]
cmd_path = op.join(mne_bin_dir, "commands", "mne_bids_%s.py" % cmd)
cmd_path = op.join(mne_bin_dir, "commands", f"mne_bids_{cmd}.py")
sys.exit(subprocess.call([sys.executable, cmd_path] + sys.argv[2:]))
2 changes: 1 addition & 1 deletion mne_bids/dig.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def _write_coordsystem_json(
hpi = {d["ident"]: d for d in dig if d["kind"] == FIFF.FIFFV_POINT_HPI}
if hpi:
for ident in hpi.keys():
coords["coil%d" % ident] = hpi[ident]["r"].tolist()
coords[f"coil{ident:d}"] = hpi[ident]["r"].tolist()

fid_json = {
"MEGCoordinateSystem": sensor_coord_system,
Expand Down
2 changes: 1 addition & 1 deletion mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def test_fif(_bids_validate, tmp_path):
verbose=True,
overwrite=False,
)
bids_dir = op.join(bids_root, "sub-%s" % subject_id, "ses-%s" % session_id, "eeg")
bids_dir = op.join(bids_root, f"sub-{subject_id}", f"ses-{session_id}", "eeg")
sidecar_basename = bids_path.copy()
for sidecar in [
"channels.tsv",
Expand Down
2 changes: 1 addition & 1 deletion mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ def write_raw_bids(
"""
if not isinstance(raw, BaseRaw):
raise ValueError("raw_file must be an instance of BaseRaw, got %s" % type(raw))
raise ValueError(f"raw_file must be an instance of BaseRaw, got {type(raw)}")

if raw.preload is not False and not allow_preload:
raise ValueError(
Expand Down

0 comments on commit f4f903a

Please sign in to comment.