Skip to content

Move non-function API from ndarrayobject.h into arraytypes.h (Trac #1481) #2078

Closed

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/1481 on 2010-05-08 by trac user abingham, assigned to unknown.

This change moves the parts of ndarrayobject.h that don't depend on the PY_ARRAY_UNIQUE_SYMBOL and NO_IMPORT into a new header, arraytypes.h. The intent of this change is to allow users to include the types, enums, etc. associated with arrays without needing to worry about the macro definitions.

Activity

  1. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Attachment added by trac user abingham on 2010-05-08: arraytype_h_addition.diff

  2. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    @charris wrote on 2010-05-09

    OK, I made this change in r8397-r8398 because I couldn't think of a good reason not to ;) However, I changed the header name to ndarraytypes.h because there is already an arraytypes.h buried down in numpy/core/src/multiarray and I thought best to avoid possible confusion. This change does separate out two different sorts of things, although I think the real culprit here is __multiarray_api.h. I'm not up to dealing with that, however, nor it's almost equally ugly cousin __ufunc_api.h. There should probably be completely different include files for the various varieties of include so that the choice of header corresponds to what is currently chosen with the various defines.

    Can you write up a short explanation of the use/need for this change so I can include it in the release notes? I could probably put that together from the mailing list thread but you can probably do a better job of it.

    Also feel free to improve the file if you have the time. The multiline comments need to be put in standard form, i.e.,

    /*

    • blah, blah
      */

    and it would be nice to collect all the includes up at the top so one could see the dependencies at a glance.

  3. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    @charris wrote on 2010-05-09

    Make that multiline thingie

    /*
     * blah, blah
     */
    
  4. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Attachment added by trac user abingham on 2010-05-09: ndarraytypes_cleaup.diff

  5. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    trac user abingham wrote on 2010-05-09

    Release note: ndarraytypes.h now contains the symbols from ndarrayobject.h that no not depend on the PY_ARRAY_UNIQUE_SYMBOL and NO_IMPORT/_ARRAY macros. Broadly, these symbols are types, typedefs, and enumerations; the array function calls are left in ndarrayobject.h. This allows users to include array-related types and enumerations without needing to concern themselves with the macro expansions and their side-effects.

  6. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    @charris wrote on 2010-05-09

    Nice. Applied in r8402, thanks.

  7. thouis commented on Oct 19, 2012

    @thouis
    ContributorAuthor

    Milestone changed to 1.6.0 by @mwiebe on 2011-05-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions