Skip to content

Commit

Permalink
offline opt: count only action
Browse files Browse the repository at this point in the history
  • Loading branch information
wingechr committed Jun 19, 2024
1 parent 60c096e commit d152f97
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions offline_optimization_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def main(
loglevel: Literal["debug", "info", "warning", "error"] = "info",
index_from: int = None,
index_to: int = None,
count_only: bool = False,
):
cache_dir = Path(cache_dir)
cache_dir.mkdir(exist_ok=True)
Expand All @@ -113,6 +114,10 @@ def main(

param_sets = generate_param_sets(api)

if count_only:
print(f"Number of parameter variations: {len(param_sets)}")
return

# filter for batch
index_from = index_from or 0
index_to = index_to or len(param_sets)
Expand Down Expand Up @@ -212,6 +217,12 @@ def main(
type=int,
help="final index (exlusive) for prallel runs",
)
parser.add_argument(
"-n",
"--count_only",
action="store_true",
help="only print number of parameter variations and quit.",
)

args = parser.parse_args()
main(**vars(args))

0 comments on commit d152f97

Please sign in to comment.