-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Macro fps support #4594
Macro fps support #4594
Conversation
added support for fps specification for animation macros. Also changed the way parameters are parsed to simplify possible future additions of extra parameters.
Extended documentation for animation macros, to include the new fps parameter as well as filter mechanics
This macro supports additional parameters, that may be added after the main loop body. | ||
- Add `fps=n` with positive Integer n, to specify the desired frames per second. | ||
- Add `every n` with positive Integer n, to take only one frame every nth iteration. | ||
- Add `when <cond>` where `<cond>` is an Expression resulting in a Boolean, to take a | ||
frame only when `<cond>` returns `true`. Is incompatible with `every`. | ||
""" | ||
macro apng(forloop::Expr, args...) |
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 you can use @doc (@doc gif) macro apng
to repeat a documentation.
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 tried this, with
let moreDocumentation = """This macro supports ... """
@doc string(@doc @gif)*moreDocumentation :(@gif)
@doc string(@doc @apng)*moreDocumentation :(@apng)
@doc string(@doc @animate)*moreDocumentation :(@animate)
end
but instead of extending the documentation it added a whole new one. It was not very pretty.
Thanks for this PR. You might want to read https://docs.juliaplots.org/stable/contributing/#Write-code,-and-format. It would be great to add some tests in https://github.com/JuliaPlots/Plots.jl/blob/master/test/test_animations.jl. |
Short FYI, this is my first real Pull request ever, so I don't quite know what I am doing, but I just got an automated email pointing me to this page, which should help. |
Codecov ReportBase: 90.76% // Head: 90.77% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4594 +/- ##
==========================================
+ Coverage 90.76% 90.77% +0.01%
==========================================
Files 41 41
Lines 8767 8800 +33
==========================================
+ Hits 7957 7988 +31
- Misses 810 812 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
added Tests for testing extra macro parameters for that juicy code coverage
Greetings Over the weekend I cleaned up and formatted the code. I also added some tests. BTW, since the macro just passes some data to the |
Hello.
I rewrote the
_animate
function, so that the animation macros@gif
,@animate
and@apng
support an extra fps-parameter.This includes some restructuring which could make possible future parameter additions somewhat simpler.
I also added Documentation for these macros to properly communicate this functionality.