pymap3d icon indicating copy to clipboard operation
pymap3d copied to clipboard

Improve code quality

Open JonathanPlasse opened this issue 2 years ago • 4 comments

Improve Code Quality

Improve typing

  • [x] Use mypy strict mode
  • [x] Add py.typed to enable typing (c.f. #73, PEP 561 compliant)

pre-commit

Badges

Add some badges,

  • [x] black
  • [x] mypy
  • [x] coverage

Contributing

  • [x] Create a CONTRIBUTING.md file to standardise how to set up pymap3d to contribute
    • [x] Setting up an environment
    • [x] Testing
    • [x] Committing with pre-commit

CI

JonathanPlasse avatar Oct 28 '22 05:10 JonathanPlasse

@scivision, the pull request is ready. Is it possible to activate for this repository pre-commit ci and Codecov and then approve the workflows to check if it works?

JonathanPlasse avatar Oct 29 '22 17:10 JonathanPlasse

I cherry-picked individual commits into main until the tests started failing. I then switched back to your branch and rebased on main--still failing tests, but at least consistent with main. https://github.com/geospace-code/pymap3d/tree/JonathanPlasse-improve-code-quality

scivision avatar Nov 15 '22 00:11 scivision

Codecov Report

Merging #76 (6c33a23) into main (0114898) will increase coverage by 0.52%. The diff coverage is 92.37%.

@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   90.21%   90.74%   +0.52%     
==========================================
  Files          40       41       +1     
  Lines        2003     2236     +233     
  Branches      178      189      +11     
==========================================
+ Hits         1807     2029     +222     
- Misses        144      157      +13     
+ Partials       52       50       -2     
Impacted Files Coverage Δ
src/pymap3d/spherical.py 77.04% <41.17%> (-13.86%) :arrow_down:
src/pymap3d/tests/test_pyproj.py 47.61% <66.66%> (ø)
src/pymap3d/timeconv.py 79.48% <72.22%> (+8.89%) :arrow_up:
src/pymap3d/tests/test_look_spheroid.py 69.56% <75.00%> (ø)
src/pymap3d/tests/test_time.py 67.85% <75.00%> (-5.12%) :arrow_down:
src/pymap3d/sidereal.py 85.36% <77.77%> (+0.75%) :arrow_up:
src/pymap3d/lox.py 86.53% <85.18%> (+1.43%) :arrow_up:
src/pymap3d/vincenty.py 84.51% <85.71%> (+0.74%) :arrow_up:
src/pymap3d/haversine.py 82.35% <86.66%> (+23.09%) :arrow_up:
src/pymap3d/rsphere.py 64.38% <88.23%> (+2.06%) :arrow_up:
... and 45 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Nov 15 '22 09:11 codecov-commenter

@scivision, I rebased the branch, all CI is passing. Can activate pre-commit ci? pre-commit run --all-files pass locally on my machine. It replaces flake8 and mypy in the CI and adds much more. Also, why did you deactivate the coverage with full dependencies? It reduces the test coverage.

JonathanPlasse avatar Nov 15 '22 09:11 JonathanPlasse