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

BUG: Ensure numpy masked arrays stay masked after projection #1103

Merged

Conversation

paultcochrane
Copy link
Contributor

As noted in #1102, projecting numpy masked arrays returned numpy masked
arrays in the 2.x series of pyproj. This behaviour changed in commit
4ab3ff7 as part of the 3.x series, where a "plain" numpy ndarray was returned. The change
implemented here ensures that projecting numpy masked arrays returns
masked arrays as was previously the case.

I'm fairly sure that the fix I've implemented here does actually fix the issue mentioned in #1102; nevertheless, please review my changes carefully as I'm not very familiar with this codebase.

@codecov
Copy link

codecov bot commented Jul 10, 2022

Codecov Report

Merging #1103 (0808144) into main (7a239cd) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1103   +/-   ##
=======================================
  Coverage   96.15%   96.15%           
=======================================
  Files          20       20           
  Lines        1794     1794           
=======================================
  Hits         1725     1725           
  Misses         69       69           
Impacted Files Coverage Δ
pyproj/utils.py 82.81% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a239cd...0808144. Read the comment docs.

pyproj/utils.py Outdated Show resolved Hide resolved
As noted in pyproj4#1102, projecting numpy masked arrays returned numpy masked
arrays in the 2.x series of pyproj.  This behaviour changed in commit
4ab3ff7 as part of the 3.x series, where a "plain" numpy ndarray was
returned.  The change implemented here ensures that projecting numpy
masked arrays returns masked arrays as was previously the case.
@paultcochrane paultcochrane force-pushed the 1102-keep-numpy-masked-arrays-masked branch from b3a47ca to 0808144 Compare July 11, 2022 14:51
@snowman2 snowman2 changed the title Ensure numpy masked arrays stay masked after projection BUG: Ensure numpy masked arrays stay masked after projection Jul 11, 2022
@snowman2 snowman2 added the bug label Jul 11, 2022
@snowman2 snowman2 added this to In progress in 3.4.0 Release via automation Jul 11, 2022
@snowman2
Copy link
Member

Thanks @paultcochrane 👍

@snowman2 snowman2 merged commit 0ed6340 into pyproj4:main Jul 11, 2022
3.4.0 Release automation moved this from In progress to Done Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Projecting numpy masked arrays returns plain numpy arrays
2 participants