-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add start
/decay
as Kwargs in Schedulers (apart from the UTF-8 ones)
#41
Comments
Feel free to submit a PR implementing this; otherwise, I'll add it soon! |
Thanks @darsnack, I will soon submit a PR addressing this issue! |
It turns out that the implementation is not as straight forward as I expected. The reason is that since the methods being defined as in the example I provided are identical (the only difference being the kwarg names), Julia will overwrite the definitions and keep only the last evaluated method: function foo(; some, args)
return [some, args]
end
function foo(; other, args)
return [other, args]
end
println(methods(foo))
Swapping the order of the definition we have: function foo(; other, args)
return [other, args]
end
function foo(; some, args)
return [some, args]
end
println(methods(foo))
So now I don't know exactly how to proceed in this situation. As I skimmed through the code in function Triangle(range::T, offset::T, period::S) where {T, S}
@warn """Triangle(range0, range1, period) is now Triangle(range, offset, period).
To specify by endpoints, use the keyword argument form.
This message will be removed in the next version.""" _id=(:tri) maxlog=1
Triangle{T, S}(range, offset, period)
end
Triangle(;λ0, λ1, period) = Triangle(abs(λ0 - λ1), min(λ0, λ1), period) so a couple of ideas emerged:
|
Following up on this, I am fine with dropping support for all unicode keywords and switching the plaintext names. Still interested in making a PR? |
Sure! I'll drop one as soon as possible. |
Describe the potential feature
When writing code from terminal-based editors e.g. Vim, NeoVim, Nano (and AFAIK Helix), it becomes a bit of a cumbersome to repeatedly copy-paste mathematical characters such as
λ
andγ
which appear in most schedulers. Although I see the merit of having UTF-8 characters as kwargs for mathematical aesthetics, I believe we should also have the option to specify such parameters by spelling out their meanings i.e. withstart
,decay
, etc.As an example, currently we have the following:
Motivation
No response
Possible Implementation
I believe that the implementation should be straight forward, just requiring another definition of the schedulers using the
start
anddecay
kwargs (which are already in the "Arguments" section of some of the schedulers doc pages). Using theStep
scheduler as an example, we'd have:The text was updated successfully, but these errors were encountered: