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

Missing "Examples" headings and a few more actual examples #27340

Merged
merged 4 commits into from
Jun 1, 2018

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented May 31, 2018

Pretty minimal changes for the most part, some doctests were missing their headings! I added a few more examples to simple math functions where the docstring mentioned a behaviour that wasn't shown in the doctest. This passed make docs locally, be sure to edit out the ci skip whoever merges.

@kshyatt kshyatt added the docs This change adds or pertains to documentation label May 31, 2018
base/math.jl Outdated
-2.0 will only return a complex result if called with a complex argument. Try -2.0(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(::Float64, ::Symbol) at ./math.jl:31
...
Copy link
Member

Choose a reason for hiding this comment

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

Does the doctest pass with this? I think it should be [...] to be recognized by Documenter.

Copy link
Member

Choose a reason for hiding this comment

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

Also, to make this doctest more resilient to line changes you can use a doctest-filter. You can use the same as here:

```jldoctest; filter = r"Stacktrace:(\\n \\[[0-9]+\\].*)*"

base/math.jl Outdated
-3.0 will only return a complex result if called with a complex argument. Try -3.0(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(::Float64, ::Symbol) at ./math.jl:31
...
Copy link
Member

Choose a reason for hiding this comment

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

[...]

@@ -534,8 +536,9 @@ end
"""
haskey(collection, key) -> Bool

Determine whether a collection has a mapping for a given key.
Determine whether a collection has a mapping for a given `key`.
Copy link
Member

Choose a reason for hiding this comment

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

I read this sentence as "key" beeing a general term, not specifically the argument key, but Idk.

Copy link
Member

Choose a reason for hiding this comment

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

Seems like it works as either.

base/math.jl Outdated
NaN result for non-NaN input.
Stacktrace:
[1] nan_dom_err at ./math.jl:325 [inlined]
...
Copy link
Member

Choose a reason for hiding this comment

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

[...] and add a stacktrace filter.

base/math.jl Outdated
NaN result for non-NaN input.
Stacktrace:
[1] nan_dom_err at ./math.jl:325 [inlined]
...
Copy link
Member

Choose a reason for hiding this comment

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

[...] and add a stacktrace filter.

base/math.jl Outdated
-2.0 will only return a complex result if called with a complex argument. Try -2.0(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(::Float64, ::Symbol) at ./math.jl:31
...
Copy link
Member

Choose a reason for hiding this comment

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

[...] and add a stacktrace filter.

base/math.jl Outdated
NaN result for non-NaN input.
Stacktrace:
[1] sqrt(::BigFloat) at ./mpfr.jl:501
...
Copy link
Member

Choose a reason for hiding this comment

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

[...] and add a stacktrace filter.

@kshyatt
Copy link
Contributor Author

kshyatt commented May 31, 2018

Are we happy with this? Good to sq&m?

@fredrikekre
Copy link
Member

I get some doctest failure on this branch.

@fredrikekre
Copy link
Member

#27109 on Travis 64-bit

@fredrikekre fredrikekre merged commit d555a9a into master Jun 1, 2018
@fredrikekre fredrikekre deleted the ksh/illmakeanexampleoutofyou branch June 1, 2018 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants