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

Nick/shape support #348

Merged
merged 8 commits into from
Dec 12, 2024
Merged

Nick/shape support #348

merged 8 commits into from
Dec 12, 2024

Conversation

ntjohnson1
Copy link
Collaborator

@ntjohnson1 ntjohnson1 commented Nov 16, 2024

This should make our shape arguments more flexible.
This provides machinery for simplifying when we want a vector (or scalar) of items. I didn't distinguish between an index array or a data array so technically this makes our typing slightly less specific. If that causes immediate concern can specify. Otherwise I think this is better since we were over constrained below (List[int] when really an iterable or numpy array of integers would be fine).

Mostly just a matter of defining the type, a parsing utility and pushing things through to make mpypy happy
Resolves #305 along the way.

I also realized we didn't set the flag to assert when vals or subs check failed. I turned the flag on but that required fixing some of the tutorial. Since this PR is all about making our interface nicer I think a follow up might be to make vals just be an arbitray OneDArray, I don't think we really need it to be a column array (or if we do we could probably adjust it internally).


📚 Documentation preview 📚: https://pyttb--348.org.readthedocs.build/en/348/

@ntjohnson1 ntjohnson1 marked this pull request as ready for review November 16, 2024 21:54
@ntjohnson1 ntjohnson1 requested a review from dmdunla November 18, 2024 21:30
@dmdunla dmdunla merged commit 5e1fddf into sandialabs:main Dec 12, 2024
9 checks passed
@dmdunla
Copy link
Collaborator

dmdunla commented Dec 12, 2024

@ntjohnson1 It looks like the regression tests passed when this PR was waiting to be merged, but then they failed due to mypy errors when the GitHub actions were run after the PR merge. I confused as to why that would happen. Perhaps I missed a step during the review and merge of the PR.

I now have broken the dev pipeline pyttb in two different ways today. Ugh!

@ntjohnson1 ntjohnson1 deleted the nick/shape_support branch December 12, 2024 21:03
@ntjohnson1
Copy link
Collaborator Author

Between when I posted my PR and you merged it a Numpy release came out which subtly improved their typing support. I fixed it in the other PR so we should be set for the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sptensor constructor breaks with int overflow for large tensor
2 participants