From 4ccfd41ab76a46967db88af2dbdfdde141eccb7f Mon Sep 17 00:00:00 2001 From: Tanya Agarwal Date: Sun, 8 Oct 2023 16:58:17 +0530 Subject: [PATCH 1/5] Bug Fix 11456: Duplicated parameters in @pytest.mark.parametrize --- changelog/11456.bugfix.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/11456.bugfix.rst diff --git a/changelog/11456.bugfix.rst b/changelog/11456.bugfix.rst new file mode 100644 index 000000000..a9fefec28 --- /dev/null +++ b/changelog/11456.bugfix.rst @@ -0,0 +1,6 @@ +In this, we propose a solution that ensures the generation of unique identifiers for ParameterSets in the make_unique_parameterset_ids method in Python.py class. It appends numeric suffixes to identifiers, ensuring uniqueness even when the original identifiers have digit endings. +If the id ends in a digit, make then new id f"{id}_{suffix}". If the new id is already in the set of seen ids, increment the suffix number and try again. This is sure to work, and even be fast in practice, because our maximum suffix is the number of duplicate ids we started with. + + + + From 1a534f2fcd860972e0fc7f5f3dd46f735026b35d Mon Sep 17 00:00:00 2001 From: Tanya Agarwal Date: Sun, 8 Oct 2023 16:59:38 +0530 Subject: [PATCH 2/5] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index f8c66cae9..3c23d2277 100644 --- a/AUTHORS +++ b/AUTHORS @@ -367,6 +367,7 @@ Tadek Teleżyński Takafumi Arakaki Taneli Hukkinen Tanvi Mehta +Tanya Agarwal Tarcisio Fischer Tareq Alayan Tatiana Ovary From db8beada6f0113ceda1b9a18b860c55e2d7ef5ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 11:31:36 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- changelog/11456.bugfix.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/changelog/11456.bugfix.rst b/changelog/11456.bugfix.rst index a9fefec28..06ddea229 100644 --- a/changelog/11456.bugfix.rst +++ b/changelog/11456.bugfix.rst @@ -1,6 +1,2 @@ In this, we propose a solution that ensures the generation of unique identifiers for ParameterSets in the make_unique_parameterset_ids method in Python.py class. It appends numeric suffixes to identifiers, ensuring uniqueness even when the original identifiers have digit endings. If the id ends in a digit, make then new id f"{id}_{suffix}". If the new id is already in the set of seen ids, increment the suffix number and try again. This is sure to work, and even be fast in practice, because our maximum suffix is the number of duplicate ids we started with. - - - - From e354c9d2c7763d0dc56f3a54d9d5597a97196714 Mon Sep 17 00:00:00 2001 From: Tanya Agarwal Date: Sun, 8 Oct 2023 17:31:48 +0530 Subject: [PATCH 4/5] Bug Fix 11456: Duplicated parameters in @pytest.mark.parametrize --- testing/test_python.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 testing/test_python.py diff --git a/testing/test_python.py b/testing/test_python.py new file mode 100644 index 000000000..117571bc1 --- /dev/null +++ b/testing/test_python.py @@ -0,0 +1,11 @@ +import pytest + +@pytest.mark.parametrize("a", [1, 2, 10, 11, 2, 1, 12, 11,2_1]) +def test_params(a): + print('a:', a) + assert a > 0 + +@pytest.mark.parametrize("a", [1, 2, 10, 11, 2, 1, 12, 11]) +def test_params(a): + print('a:', a) + assert a > 0 From 87b25ec772edcd73a2b452b9fefe0e881439efec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 12:02:29 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- testing/test_python.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/testing/test_python.py b/testing/test_python.py index 117571bc1..4144dbf01 100644 --- a/testing/test_python.py +++ b/testing/test_python.py @@ -1,11 +1,13 @@ import pytest -@pytest.mark.parametrize("a", [1, 2, 10, 11, 2, 1, 12, 11,2_1]) + +@pytest.mark.parametrize("a", [1, 2, 10, 11, 2, 1, 12, 11, 2_1]) def test_params(a): - print('a:', a) + print("a:", a) assert a > 0 + @pytest.mark.parametrize("a", [1, 2, 10, 11, 2, 1, 12, 11]) def test_params(a): - print('a:', a) + print("a:", a) assert a > 0