fastkml icon indicating copy to clipboard operation
fastkml copied to clipboard

Add PhotoOverlay, Camera, LookAt, AbstractView support

Open martimpassos opened this issue 3 years ago β€’ 8 comments

Hi, still a bit of work to be done (and some useless functions I probably created in the heat of the moment), but I decided to open the PR to discuss a few points. Am comparing against main for easier merging, let me know if I should compare against develop instead. Fixes #102 Fixes #19

martimpassos avatar Feb 03 '22 20:02 martimpassos

Hello @martimpassos! Thanks for updating this PR. We checked the lines you've touched for PEPΒ 8 issues, and found:

Line 140:21: W503 line break before binary operator Line 153:17: W503 line break before binary operator

Comment last updated at 2022-04-19 19:57:29 UTC

pep8speaks avatar Feb 03 '22 20:02 pep8speaks

Sorry, the refactoring PRs are annoying, is there anyway I can avoid them?

martimpassos avatar Feb 04 '22 21:02 martimpassos

CodeSee Review Map:

Review these changes using an interactive CodeSee Map

Review in an interactive map

View more CodeSee Maps

Legend

CodeSee Map Legend

ghost avatar Feb 08 '22 19:02 ghost

hi @cleder, please take a look at this when you can. The module tests are all passing, but not the github actions ones. I'm not super used to contributing to other projects, hopefully I didn't embarrass myself too much. ImagePyramid and ViewVolume should probably become classes like Camera (I can make LatLonBox a class as well as per the TODO comment), just wanted to have a green light before going forward.

martimpassos avatar Feb 10 '22 18:02 martimpassos

Hello @cleder, do you have feedback on this PR? Please let me know

martimpassos avatar Apr 19 '22 14:04 martimpassos

Hey @martimpassos, it looks as though there are a couple of easy fixes suggested here. Making the suggested changes should clear up one of the checks that's currently failing.

dericke avatar Apr 19 '22 16:04 dericke

Thanks @dericke, I have addressed the issues in the code I introduced. The remaining ones are present in the currently published version.

martimpassos avatar Apr 19 '22 19:04 martimpassos

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.45%.

Quality metrics Before After Change
Complexity 2.42 ⭐ 3.14 ⭐ 0.72 πŸ‘Ž
Method Length 61.12 πŸ™‚ 54.99 ⭐ -6.13 πŸ‘
Working memory 6.17 ⭐ 6.17 ⭐ 0.00
Quality 76.35% ⭐ 75.90% ⭐ -0.45% πŸ‘Ž
Other metrics Before After Change
Lines 3504 4152 648
Changed files Quality Before Quality After Quality Change
fastkml/kml.py 71.86% πŸ™‚ 72.05% πŸ™‚ 0.19% πŸ‘
fastkml/test_main.py 78.94% ⭐ 79.29% ⭐ 0.35% πŸ‘

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
fastkml/kml.py _Feature.from_element 22 😞 437 β›” 8 πŸ™‚ 35.64% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py _Feature.etree_element 25 😞 332 β›” 6 ⭐ 40.21% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py PhotoOverlay.from_element 23 😞 267 β›” 7 πŸ™‚ 41.16% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py Placemark.from_element 7 ⭐ 244 β›” 10 😞 48.69% 😞 Try splitting into smaller methods. Extract out complex expressions
fastkml/kml.py _TimePrimitive.parse_str 6 ⭐ 146 😞 12 😞 53.78% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • πŸ™‚ good
  • 😞 poor
  • β›” very poor

The πŸ‘ and πŸ‘Ž indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

sourcery-ai[bot] avatar Apr 19 '22 19:04 sourcery-ai[bot]