From 3b298672f79f4a079c49a79b66b2b790a3784a2f Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 30 Oct 2024 10:25:04 -0400 Subject: [PATCH 1/7] add comment --- tests/integration_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index f9cb74a..aa144f3 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -121,7 +121,7 @@ def test_applycutoff_range2(self): self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - # when + # surpressed RuntimeWarning so warning isn't generated when test encounters slice of all NaNs with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) self.test_gui.applycutoff() From d371bfe96ea8046c75d2c1ab5edd97b5d340c054 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 30 Oct 2024 10:27:11 -0400 Subject: [PATCH 2/7] edit to news item --- news/test.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/test.rst b/news/test.rst index 225407f..dcd07f1 100644 --- a/news/test.rst +++ b/news/test.rst @@ -16,7 +16,7 @@ **Fixed:** -* Surpress `RuntimeWarning` in tests for the `applycutoff` function +* Surpress the `RuntimeWarning` in tests for the `applycutoff` function **Security:** From 4b551bcde6ce51663e49c66c7e533faa1a549427 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 30 Oct 2024 10:32:52 -0400 Subject: [PATCH 3/7] add comment to other test --- tests/integration_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index aa144f3..1950987 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -105,9 +105,10 @@ def test_applycutoff_range1(self): self.test_gui.qminentry.insert(0, "10") self.test_gui.qmaxentry.insert(0, "40") - # when + # surpressed RuntimeWarning so warning isn't generated when test encounters slice of all NaNs with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) + # when self.test_gui.applycutoff() result = self.test_gui.cube @@ -124,6 +125,7 @@ def test_applycutoff_range2(self): # surpressed RuntimeWarning so warning isn't generated when test encounters slice of all NaNs with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) + # when self.test_gui.applycutoff() result = self.test_gui.cube From 74e1401745d99b0e0cc2b0c5d87676d85f847c94 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Wed, 30 Oct 2024 16:48:29 -0400 Subject: [PATCH 4/7] small tweak to comments by simon --- tests/integration_test.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index 1950987..54b1141 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -105,7 +105,8 @@ def test_applycutoff_range1(self): self.test_gui.qminentry.insert(0, "10") self.test_gui.qmaxentry.insert(0, "40") - # surpressed RuntimeWarning so warning isn't generated when test encounters slice of all NaNs + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate runtimewarnings when it + # encounters slices that are all nans. capture these so tests pass cleanly without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) # when @@ -121,8 +122,9 @@ def test_applycutoff_range2(self): self.test_gui.cube = self.test_sofq self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - - # surpressed RuntimeWarning so warning isn't generated when test encounters slice of all NaNs + + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate runtimewarnings when it + # encounters slices that are all nans. capture these so tests pass cleanly without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) # when From 94d0089d481678d4be92527ee8152606518c5655 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:48:40 +0000 Subject: [PATCH 5/7] [pre-commit.ci] auto fixes from pre-commit hooks --- tests/integration_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index 54b1141..0fe6c9d 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -122,7 +122,7 @@ def test_applycutoff_range2(self): self.test_gui.cube = self.test_sofq self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly without warnings with warnings.catch_warnings(): From f1d2c228a0c3ebb6db619ce699e59780a4ee4d66 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Wed, 30 Oct 2024 16:50:46 -0400 Subject: [PATCH 6/7] pre-commit fixes --- tests/integration_test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index 0fe6c9d..3711cad 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -105,8 +105,9 @@ def test_applycutoff_range1(self): self.test_gui.qminentry.insert(0, "10") self.test_gui.qmaxentry.insert(0, "40") - # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate runtimewarnings when it - # encounters slices that are all nans. capture these so tests pass cleanly without warnings + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) # when @@ -123,8 +124,9 @@ def test_applycutoff_range2(self): self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate runtimewarnings when it - # encounters slices that are all nans. capture these so tests pass cleanly without warnings + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) # when From 46765cd1d3642681adcc778ac200b4ebc853c0ac Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:50:58 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit hooks --- tests/integration_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index 3711cad..214ce22 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -105,8 +105,8 @@ def test_applycutoff_range1(self): self.test_gui.qminentry.insert(0, "10") self.test_gui.qmaxentry.insert(0, "40") - # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate - # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning) @@ -124,8 +124,8 @@ def test_applycutoff_range2(self): self.test_gui.qminentry.insert(0, "15") self.test_gui.qmaxentry.insert(0, "35") - # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate - # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly + # Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate + # runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly # without warnings with warnings.catch_warnings(): warnings.simplefilter("ignore", category=RuntimeWarning)