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

v 1.0 alpha 3 #203

Merged
merged 34 commits into from
Dec 7, 2022
Merged

v 1.0 alpha 3 #203

merged 34 commits into from
Dec 7, 2022

Conversation

cleder
Copy link
Owner

@cleder cleder commented Dec 7, 2022

workerB

ramonsaraiva and others added 30 commits October 13, 2022 12:25
Type annotate fastkml.data (Sourcery refactored)
updates:
- [github.com/asottile/pyupgrade: v2.38.0 → v3.1.0](asottile/pyupgrade@v2.38.0...v3.1.0)
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/hakancelikdev/unimport: 0.12.1 → 0dc8d609eb670eeb3335958acddcb6059cc4b8dd](hakancelikdev/unimport@0.12.1...0dc8d60)
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](asottile/pyupgrade@v3.1.0...v3.2.0)
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/hakancelikdev/unimport: 0dc8d609eb670eeb3335958acddcb6059cc4b8dd → a56235171fc28dff6a879c377bb7392679552671](hakancelikdev/unimport@0dc8d60...a562351)
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/hakancelikdev/unimport: a56235171fc28dff6a879c377bb7392679552671 → 004b5dd0c8112330275beb52c4ccfce016a4b945](hakancelikdev/unimport@a562351...004b5dd)
- [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](asottile/pyupgrade@v3.2.0...v3.2.2)
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0)
- https://github.com/ikamensh/flynt/: 0.76 → 0.77
- [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0)
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/hakancelikdev/unimport: 004b5dd0c8112330275beb52c4ccfce016a4b945 → 33ead41ee30f1d323a9c2fcfd0114297efbbc4d5](hakancelikdev/unimport@004b5dd...33ead41)
- [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](asottile/pyupgrade@v3.2.2...v3.3.0)
- [github.com/mgedmin/check-manifest: 0.48 → 0.49](mgedmin/check-manifest@0.48...0.49)
[pre-commit.ci] pre-commit autoupdate
@what-the-diff
Copy link

what-the-diff bot commented Dec 7, 2022

  • Added support for Python 3.12
  • Updated pre-commit hooks to latest versions
  • Fixed some type hints and added more of them (mypy)
  • Removed unused imports in kml module, fixed a few typos here and there
  • Add a new file views_test.py
  • Change the import of data in oldunit_test from fastkml to fastkml/data
  • Fix some bugs and add tests for them:
    • test that empty strings are not converted into None values when setting attributes (e.g., self._north = "" should be allowed)
    • fix bug where simple fields were appended instead of replaced if they were set as an iterable, e.g.: s1 = Schema(ns); s1[0] == [] ;s1[0].append("int", "Integer") -> [{"type": "int", ...}]; s1[0] = ("float","Float"); assert len(s1) == 1; assert type is float # this was failing before because it would append the tuple to the list rather than replacing it with a new one

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 7, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.28%.

Quality metrics Before After Change
Complexity 3.32 ⭐ 3.18 ⭐ -0.14 👍
Method Length 64.41 🙂 64.78 🙂 0.37 👎
Working memory 5.74 ⭐ 5.69 ⭐ -0.05 👍
Quality 75.43% 75.71% 0.28% 👍
Other metrics Before After Change
Lines 4603 4754 151
Changed files Quality Before Quality After Quality Change
setup.py 94.13% ⭐ 94.13% ⭐ 0.00%
fastkml/__init__.py 68.76% 🙂 67.65% 🙂 -1.11% 👎
fastkml/data.py 79.83% ⭐ 80.21% ⭐ 0.38% 👍
fastkml/kml.py 68.52% 🙂 68.52% 🙂 0.00%
fastkml/times.py 69.99% 🙂 69.47% 🙂 -0.52% 👎
fastkml/views.py 71.81% 🙂 72.15% 🙂 0.34% 👍
fastkml/tests/oldunit_test.py 80.58% ⭐ 80.59% ⭐ 0.01% 👍
fastkml/tests/views_test.py 81.03% ⭐

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 😞 517 ⛔ 8 🙂 35.14% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py _Feature.etree_element 25 😞 431 ⛔ 7 🙂 36.15% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py PhotoOverlay.from_element 23 😞 324 ⛔ 7 🙂 39.18% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/views.py _AbstractView.etree_element 11 🙂 260 ⛔ 9 🙂 46.23% 😞 Try splitting into smaller methods
fastkml/kml.py Placemark.from_element 7 ⭐ 298 ⛔ 9 🙂 48.44% 😞 Try splitting into smaller methods

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!

@ghost
Copy link

ghost commented Dec 7, 2022

👇 Click on the image for a new way to code review
  • Make big changes easier — review code in small groups of related files

  • Know where to start — see the whole change at a glance

  • Take a code tour — explore the change with an interactive tour

  • Make comments and review — all fully sync’ed with github

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Base: 88.89% // Head: 92.42% // Increases project coverage by +3.53% 🎉

Coverage data is based on head (d7d2939) compared to base (8fe75fe).
Patch coverage: 89.55% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #203      +/-   ##
==========================================
+ Coverage   88.89%   92.42%   +3.53%     
==========================================
  Files          22       23       +1     
  Lines        4339     4357      +18     
==========================================
+ Hits         3857     4027     +170     
+ Misses        482      330     -152     
Impacted Files Coverage Δ
fastkml/kml.py 78.47% <ø> (-0.04%) ⬇️
fastkml/views.py 82.30% <79.24%> (+43.58%) ⬆️
fastkml/data.py 94.87% <90.00%> (-2.65%) ⬇️
fastkml/__init__.py 100.00% <100.00%> (ø)
fastkml/tests/oldunit_test.py 99.85% <100.00%> (+<0.01%) ⬆️
fastkml/tests/views_test.py 100.00% <100.00%> (ø)
fastkml/times.py 98.23% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@cleder cleder merged commit 8f10458 into main Dec 7, 2022
cleder added a commit that referenced this pull request Dec 7, 2022
Merge pull request #203 from cleder/develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants