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

ENH Add Array2::from_diag #673

Merged
merged 6 commits into from
Aug 2, 2019
Merged

Conversation

rth
Copy link
Contributor

@rth rth commented Jul 23, 2019

Adds a Array2::from_diag method to create 2D arrays from a diagonal.

Closes #672

src/impl_constructors.rs Outdated Show resolved Hide resolved
Copy link
Member

@jturner314 jturner314 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this; I've wanted this functionality in the past.

src/impl_constructors.rs Outdated Show resolved Hide resolved
tests/array.rs Show resolved Hide resolved
src/impl_constructors.rs Outdated Show resolved Hide resolved
Copy link
Member

@jturner314 jturner314 left a comment

Choose a reason for hiding this comment

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

I added one more comment. Everything else looks good.

src/impl_constructors.rs Show resolved Hide resolved
@rth
Copy link
Contributor Author

rth commented Jul 24, 2019

Thanks for the detailed review @jturner314 ! I added an example and panic conditions as you suggested.

The only remaining point is #673 (comment) that I'm not sure how to address. You previously marked it as resolved, so I don't know if some action is needed on my part.

Copy link
Member

@jturner314 jturner314 left a comment

Choose a reason for hiding this comment

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

Looks good to me; I just made one minor change. Thanks for this!

I'll merge this once CI passes.

@jturner314 jturner314 merged commit 5ad1afa into rust-ndarray:master Aug 2, 2019
@rth
Copy link
Contributor Author

rth commented Aug 2, 2019

Thanks again for the review @jturner314 !

@rth rth deleted the add-array2-from_diag branch August 2, 2019 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add from_diag constructor for Array2
2 participants