<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<!-- BlackBerry Work Editable Body Start -->
<div style="direction: ltr;">
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
I hope this is the right place to post this.</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
<br>
</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
The numpy documentation talks about two methods for making ndarray-like objects, subclassing and dispatching, but it is not clear to me which one is most appropriate for which purpose. Can someone provide, or point me to, some guidance, about this? I’m particularly
interested in what happens if there are multiple layers of subclassing. Can you subclass from a subclass? Dispatch from a dispatch? Subclass from a dispatch and vice versa?</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
<br>
</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
My specific application is a pair of classes, SpectralArray and PhysicalArray that uses numpy.fft to provides a to_physical() and to_spectral() method, respectively, to simplify writing pseudo-spectral codes. Initially this will be serial, but the implementation
will eventually use a mechanism similar to mpi4py-fft to allow the arrays to be distributed. Further, it would be nice to be able to make the code interoperable with the cupy CUDA numpy implementation, so that the sub array on each MPI process could use GPU
accelerated FFTs.</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
<br>
</div>
<div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.3); direction: ltr;">
Advice? Thanks.</div>
<div style="direction: ltr;"><br>
</div>
</div>
<span style="font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 13.333333015441895px;">—</span><span style="font-family: Helvetica, Verdana, Arial, sans-serif; font-size: medium;"></span>
<div style="font-family: Helvetica, Verdana, Arial, sans-serif; -webkit-text-size-adjust: 110%;">
<span style="font-size: 13.333333015441895px;">Daniel M. Israel, Ph. D.</span><br style="font-size: 13.333333015441895px;">
<span style="font-size: 13.333333015441895px;">XCP-4: Methods & Algorithms</span><br style="font-size: 13.333333015441895px;">
<span style="font-size: 13.333333015441895px;">Mailstop F644</span><br style="font-size: 13.333333015441895px;">
<span style="font-size: 13.333333015441895px;">Los Alamos National Laboratory</span><br style="font-size: 13.333333015441895px;">
<span style="font-size: 13.333333015441895px;"><a href="tel:505%20665%205664" dir="ltr">505 665 5664</a></span></div>
<!-- BlackBerry Work Editable Body End -->
</body>
</html>