From d152f978aa57bc02945d5f8e91456981611696ab Mon Sep 17 00:00:00 2001 From: "c.winger" Date: Wed, 19 Jun 2024 07:00:25 +0200 Subject: [PATCH] offline opt: count only action --- offline_optimization_script.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/offline_optimization_script.py b/offline_optimization_script.py index 18e4fd06..86c80fa4 100644 --- a/offline_optimization_script.py +++ b/offline_optimization_script.py @@ -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) @@ -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) @@ -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))