Skip to content

Commit 710406d

Browse files
committed
fixed docstring and comments
1 parent 28e429f commit 710406d

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

‎stumpy/sdp.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ def _make_pyfftw_sliding_dot_product(max_n=2**20, real_dtype="float64"):
136136
137137
Parameters
138138
----------
139-
max_n : int, default=2**20
139+
max_n : int, default 2**20
140140
Maximum length to preallocate arrays for. This will be the size of the
141141
real-valued array. A complex-valued array of size 1 + (max_n // 2)
142142
will also be preallocated. If inputs exceed this size, arrays will be
143143
reallocated to accommodate larger sizes.
144144
145-
real_dtype : str, default="float64"
145+
real_dtype : str, default "float64"
146146
The real data type to use for the preallocated arrays. Must be either
147147
"float64" or "longdouble". The complex data type will be set to
148148
"complex128" or "clongdouble", respectively.

‎tests/test_sdp.py‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ def test_pyfftw_sdp_max_n():
160160
if not sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover
161161
pytest.skip("Skipping Test pyFFTW Not Installed")
162162

163-
# When `len(T)` larger than `real_arr` in pyfftw_sdp,
164-
# the internal preallocated arrays should be resized.
165-
# This test checks that functionality.
163+
# When `len(T)` larger than original `max_n`,
164+
# the callable object returned by `_make_pyfftw_sliding_dot_product`
165+
# should still work correctly. This test checks that functionality.
166166

167167
max_n = 2**10
168168
_pyfftw_sliding_dot_product = sdp._make_pyfftw_sliding_dot_product(
169169
max_n=max_n, real_dtype="float64"
170170
)
171171

172-
# len(T) > max_n to trigger array resizing
172+
# len(T) > max_n to trigger internal array resizing
173173
T = np.random.rand(max_n + 1)
174174
Q = np.random.rand(2**2)
175175

@@ -185,7 +185,9 @@ def test_pyfftw_sdp_longdoube():
185185
if not sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover
186186
pytest.skip("Skipping Test pyFFTW Not Installed")
187187

188-
# This test checks that the pyfftw_sdp can be initialized with longdouble data type
188+
# This test checks that the callable object
189+
# returned by `_make_pyfftw_sliding_dot_product`
190+
# can support `real_dtype="longdouble"`
189191
max_n = 2**10
190192
sdp_func = sdp._make_pyfftw_sliding_dot_product(max_n, real_dtype="longdouble")
191193

@@ -204,8 +206,9 @@ def test_pyfftw_sdp_multithreaded():
204206
if not sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover
205207
pytest.skip("Skipping Test pyFFTW Not Installed")
206208

207-
# This test checks that the pyfftw_sdp can be initialized
208-
# with multiple threads
209+
# This test checks that the callable object
210+
# returned by `_make_pyfftw_sliding_dot_product`
211+
# can support multithreading.
209212
T = np.random.rand(2**5)
210213
Q = np.random.rand(2**4)
211214

@@ -221,8 +224,9 @@ def test_pyfftw_sdp_multithreaded_longdouble():
221224
if not sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover
222225
pytest.skip("Skipping Test pyFFTW Not Installed")
223226

224-
# This test checks that the pyfftw_sdp can be initialized
225-
# with multiple threads and longdouble data type
227+
# This test checks that the callable object
228+
# returned by `_make_pyfftw_sliding_dot_product`
229+
# can support multithreading and `real_dtype="longdouble"`
226230
max_n = 2**10
227231
sdp_func = sdp._make_pyfftw_sliding_dot_product(max_n, real_dtype="longdouble")
228232

0 commit comments

Comments
 (0)