-
Notifications
You must be signed in to change notification settings - Fork 62
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
rename differentials #353
rename differentials #353
Conversation
src/differentials/thunks.jl
Outdated
@@ -112,7 +112,7 @@ but it should do this more efficently than simply doing this directly. | |||
Most operations on an `InplaceableThunk` treat it just like a normal `Thunk`; | |||
and destroy its inplacability. | |||
""" | |||
struct InplaceableThunk{T<:Thunk, F} <: AbstractThunk | |||
struct InplaceableThunkedTangent{T<:Thunk, F} <: AbstractThunk |
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 seems too long and I've changed it only to highlight the inconsistency we get if we keep it as InplaceableThunk
.
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.
Maybe we shouldn't use the Tangent suffix for Thunks?
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.
How about InplaceableTangent
?
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.
Two reasons against that:
- hides arguably the more important info for handling this object (that it is a thunk)
- many tangents are "inplaceable" without being this type (so having something named InplaceableTangent is confusing)
Personally I prefer both the current name and the more verbose name
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.
Ok, I've changed it back to the current name. Are there any other open questions or are we happy with this? I'll go ahead and open follow up PRs everywhere
src/differentials/one.jl
Outdated
@@ -3,7 +3,7 @@ | |||
The Differential which is the multiplicative identity. | |||
Basically, this represents `1`. | |||
""" | |||
struct One <: AbstractDifferential end | |||
struct OneTangent <: AbstractTangent end |
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.
Do we want this to be consistent with ZeroTangent
? It seems to be used very rarely anyway.
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 think we want to delete this. #354
Can we try deprecating it in favour of true
and see if that breaks anything on our reverse dependency tests?
@deprecate One() true
We need to use It should be all |
src/differentials/abstract_zero.jl
Outdated
@@ -71,7 +71,7 @@ arguments. | |||
end | |||
``` | |||
""" | |||
struct DoesNotExist <: AbstractZero end | |||
struct NoPossibleTangent <: AbstractZero end |
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.
Shorter and means the same thing?
struct NoPossibleTangent <: AbstractZero end | |
struct NoTangent <: AbstractZero end |
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.
Arguably means a different thing, but might still be good
@simeonschaub @devmotion @sethaxen @mcabbott thoughts/opinions? |
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 didn't mind the old names too much, but I am fine with adopting these new names.
Codecov Report
@@ Coverage Diff @@
## master #353 +/- ##
=======================================
Coverage 90.03% 90.03%
=======================================
Files 14 14
Lines 542 542
=======================================
Hits 488 488
Misses 54 54
Continue to review full report at Codecov.
|
|
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.
So the full list of renaming is:
AbstractDifferential
->AbstractTangent
Composite{T}
->Tangent{T}
Zero
->ZeroTangent
DoesNotExist
->NoTangent
Thunk
and InplaceableThunk
are unchanged.
And the old names are deprecated, not yet removed, so this is non-breaking.
Should we have tests that these things are successfully deprecated (e.g. just @test Zero() === ZeroTangent()
)?
I'm okay with this renaming :)
EDIT: What's happening with One
?
Thanks for reviewing! I will add the deprecation tests. I've left |
Co-authored-by: Nick Robinson <npr251@gmail.com>
Are those the version we test on? i.e. is it passing on some versions but not others? I ask becasue I suspect we can't use |
yes
Correct, we can't use |
Closes #305
I've only renamed the definitions here so we can finalise our discussion on what to call different things.
Once we agree, I'll make the rest of the changes.
Edit:
The final list is:
And I've left
One
for another PR since it was causing CI to fail on Julia 1.0 and Julia 1.5