Skip to content

dtype "aligned" flag not respected by recarray. #5224

@NeilGirdhar

Description

@NeilGirdhar

As per my stackoverflow question:

import numpy as np
a = np.zeros(4, dtype=np.dtype([('t', '<f8'), ('d', [('a', '<i4'), ('b', '<f8')], (100,))], align=True))
b = np.require(a, requirements=['ALIGNED'])
print([x.flags['ALIGNED'] for x in [a, b]])

prints [False, False] !

@charris writes that "The recarray class accepts an aligned parameter, but looks to lose it in format_parser".

This bug breaks usage of PyOpenGL as per my other stackoverflow question.

As an aside why does "c-contiguous" imply "aligned" for recarray?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions