Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
pypocketfft
Commits
9c252b21
Commit
9c252b21
authored
Oct 20, 2020
by
Peter Bell
Browse files
Handle keyword args in good_size
parent
8234f5c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
pypocketfft.cc
View file @
9c252b21
...
...
@@ -374,11 +374,13 @@ py::array genuine_hartley(const py::array &in, const py::object &axes_,
}
// Export good_size in raw C-API to reduce overhead (~4x faster)
PyObject
*
good_size
(
PyObject
*
/*self*/
,
PyObject
*
args
)
PyObject
*
good_size
(
PyObject
*
/*self*/
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
Py_ssize_t
n_
=
-
1
;
int
real
=
false
;
if
(
!
PyArg_ParseTuple
(
args
,
"n|p:good_size"
,
&
n_
,
&
real
))
char
*
keywords
[]
=
{
"target"
,
"real"
,
nullptr
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"n|p:good_size"
,
keywords
,
&
n_
,
&
real
))
return
nullptr
;
if
(
n_
<
0
)
...
...
@@ -687,7 +689,7 @@ const char * good_size_DS = R"""(Returns a good length to pad an FFT to.
Parameters
----------
n
: int
target
: int
Minimum transform length
real : bool, optional
True if either input or output of FFT should be fully real.
...
...
@@ -724,6 +726,7 @@ PYBIND11_MODULE(pypocketfft, m)
"out"
_a
=
None
,
"nthreads"
_a
=
1
);
static
PyMethodDef
good_size_meth
[]
=
{{
"good_size"
,
good_size
,
METH_VARARGS
,
good_size_DS
},
{
0
}};
{{
"good_size"
,
(
PyCFunction
)
good_size
,
METH_VARARGS
|
METH_KEYWORDS
,
good_size_DS
},
{
0
}};
PyModule_AddFunctions
(
m
.
ptr
(),
good_size_meth
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment