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

Identifying routines internally by id instead of name #100

Merged
merged 12 commits into from
Oct 28, 2024
Merged
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespaces = false
# ignore = []

[tool.pytest.ini_options]
addopts = "--cov=badger/"
addopts = "--cov=src/badger/"
log_cli_level = "info"
log_level = "debug"
testpaths = ["src/badger/tests"]
8 changes: 4 additions & 4 deletions src/badger/actions/routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ def show_routine(args):
return

# List routines
if args.routine_name is None:
routines = list_routine()[0]
if args.routine_id is None:
routines = list_routine()[1]
if routines:
yprint(routines)
else:
print('No routine has been saved yet')
return

try:
routine, _ = load_routine(args.routine_name)
routine, _ = load_routine(args.routine_id)
if routine is None:
print(f'Routine {args.routine_name} not found')
print(f'Routine {args.routine_id} not found')
return
except Exception as e:
print(e)
Expand Down
2 changes: 1 addition & 1 deletion src/badger/core_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def run_routine_subprocess(
print(f"Error in subprocess: {type(e).__name__}, {str(e)}")

# set required arguments
routine, _ = load_routine(args["routine_name"])
routine, _ = load_routine(args["routine_id"])

# TODO look into this bug with serializing of turbo. Fix might be needed in Xopt
try:
Expand Down
Loading