Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve construction when inferring sub-array dtype (a.k.a. array subdtype)#381

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@eriknw
Copy link
Member

This gives us an easy, consistent way to infer sub-array dtypes upon when constructing objects. Also, this handles more cases (I apparently missed some!). See tests for examples.

@eriknweriknw added bugSomething is broken enhancementImprove existing functionality or make things work better labelsFeb 3, 2023
@coveralls
Copy link

coveralls commentedFeb 3, 2023
edited
Loading

Coverage Status

Coverage: 99.496% (+0.09%) from 99.408% when pulling4c6c925 on eriknw:better_subarray_support intoe7a9a31 on python-graphblas:main.

# If we know the dtype, then using `np.fromiter` is much faster
dtype=lookup_dtype(dtype)
values=np.fromiter(iter_values,dtype.np_type)
ifdtype.np_type.subdtypeisnotNoneandnp.__version__[:5]in {"1.21.","1.22."}:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think this is the first time we actually use the version of a dependency. This way is pretty low-tech, and hopefully fine. If we need to do more version-dependent behavior, we'll probably want to use a helper utility such aspackaging.version.parse.

Also, CI testing of dependency versions FTW!

We can drop 1.21 in June, and 1.22 next January.

@eriknw
Copy link
MemberAuthor

eriknw commentedFeb 4, 2023
edited
Loading

I need this for another PR (#382), merging.

@eriknweriknw merged commited6f3ba intopython-graphblas:mainFeb 4, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

bugSomething is brokenenhancementImprove existing functionality or make things work better

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@eriknw@coveralls

[8]ページ先頭

©2009-2025 Movatter.jp