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

Move docstrings inline from helpdb - Part 2 #22618

Merged
merged 1 commit into from
Jun 30, 2017

Conversation

xorJane
Copy link
Contributor

@xorJane xorJane commented Jun 29, 2017

To note, I refactored docstring generation for csc*(x), sec*(x), and cot*(x).

From #22521

<3!

(:secd, :cosd), (:cscd, :sind), (:cotd, :tand))
for (finv, f, finvh, fh, finvd, fd, fn) in ((:sec, :cos, :sech, :cosh, :secd, :cosd, "secant"),
(:csc, :sin, :csch, :sinh, :cscd, :sind, "cosecant"),
(:cot, :tan, :coth, :tahnh, :cotd, :tand, "cotangent"))
Copy link
Member

@Sacha0 Sacha0 Jun 29, 2017

Choose a reason for hiding this comment

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

Perhaps align the second and third tuples to the front of the first tuple, rather than to the end of the first tuple? (Edit: E.g. as in the preexisting loop.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I aligned the second and third tuples as such because I'm just already over the 92 character line length with the current formatting. In that case, do you think I should leave as is, or still realign?

Copy link
Member

Choose a reason for hiding this comment

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

Good question! Perhaps @tkelman, arbiter of all things line length, can make that call? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

either way. 92 is a recommendation rather than a hard limit, and I think the way @xorJane has this formatted now is fine too

Copy link
Contributor

Choose a reason for hiding this comment

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

though tanh is spelled wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops. Fixed the spelling and also chose to realign. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I hope our tests would have caught that. If not we've got a coverage hole.

@tkelman
Copy link
Contributor

tkelman commented Jun 29, 2017

This conflicts with #22602, but I like your consolidation better. cc @kshyatt

@ararslan ararslan added the docs This change adds or pertains to documentation label Jun 29, 2017
@eval begin
($finv)(z::T) where {T<:Number} = one(T) / (($f)(z))
@doc """
Copy link
Member

Choose a reason for hiding this comment

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

Just curious; why is the @doc needed here?

Copy link
Member

Choose a reason for hiding this comment

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

You are correct, the @doc is not necessary: The @doc would be necessary absent the eval due to the scope introduced by the for, but the eval lifts evaluation out of the for's scope.

Apologies, this error was mine! I misled @xorJane and @OliverEvans96 while reviewing these changes at JuliaCon. Best!

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.

5 participants