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

Switch to Blue Style #165

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Switch to Blue Style #165

merged 2 commits into from
Jan 28, 2020

Conversation

nickrobinson251
Copy link
Contributor

@nickrobinson251 nickrobinson251 commented Jan 26, 2020

  • closes Change to BlueStyle #141
  • We mostly follow this style anyway :)
  • Alphabetises some scalar_rules (although not required by the guide, seemed a good opportunity)
  • Rewrites some long lines (with some pleasing improvements in clarity in my opinion)

@@ -10,7 +10,7 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
ChainRulesCore = "0.6"
Copy link
Contributor Author

@nickrobinson251 nickrobinson251 Jan 26, 2020

Choose a reason for hiding this comment

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

Bumping to 0.6.1 allows us to remove the line using ChainRulesCore: AbstractZero

@scalar_rule(abs2(x), 2x)
@scalar_rule(exp(x), Ω)
Copy link
Contributor Author

@nickrobinson251 nickrobinson251 Jan 26, 2020

Choose a reason for hiding this comment

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

Not required by Blue Style, but I alphabetised the blocks of code in this file, to make the rules easier to find (they are already in blocks of "similar" functions, but i fixed up a few inconsistencies in that too)

x::AbstractVector{T}) where T<:BlasFloat
function rrule(
::typeof(gemv), tA::Char, A::AbstractMatrix{T}, x::AbstractVector{T}
) where T<:BlasFloat
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is one of the few actual style changes -- it now matches the style we use everywhere else

@nickrobinson251 nickrobinson251 merged commit 98c5458 into master Jan 28, 2020
@oxinabox oxinabox deleted the npr/style branch August 17, 2020 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change to BlueStyle
2 participants