-
Notifications
You must be signed in to change notification settings - Fork 59
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
Convert some examples to doctests #1709
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1709 +/- ##
==========================================
+ Coverage 84.74% 84.87% +0.12%
==========================================
Files 94 94
Lines 37205 37204 -1
==========================================
+ Hits 31530 31576 +46
+ Misses 5675 5628 -47 ☔ View full report in Codecov by Sentry. |
I have some more stuff prepared locally, but had to run for the train. I'll push it later |
A = S([1 0 1; 2 3 1; 5 6 7]) | ||
|
||
B, d = pseudo_inv(A) | ||
``` |
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.
moved to pseudo_inv docstring
c = coeff(d, 1) | ||
is_gen(m) | ||
q = degree(K) | ||
r, s = signature(K) |
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.
Has been removed in #778, but they forgot the example
docs/src/constructors.md
Outdated
``` | ||
n = BigInt("1234567898765434567898765434567876543456787654567890") | ||
```jldoctest | ||
julia> n = parse(BigInt, "1234567898765434567898765434567876543456787654567890") |
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 has been broken all along. the new one doesn't quite fit the text above but I think it is better than something broken
|
||
```julia | ||
RR = ArbField(64) | ||
simplest_rational_inside(const_pi(RR)) |
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.
example is already in the docstring and thus included 5 lines above
@fingolfin this should be most of them now, at least the non-trivial ones (aka I won't add anything new to this PR, only CI fixes). Everything needing a doctestfilter (like |
Co-authored-by: Max Horn <[email protected]>
julia> a = sqrt(C(2)) + 1; | ||
|
||
julia> cos(a) + cos(2*a) + cos(3*a) == sin(7*a//2)//(2*sin(a//2)) - C(1)//2 | ||
true | ||
|
||
julia> sin(3*a) == 4 * sin(a) * sin(C(pi)//3 - a) * sin(C(pi)//3 + a) | ||
ERROR: Unable to perform operation (failed deciding truth of a predicate): isequal | ||
[...] |
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.
Just out of curiosity, why add these [...]
to errors?
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.
https://documenter.juliadocs.org/dev/man/doctests/#Exceptions told me
To indicate to readers that the output result is truncated and does not display the entire (or any of) the stacktrace you may write
[...]
at the line where checking should stop, i.e.
and I liked that
If it works it works. I will merge tomorrow unless someone objects. |
Some progress towards #1683.
I add some comment to non-trivial changes for you to review.