numpy/numpy-user-dtypes

`ssnewemptylen` failure when calling `arr.astype(StringDType())` for certain array sizes

peytondmurray opened this issue · 2 comments

Haven't had enough time to investigate yet, but I'm putting this here so I don't forget:

import numpy as np
from stringdtype import StringDType
import string

n = 1000
indices = np.random.randint(0, len(string.ascii_lowercase), size=(n, 10))
arr = np.array(
    ["".join([string.ascii_lowercase[i] for i in row]) for row in indices]
)

arr.astype(StringDType())

For n > 128 this fails with a MemoryError.

I believe this was fixed by #52. Can you pull from main and double-check this script works for you? It works for me over here on current main.

Closing since I'm pretty sure #52 fixed this, please reopen if it's still an issue for you.