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

Warning if no background #273

Merged
merged 7 commits into from
Nov 7, 2020
Merged

Warning if no background #273

merged 7 commits into from
Nov 7, 2020

Conversation

Wikunia
Copy link
Member

@Wikunia Wikunia commented Nov 3, 2020

PR Checklist

If you are contributing to Javis.jl, please make sure you are able to check off each item on this list:

  • Did I update CHANGELOG.md with whatever changes/features I added with this PR?
  • Did I make sure to only change the part of the file where I introduced a new change/feature?
  • Did I cover all corner cases to be close to 100% test coverage (if applicable)?
  • Did I properly add Javis dependencies to the Project.toml + set an upper bound of the dependency (if applicable)?
  • Did I properly add test dependencies to the test directory (if applicable)?
  • Did I check relevant tutorials that may be affected by changes in this PR?
  • Did I clearly articulate why this PR was made the way it was and how it was made?

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 😄

@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #273 (acced09) into v0.3 (473a9c9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
src/Javis.jl 97.36% <100.00%> (+0.04%) ⬆️
src/structs/Object.jl 100.00% <100.00%> (ø)
src/structs/Video.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 473a9c9...acced09. Read the comment docs.

@Wikunia Wikunia changed the title Wik warning no background Warning if no background Nov 3, 2020
@Wikunia
Copy link
Member Author

Wikunia commented Nov 3, 2020

I have no idea why format is failing. I've run the format command. Maybe you can double check this @TheCedarPrince

Copy link
Member

@TheCedarPrince TheCedarPrince left a 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: ",
Copy link
Member

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
Comment on lines 152 to 153
setdiff(frames, CURRENT_VIDEO[1].background_frames))
end
Copy link
Member

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

@Wikunia
Copy link
Member Author

Wikunia commented Nov 7, 2020

Only other question that I had is should we seek to identify which Object does not have a background defined?

I don't think we can.

@Wikunia Wikunia merged commit 8390e54 into v0.3 Nov 7, 2020
@Wikunia Wikunia deleted the wik-warning-no-background branch November 7, 2020 18:14
TheCedarPrince added a commit that referenced this pull request Nov 10, 2020
* 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>
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.

2 participants