GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve construction when inferring sub-array dtype (a.k.a. array subdtype) by eriknw · Pull Request #381 · python-graphblas/python-graphblas

Conversation

@eriknw

@eriknw eriknw commented Feb 3, 2023

Copy link
Copy Markdown
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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eriknw added 2 commits February 2, 2023 18:18
@eriknw
Improve construction when inferring sub-array dtype (a.k.a. array sub…
b7eeec5
…dtype)
@eriknw
Fix for numpy 1.21
8f8610f
@eriknw eriknw added bug Something is broken enhancement Improve existing functionality or make things work better labels Feb 3, 2023
@coveralls

coveralls commented Feb 3, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage: 99.496% (+0.09%) from 99.408% when pulling 4c6c925 on eriknw:better_subarray_support into e7a9a31 on python-graphblas:main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eriknw
And NumPy 1.22
e8ccd11
eriknw
eriknw commented Feb 3, 2023
View reviewed changes
Comment thread graphblas/core/matrix.py
# If we know the dtype, then using `np.fromiter` is much faster
dtype = lookup_dtype(dtype)
values = np.fromiter(iter_values, dtype.np_type)
if dtype.np_type.subdtype is not None and np.__version__[:5] in {"1.21.", "1.22."}:

@eriknw eriknw Feb 3, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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 as packaging.version.parse.

Also, CI testing of dependency versions FTW!

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
eriknw added 2 commits February 2, 2023 20:30
@eriknw
Fix test on Windows
258ceb1
@eriknw
Update versions in pre-commit
4c6c925
@eriknw

eriknw commented Feb 4, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eriknw
eriknw merged commit ed6f3ba into python-graphblas:main Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something is broken enhancement Improve existing functionality or make things work better

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@eriknw @coveralls
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.