From 2ba4690e12c9beb08b6ad7e2602bf751e19dc413 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 2 Jul 2022 21:57:09 +0200 Subject: [PATCH] Minor fixes --- .github/workflows/publish.yaml | 4 ++-- setup.cfg | 2 +- src/great_ai/great_ai/tracing/add_ground_truth.py | 4 ++-- src/great_ai/utilities/parallel_map/parallel_map.py | 4 ++-- src/great_ai/utilities/parallel_map/threaded_parallel_map.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 33aae57..85e9d52 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.9.2 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: - python-version: 3.9.2 + python-version: 3.9 - name: Install pypa/build run: python -m pip install build --user diff --git a/setup.cfg b/setup.cfg index 10a561e..54aa8b9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = great-ai -version = 0.0.8 +version = 0.0.9 author = AndrĂ¡s Schmelczer author_email = andras@scoutinscience.com description = diff --git a/src/great_ai/great_ai/tracing/add_ground_truth.py b/src/great_ai/great_ai/tracing/add_ground_truth.py index 3702756..c98d2d1 100644 --- a/src/great_ai/great_ai/tracing/add_ground_truth.py +++ b/src/great_ai/great_ai/tracing/add_ground_truth.py @@ -20,8 +20,8 @@ def add_ground_truth( expected_outputs: Iterable[T], *, tags: List[str] = [], - train_split_ratio: float, - test_split_ratio: float, + train_split_ratio: float = 1, + test_split_ratio: float = 0, validation_split_ratio: float = 0 ) -> None: get_context() # this resets the seed diff --git a/src/great_ai/utilities/parallel_map/parallel_map.py b/src/great_ai/utilities/parallel_map/parallel_map.py index 555842b..54fc16b 100644 --- a/src/great_ai/utilities/parallel_map/parallel_map.py +++ b/src/great_ai/utilities/parallel_map/parallel_map.py @@ -88,8 +88,8 @@ def parallel_map( ctx = mp.get_context("spawn") ctx.freeze_support() - input_queue = ctx.Queue(0 if config.chunk_count is None else config.chunk_count) - output_queue = ctx.Queue(0 if config.chunk_count is None else config.chunk_count) + input_queue = ctx.Queue(config.concurrency * 2) + output_queue = ctx.Queue(config.concurrency * 2) should_stop = ctx.Event() processes = [ diff --git a/src/great_ai/utilities/parallel_map/threaded_parallel_map.py b/src/great_ai/utilities/parallel_map/threaded_parallel_map.py index 0ff8557..ae6e654 100644 --- a/src/great_ai/utilities/parallel_map/threaded_parallel_map.py +++ b/src/great_ai/utilities/parallel_map/threaded_parallel_map.py @@ -86,8 +86,8 @@ def threaded_parallel_map( ignore_exceptions=ignore_exceptions, ) - input_queue = queue.Queue(0 if config.chunk_count is None else config.chunk_count) - output_queue = queue.Queue(0 if config.chunk_count is None else config.chunk_count) + input_queue = queue.Queue(config.concurrency * 2) + output_queue = queue.Queue(config.concurrency * 2) should_stop = threading.Event() threads = [