-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Warning if no background #273
Conversation
Codecov Report
@@ Coverage Diff @@
## v0.3 #273 +/- ##
==========================================
+ Coverage 95.69% 95.71% +0.01%
==========================================
Files 21 21
Lines 999 1003 +4
==========================================
+ Hits 956 960 +4
Misses 43 43
Continue to review full report at Codecov.
|
I have no idea why format is failing. I've run the |
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 makes sense - I found one typo and made a minor suggestion on implementation. Only other question that I had is should we seek to identify which Object does not have a background defined?
Also, I have no idea why format check is failing. I did the following inside of the src
directory and it did seem to make some formatting changes:
using JuliaFormatter
format(".", annotate_untyped_fields_with_any=false, always_for_in=true, whitespace_in_kwargs=true, whitespace_ops_in_indices=true)
Perhaps something wasn't configured with your VSCode setup or something? Quite strange.
src/Javis.jl
Outdated
@@ -144,6 +147,10 @@ function preprocess_frames!(objects::Vector{<:AbstractObject}) | |||
append!(frames, collect(get_frames(object))) | |||
end | |||
frames = unique(frames) | |||
if !(frames ⊆ CURRENT_VIDEO[1].background_frames) | |||
@warn("Some of the frames don't have a background: In this case: ", |
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.
"background:" to "background."
src/Javis.jl
Outdated
setdiff(frames, CURRENT_VIDEO[1].background_frames)) | ||
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.
I feel that the warning is a bit verbose:
┌ Warning: Some of the frames don't have a background: In this case:
│ setdiff(frames, (CURRENT_VIDEO[1]).background_frames) =
│ 1-element Array{Int64,1}:
│ 11
└ @ Javis /home/src/Projects/javis/src/Javis.jl:151
Perhaps instead we could do this:
@warn("Some of the frames don't have a background: In this case: $(
setdiff(frames, CURRENT_VIDEO[1].background_frames))")
which I think produces the nicer warning:
┌ Warning: Some of the frames don't have a background: In this case: [11]
└ @ Javis /home/src/Projects/javis/src/Javis.jl:151
I don't think we can. |
* first step of Action -> Object, SubAction -> Action (#226) * first step of Action -> Object, SubAction -> Action * docstring for Action * docstrings for Object * Implementation of render and act (#228) * use act and render syntax * Working with the variable instead of the id (#230) * working without extra identifier * Tutorial 1 v0.3 (#244) * tutorial 1 for v0.3 * Updated tutorial 1 explanation Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Docstrings v0.3 (#237) * first step of Action -> Object, SubAction -> Action * fixed unit tests * fixed svg tests * fix animations.jl (only morphing is missing) * changed morphing. All tests should pass * codecov and ambiguity * docstring for Action * small docstring fixes * removed ability to have more transitions in one action * docstrings for Object * docstring for BackgroundObject * copy action when adding to an object * use act and render syntax * working without extra identifier * extra codecov test * updated tutorial 1 * some docstring fixes for v0.3 * Final check on first pass of v0.3.0 docstrings Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Ability to disable an action after its last defined frame (#242) * keep or not keep an action * Wik feature setopacity (#241) * implementation of setopacity * Translation -> anim_translate and co + unit tests (#250) * Translation -> anim_translate and co + unit tests * Change BackgroundObject to Background (#261) * sed and replaced all occurences of BackgroundObject to Background * Notice about syntax change for background * Added notice about change of Action syntax * Formatted docstring for Background * Tutorial 1 for v0.3 (#262) * updated tutorial to `anim_rotate_around` Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Feature global frames (#265) * bugfix in :same for Action and implementation of Glob * Rel -> RFrames, Glob to GFrames * Example follow path v0.3 (#264) * follow bezier path for v0.3 with GFrames * preprocess_frames! function (#263) * preprocess_frames! function Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Tutorial 6 for v0.3 (#267) * tutorial 6 for v0.3 * Adjusted some grammar and light rewording of some sentences Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * HowTo v0.3 (#269) * first part of HowTo Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Updated Jarvis (#272) * Updated Jarvis with draw_text Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * LaTeX tutorial for v0.3 (#271) * updated Latex tutorial Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * [WIP] Feature transpose (#175) - morphing several shapes - i.e. transpose Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Warning if no background (#273) * show a warning if some frames don't have a background * Update Tutorial 2 for v0.3.0 (#268) * Reduxed code for tutorial 2 * Changed notes from Action to Object syntax * Cleaned code and fixed up grammar * Fixed wording * Fixed code * Fixed references to Object * Removed superfluous file * Removed section on Animation * v0.3 Fourier (#274) * fourier example * Docstrings for v0.3 (#276) * docstrings fixes for anim_, act!, javis, SubAction, grammar Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Warning if action is defined out of object frames (#278) * Throw warning if action is outside object frames * test case fix + format * Clarified warning msg Co-authored-by: Jacob Zelko <jacobszelko@gmail.com> * Redux of tutorial 5 (#280) * Redux of tutorial 5 Co-authored-by: Ole Kröger <o.kroeger@opensourc.es> * Final check v0.3 (#281) * Removed SubAction and checked for Rel/BackgroundAction * fixed all references * added line to changelog * finished v0.3 Co-authored-by: Ole Kröger <o.kroeger@opensourc.es> * format * Taming and link to change * changed SubAction name to Action * removed prints Co-authored-by: Jacob Zelko <jacobszelko@gmail.com>
PR Checklist
If you are contributing to
Javis.jl
, please make sure you are able to check off each item on this list:CHANGELOG.md
with whatever changes/features I added with this PR?Project.toml
+ set an upper bound of the dependency (if applicable)?test
directory (if applicable)?Link to relevant issue(s)
Closes #214
How did you address these issues with this PR? What methods did you use?
The video now saves a range for which a background is defined. The
preprocess_frames!
function then checks whether some frames don't have a background and throws a warning.Additionally I've changed some test cases to not throw a warning 😄