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

Deprecate convert(::Type{<:AbstractTriangular}, A::(Diagonal|Bidiagonal)) methods #17723

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Jul 30, 2016

An alternative to #17653 and #17656: Instead of revising/extending existing convert(::Type{<:AbstractTriangular}, A::(Diagonal|Bidiagonal)) methods, deprecate them.

Rationale: What convert(::Type{$(AnnotationType)}, $(StorageTypeInstance)) should in general do is not clear, and having such convert methods' behavior differ from that of the corresponding annotation types' constructors seems dubious. The convert(::Type{<:AbstractTriangular}, A::(Diagonal|Bidiagonal)) methods appear the only methods of this kind in Base, and they do not appear to be used in Base outside of these two lines (which equivalent constructor calls handle in this PR). So deprecating these particular methods might be wiser than extending / introducing more methods of this kind (at least till such methods' contract is better defined).

Ref. related discussion at #17656 (comment).

Thoughts? Best!

@andreasnoack
Copy link
Member

I agree that this seems to be the right thing to do.

@Sacha0
Copy link
Member Author

Sacha0 commented Jul 31, 2016

I agree that this seems to be the right thing to do.

Cheers, closing the other two PRs then. Thanks!


for isupper in (true, false)
debug && println("isupper is $(isupper)")
A=Bidiagonal(a, [1.0:n-1;], isupper)
for newtype in [Bidiagonal, Tridiagonal, isupper ? UpperTriangular : LowerTriangular, Matrix]
for newtype in [Bidiagonal, Tridiagonal, Matrix]
debug && println("newtype is $(newtype)")
@test full(convert(newtype, A)) == full(A)
@test full(newtype(A)) == full(A)
Copy link
Contributor

Choose a reason for hiding this comment

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

should this line still be tested?

Copy link
Member Author

Choose a reason for hiding this comment

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

Depends. Bidiagonal(A)/convert(Bidiagonal, A) and Matrix(A)/convert(Matrix, A) test essentially the same code path, but Tridiagonal(A) tests a different code path from convert(Tridiagonal, A). If you feel exercising the latter path is worthwhile, then this line should remain; if not, it should disappear. Thoughts? Thanks!

@Sacha0
Copy link
Member Author

Sacha0 commented Aug 10, 2016

Rebased resolving deprecation conflict. Is this in good shape? Thanks!

@Sacha0
Copy link
Member Author

Sacha0 commented Aug 23, 2016

The Travis OS X failure seems unrelated. Is this in shape to merge? Thanks!

@tkelman
Copy link
Contributor

tkelman commented Aug 23, 2016

needs a rebase again

…ractTriangular. Remove tests of those convert methods.
@Sacha0
Copy link
Member Author

Sacha0 commented Aug 23, 2016

needs a rebase again

Sorry I missed the conflict indicator, and thanks for pointing it out! Rebased.

@Sacha0
Copy link
Member Author

Sacha0 commented Aug 23, 2016

The AV x86_64 failure seems unrelated (Exception running test pkg : [...] LoadError: GitError(Code:ERROR, Class:OS, Failed to receive response: The server returned an invalid or unrecognized response).

@tkelman
Copy link
Contributor

tkelman commented Aug 23, 2016

it even has a number #16555

@tkelman tkelman merged commit 7a0aee4 into JuliaLang:master Aug 25, 2016
@Sacha0
Copy link
Member Author

Sacha0 commented Aug 25, 2016

Thanks for reviewing / merging!

@Sacha0 Sacha0 deleted the depconvanno branch August 25, 2016 20:44
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
…ractTriangular. Remove tests of those convert methods. (JuliaLang#17723)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants