Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate longer strings for unsized dtypes #2245

Merged
merged 1 commit into from Dec 1, 2019

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Nov 30, 2019

As proposed in #2229 (comment), we now do another little dance to get around Numpy's premature (in this case) allocation for strings of length one only. Closes #2229.

@Zac-HD Zac-HD added the bug something is clearly wrong here label Nov 30, 2019
@Zac-HD Zac-HD requested a review from rsokl November 30, 2019 08:29
@Zac-HD Zac-HD merged commit 96289c7 into HypothesisWorks:master Dec 1, 2019
result = np.zeros(
shape=self.array_size, dtype=object if unsized_string_dtype else self.dtype
)
print(self.dtype, result.dtype)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, seems like a debugging leftover :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, darn... thanks for spotting this, I'll open a fixup pr 😅

@Zac-HD Zac-HD mentioned this pull request Dec 1, 2019
@Zac-HD Zac-HD deleted the numpy-strings branch December 8, 2019 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hypothesis.extra.numpy only generates strings of length at most one
3 participants