Skip to content

Commit 1a2f306

Browse files
committed
Count CPUs to set # of tabs
1 parent 2d01df8 commit 1a2f306

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/py/kaleido/_mocker.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import asyncio
5+
import multiprocessing
56
import sys
67
import time
78
import warnings
@@ -16,6 +17,8 @@
1617

1718
_logger = logistro.getLogger(__name__)
1819

20+
cpus = multiprocessing.cpu_count()
21+
1922
# Extract jsons of mocks
2023
test_dir = Path(__file__).resolve().parent.parent / "integration_tests"
2124
in_dir = test_dir / "mocks"
@@ -80,7 +83,12 @@ def _load_figures_from_paths(paths: list[Path]):
8083
help="Set the logging level (default INFO)",
8184
)
8285

83-
parser.add_argument("--n", type=int, default=4, help="Number of tabs, default 4")
86+
parser.add_argument(
87+
"--n",
88+
type=int,
89+
default=cpus,
90+
help="Number of tabs, defaults to # of cpus",
91+
)
8492

8593
parser.add_argument(
8694
"--input",

0 commit comments

Comments
 (0)