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

ENH: Add inplace kwarg to Geod.fwd and Geod.inv #1201

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

greglucas
Copy link
Contributor

This adds the ability to reuse the arrays passed in and out of the geod functions, following the same idea as the Transformers. I noticed this while profiling some of Cartopy's code and we could potentially get some speedup over there from this. We spend a lot of time in _copytobuffer.

I'm not sure if you would want the inplace applied to all potential inputs (i.e. ind as well) or just the outputs. Seems best to make it all to avoid the copy if possible.

  • Tests added
  • Fully documented, including history.rst for all changes and api/*.rst for new API

@snowman2 snowman2 added this to the 3.5.0 milestone Dec 16, 2022
@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #1201 (f571212) into main (c560046) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1201   +/-   ##
=======================================
  Coverage   96.25%   96.25%           
=======================================
  Files          20       20           
  Lines        1791     1791           
=======================================
  Hits         1724     1724           
  Misses         67       67           
Impacted Files Coverage Δ
pyproj/geod.py 97.38% <100.00%> (ø)

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

@snowman2
Copy link
Member

Looks good. Thanks 👍

@snowman2 snowman2 merged commit 67558d9 into pyproj4:main Dec 16, 2022
@greglucas greglucas deleted the geod-inplace branch December 16, 2022 03:51
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.

2 participants