Fixed several issues in the examples#402
Merged
Merged
Conversation
Member
Author
pbrod
approved these changes
Mar 29, 2020
Contributor
|
@jwiggins can you merge master into this branch? |
* Python style fixes. * Insulated the xxxtrait.configure_traits() call inside a "if __name__ == '__main__'" block * Added the "demo = XXXtrait()" to each demo-script so it can be discovered and run by the traitsui.extra.demo.demo. * examples/kiva/agg/benchmark.py (Float -> float, added missing import of zeros) * examples/kiva/agg/polygon_hit_test.py (point_in_polygon -> points_in_polygon) * examples/kiva/gradient.py (added missing import of tempfile) * Moved code in 'if __name___ == "__main__"' block in benchmark.py to the run_all_benchmarks function. * Removed unused import of "FILL_STROKE" in examples/kiva/agg/compiled_path.py * Removed unused import of "affine", "constants" in examples/kiva/agg/dummy.py * Replaced call to deprecated time.clock with time.perf_counter on Python 3 in: * examples/kiva/agg/benchmark.py * examples/kiva/agg/dash.py * examples/kiva/agg/lion.py * examples/kiva/agg/pylygon_hit_test.py * examples/kiva/agg/simple_clip.py * examples/kiva/agg/text_ex.py * examples/kiva/simple.py * examples/kiva/test_image3.py
f5793f7 to
4efcc5b
Compare
Codecov Report
@@ Coverage Diff @@
## master #402 +/- ##
==========================================
+ Coverage 28.95% 32.73% +3.78%
==========================================
Files 206 206
Lines 18252 18297 +45
Branches 2466 2470 +4
==========================================
+ Hits 5284 5990 +706
+ Misses 12641 11929 -712
- Partials 327 378 +51
Continue to review full report at Codecov.
|
rahulporuri
approved these changes
Nov 30, 2020
rahulporuri
left a comment
Contributor
There was a problem hiding this comment.
This mostly feels like flake8/style changes but i think I also noticed a few genuine issues that were fixed in the examples. Either way, LGTM.
Member
Author
|
Thanks for the review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: This is just the changes to the code in
examples/from #401xxxtrait.configure_traits()calla insideif __name__ == '__main__'blocksdemo = XXXtrait()to each demo-script so it can be discovered and run by thetraitsui.extra.demo.demo.examples/kiva/agg/benchmark.py(Float->float, added missing import ofzeros)examples/kiva/agg/polygon_hit_test.py(point_in_polygon->points_in_polygon)examples/kiva/gradient.py(added missing import oftempfile)if __name___ == "__main__"block inbenchmark.pyto therun_all_benchmarksfunction.FILL_STROKEinexamples/kiva/agg/compiled_path.pyaffine,constantsinexamples/kiva/agg/dummy.pytime.clockwithtime.perf_counteron Python 3 in:examples/kiva/agg/benchmark.pyexamples/kiva/agg/dash.pyexamples/kiva/agg/lion.pyexamples/kiva/agg/pylygon_hit_test.pyexamples/kiva/agg/simple_clip.pyexamples/kiva/agg/text_ex.pyexamples/kiva/simple.pyexamples/kiva/test_image3.py