Add PhotoOverlay, Camera, LookAt, AbstractView support
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
Hello @martimpassos! Thanks for updating this PR. We checked the lines you've touched for PEPΒ 8 issues, and found:
- In the file
fastkml/kml.py:
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
Sorry, the refactoring PRs are annoying, is there anyway I can avoid them?
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.
Hello @cleder, do you have feedback on this PR? Please let me know
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.
Thanks @dericke, I have addressed the issues in the code I introduced. The remaining ones are present in the currently published version.
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!
