-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
doc: add factorizations docstrings #31284
doc: add factorizations docstrings #31284
Conversation
I'll leave it at the three factorizations, and continue once we agree on the style of the docstrings. |
Thank you so much for adding to the docs! This is so useful and deeply appreciated. ❤️ |
""" | ||
BunchKaufman <: Factorization | ||
|
||
Matrix factorization type of the Bunch-Kaufman factorization of a `Symmetric` or |
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.
Can we x-ref Symmetric
and/or Hermitian
here?
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.
Sure.
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.
Actually, I realized that this may be misleading. What you need is that the matrix is numerically symmetric or Hermitian, it doesn't have to be of Symmetric
or Hermitian
type. I'd suggest to type these expressions as regular text rather than as code
. That's how it's done in cholesky as well.
Might be nice to include showing how access specific factors of the factorization in the examples? |
I (now) agree. Accessing the factors is related to the return type, not necessarily to the factorization function. So, I'll add information on the factors in the docstring, and copy also the related code from the examples in the factorization functions. |
I also noticed that I appended |
Alright, I couldn't stop myself finishing all factorizations. I have consistently appended the supertype information, and added (i.e. copied) how to access the individual factors. Since the types are going to appear in the manual right above the corresponding factorization functions, there will be quite some redundancy there, but otherwise I think this is helpful information. Otherwise, one would have to explicitly refer the user to the docstrings of the factorization functions for access info. With this, I'm sort of done on my end, happily awaiting review and feedback. |
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.
This is great work. Just a minor comment to the Bunch-Kaufman docstring.
BunchKaufman <: Factorization | ||
|
||
Matrix factorization type of the Bunch-Kaufman factorization of a symmetric or | ||
Hermitian matrix `A` as ``P'*U*D*U'*P`` or ``P'*L*D*L'*P``, depending on |
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.
It's a bit more general since it can also factorize complex symmetric matrices in which case it should be transpose
and not '
.
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.
Since this is in math mode, can I use P^\\top
or P^T
? Or should I turn it simply into code mode and use transpose
? That mixture of code and math looks a bit weird anyway. Normally, we wouldn't write the *
in math mode, would we?
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 missed to adopt the corresponding parts from the bunchkaufman
docstring, because I initially felt that this relates more to the factorization function, and less to the factorization type (see above). But I agree that this should be mentioned, and I have added it. I also turned the math type into code type, and did the same to the factorization function docstring. There, I also changed the wording slightly, to reflect the fact that the matrix should be symmetric/Hermitian, not necessarily of Symmetric
or Hermitian
type. I hope that with the added doctest example, the issue with the stored triangle and the wrapping by the special types becomes clearer.
CI says it can't find some of the references, but I have no idea why. The referenced types/commands have not been touched in this PR, and they do have docstrings. |
This is ready for review. All docstrings are written and included in the package documentation page. CI failure seems to be unrelated, AFAICT. |
Bump. I'd love to get rid of my open doc PRs. 😄 |
Seems to have an unusually large number of CI failures... |
I know, but I couldn't relate the failures to my docstrings. :-( |
@staticfloat, should I be worried about any of these |
The failures show me that this branch hasn't been rebased on top of |
Oho, do I simply need to do (when in this branch)
or is this going to affect my changes? Hopefully, I will only need to resolve potential merge conflicts...? |
What I like to do is |
Sorry, I messed up a bit. I tried @staticfloat 's suggestion first, but git was complaining. Then I went on with my own guess, but I guess I should have force-pushed, and not just pushed (I pushed the button in Atom). Now |
Codecov Report
@@ Coverage Diff @@
## master #31284 +/- ##
==========================================
- Coverage 81.35% 81.34% -0.01%
==========================================
Files 372 372
Lines 63035 63035
==========================================
- Hits 51283 51278 -5
- Misses 11752 11757 +5
Continue to review full report at Codecov.
|
Funnily enough, the solution to this is exactly the same as what I said before; just I tried to do it myself, but unfortunately there are enough git conflicts that it's not entirely obvious to me which should be chosen. If you have trouble with |
I'm close to tears, I think it worked (and days (if not weeks! ;-)) of work are preserved). One strange thing along the way was that when I |
Failures are clearly unrelated now. It's just the usual inability of @appveyor and @travis-ci to do simple things like stat a local file in under 80 seconds or connect to the internet. Thank goodness we have our own CI now that actually works. |
I ended up simply replacing my |
I was browsing (for something unrelated) but just noticed this amazing work. Fantastic! A note on dealing with large rebases: if things were developed iteratively with lots of small fixes to the same parts of the code, I often find it's helpful just to give up on the unruly history of the branch and squash it all into one commit from which the conflicts can be dealt with a single time. It looks like you've solved the conflicts though which is great. Also, it's harder than you might think to truly loose things with git (provided you've committed them at least once). When I find myself in trouble with a rebase, |
This is good to go now. The only Travis failure seems to be Pkg and internet connection. |
docs for BunchKaufman docs for Cholesky(Pivoted) docs for (Generalized)Eigen minor edits merge hessenberg docs for LDLt docs for LQ docs for LU merge new hessenberg add components to LQ docstring add components to LU docstring add components to Eigen docstring add components to GeneralizedEigen add components to Cholesky(Pivoted) add components to BunchKaufman docs for (Generalized)Schur docs for (Generalized)SVD fix bunchkaufman as per review list factorization types in index.md fix docstring x-refs
Contributes to #31202.
I have added a very short docstring to
Factorization
, and updated the manual. Now, allsubtypes(Factorization)
are listed, except the three SuiteSparse ones. I couldn't findLUTridiagonal
anywhere, so I deleted it from the manual. This certainly needs a careful review to make everything consistent. For example, would the reference to the online manual work like that? Once all types have their own docstrings, should the table in the manual contain references?Should we keep this PR restricted toI went ahead with adding docstrings for the concrete factorization types.Factorization
, or should we collect docstrings for each concrete factorization type here?