![](https://secure.gravatar.com/avatar/51040b16bc3fe1e094f14bd3a2d52aec.jpg?s=120&d=mm&r=g)
Sebastian Berg wrote:
On Fri, 2022-08-19 at 23:56 +0000, lpsmith@uw.edu wrote:
Thanks for the information! I've had to work on other project in the meantime, but was able to get back to this again. In an effort to wrap my head around the project's code, I realized that I did not have a line like: #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION in it. So, I added the line, fixed the errors the resulted, and recompiled. And immediately got segmentation faults.
With it, the fields are hidden completely which is the intention. But that also means the size is wrong for subclassing. You would have to use `PyArrayObject_fields` although that basically circumvents the deprecation, it somehwat makes sense, you should just only use it in that one place I guess (not for actual access to strides). Overall, I am not sure if this will ever help us much, but the solution seems simple here. There should be no fundamental changes with the exception of the size of `PyArrayObject_fields`.
That does clear up some things, but it also confuses me in other ways. The fields in question are fields I've added myself as part of the subclass. Are you saying that if I add new fields, those fields are hidden completely? I don't see how I could interact with them at all if that's the case, so I must be misunderstanding something. Among other things, the printing routines need access to them so they can print labels in addition to the values. So it's not just 'checking the size' that's the issue; I also need to be able to set, modify, and read out their values. The core fields could remain hidden (accessible through the normal routines for the class) but the new fields surely wouldn't be? -Lucian