Skip to content

Commit 604852c

Browse files
authored
Merge pull request #48 from cadenmyers13/commentv2
Add comment for `RuntimeWarning` surpression
2 parents 37fc5e5 + 46765cd commit 604852c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

news/test.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
**Fixed:**
1818

19-
* Surpress `RuntimeWarning` in tests for the `applycutoff` function
19+
* Surpress the `RuntimeWarning` in tests for the `applycutoff` function
2020

2121
**Security:**
2222

tests/integration_test.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ def test_applycutoff_range1(self):
105105
self.test_gui.qminentry.insert(0, "10")
106106
self.test_gui.qmaxentry.insert(0, "40")
107107

108-
# when
108+
# Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate
109+
# runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly
110+
# without warnings
109111
with warnings.catch_warnings():
110112
warnings.simplefilter("ignore", category=RuntimeWarning)
113+
# when
111114
self.test_gui.applycutoff()
112115
result = self.test_gui.cube
113116

@@ -121,9 +124,12 @@ def test_applycutoff_range2(self):
121124
self.test_gui.qminentry.insert(0, "15")
122125
self.test_gui.qmaxentry.insert(0, "35")
123126

124-
# when
127+
# Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate
128+
# runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly
129+
# without warnings
125130
with warnings.catch_warnings():
126131
warnings.simplefilter("ignore", category=RuntimeWarning)
132+
# when
127133
self.test_gui.applycutoff()
128134
result = self.test_gui.cube
129135

0 commit comments

Comments
 (0)