Closed hodgestar closed 3 years ago
Just for clarity, the naming scheme I used is:
<opname>_<typename>
<opname>_<input_typename_1>_<input_typename_2>_[...]_<output_typename>
In general, these don't actually matter too much, because they're largely not intended for direct public use - you can just query the dispatcher object to get the correct specialisation. It mattered more for the two core classes, which also need to be able to be used from Cython, where the full dispatcher mechanisms are bypassed.
Is there any reason for the specialized construstors not to be named <constructor>_<typename>
?
E.g. diags_Dense
Is there any reason for the specialized construstors not to be named
<constructor>_<typename>
?
diags_cupydense
looks good to me -- let's use the convention everywhere.
As much as there is one, the reason they didn't have it was because in my first pass at writing things, the constructors weren't exposed outside of Cython, and they'd be accessed with qualified access by csr.diags
or dense.empty
, etc; they used proper namespacing rather than "C namespacing", since they weren't really going to be called by the same functions. With multiple dispatch, the single namespacing like that no longer makes sense.
This has been tackled in #10 . I am closing this one an opening one in QuTiP to change names.
Currently the specialization functions are named, e.g.,
cpd_add
. Existing QuTiP data layer specializations are named with the function name first, e.g.add_dense
.We should rename the CuPy specializations to, e.g.,
add_cupydense
.