[Development] submitting a multi-dimensional container class for Qt: QNDArray

Glen Mabey glen.mabey at swri.org
Sat Mar 2 01:03:39 CET 2013


On Wednesday 9 January 2013 Thiago Macieira wrote:
> I'm not sure it's out of scope for Qt. In fact, I don't know yet whether it
> should be part of Qt Core or not. I guess I am the person to make that
> particular call.
> So what I need from Glen is, at least, the proposed API docs with some
> proposed examples of how it will work.
> I need to review that to decide whether it fits Qt Core's purpose in life.


> To be accepted in QtCore, the contribution must be of a handful[*] of files in
> src/corelib/tools, including the documentation, with examples in examples/,
> tests in tests/auto/corelib/tools/qndarray.
> [*] by "handful", I mean it literally: counted with the fingers of one hand.
> And I do not mean binary counting (2⁵ = 32 files).

Yes, well there certainly are still quite a few files in this patch (perhaps it's more like a new shed than a patch), although I *have* consolidated several files together in the commit that I made a few minutes ago.

I suppose that when I first brought up this concept, many of you envisioned a single header file and one or two .cpp files.  That's funny because it's the same thing *I* envisioned when I started working on this effort some number of years ago.  ;-)

I didn't think it would be that hard to replicate in C++ the basic operations ("yeah, I'll just stick with the basic operations, and it won't be too bad or take too long") available on numpy.ndarray class instances -- you've got to keep track of shape and strides, index appropriately, and provide a few mathematical operations.  Famous last words.

Anyway, as I contemplated Thiago's formal request for API docs, I concluded that this effort has become complicated enough that a quick cursory explanation would not do justice to the complexity of the implementation.  At least, I think that the code has gotten progressively complicated, in order to cover the basic modes of operation that numpy provides.  And without an ernest explanation of how it all fits together, I think that I would continue to meet with "this patch is way to big" or "this patch has way too many files" or "I don't understand why you're submitting this to Qt".  

Now, I realize that there are situations where these answers are valid reasons for rejecting a patch, and I'm under no illusion that my efforts might yet be excluded from Qt; my current objective is still to just explain what I've done.

To that end, I began formalizing the documentation into real .qdoc files (no, it's not finished yet -- it's still a WIP).  Most notably, I have pushed numeric.qdoc which gives an explanation "from the very beginning" and tries to define all of the QNDArray-specific terms for the user (actually, they are numpy terms).

So, I sincerely hope that several of you on this list will build and read the docs I have written -- I look forward to hearing what you think.

Best Regards,
Glen Mabey

P.S. Yes, I have pushed these files to the dev branch prior to the cutoff date for 5.1, but no, I do not intend to request that it be merged for the 5.1 release -- it's still a WIP.
P.P.S. Yes, I am certainly open to consolidating more of the source files -- I am very happy to receive specific feedback on this issue.

More information about the Development mailing list