pysal / momepy

Urban Morphology Measuring Toolkit
https://docs.momepy.org
BSD 3-Clause "New" or "Revised" License
496 stars 59 forks source link

Modernize code #494

Closed eumiro closed 1 year ago

eumiro commented 1 year ago

Get rid of a few Python2 relics (e.g. explicit floats where integers are more appropriate) and make the code again a bit more compact and (hopefully) readable.

codecov[bot] commented 1 year ago

Codecov Report

Merging #494 (3a4d239) into main (8f0fd41) will increase coverage by 0.5%. The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #494     +/-   ##
=======================================
+ Coverage   97.0%   97.5%   +0.5%     
=======================================
  Files         24      24             
  Lines       4126    4111     -15     
=======================================
+ Hits        4001    4009      +8     
+ Misses       125     102     -23     
Impacted Files Coverage Δ
momepy/coins.py 95.3% <100.0%> (-0.2%) :arrow_down:
momepy/datasets/__init__.py 100.0% <100.0%> (ø)
momepy/distribution.py 97.0% <100.0%> (ø)
momepy/diversity.py 98.8% <100.0%> (+0.4%) :arrow_up:
momepy/graph.py 98.8% <100.0%> (+0.8%) :arrow_up:
momepy/preprocessing.py 93.7% <100.0%> (+1.5%) :arrow_up:
momepy/shape.py 91.9% <100.0%> (ø)
momepy/tests/test_coins.py 100.0% <100.0%> (ø)
momepy/utils.py 99.4% <100.0%> (+0.6%) :arrow_up:

... and 3 files with indirect coverage changes

eumiro commented 1 year ago

There are tools like pyupgrade, but also a few words I grep for and look around. Python2 relics are easily recognizable around int(, float(, .0.