Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing string concatenations with f-strings #225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def str2bool(v):
)
default_args = default_trainer_args()
for key in default_args:
parser.add_argument("--" + key, default=default_args[key])
parser.add_argument(f"--{key}", default=default_args[key])
return parser


Expand Down Expand Up @@ -582,7 +582,7 @@ def init_wandb(save_dir, opt, config, group_name, name_str):
nowname = _tmp[-1]
else:
if opt.name:
name = "_" + opt.name
name = f"_{opt.name}"
elif opt.base:
if opt.no_base_name:
name = ""
Expand All @@ -600,7 +600,7 @@ def init_wandb(save_dir, opt, config, group_name, name_str):
] # cut away the first one (we assert all configs are in "configs")
cfg_name = os.path.splitext(os.path.split(opt.base[0])[-1])[0]
cfg_name = "-".join(cfg_path) + f"-{cfg_name}"
name = "_" + cfg_name
name = f"_{cfg_name}"
else:
name = ""
if not opt.no_date:
Expand Down