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

Drop non-dimensional coordinates in Compositor #796

Merged
merged 8 commits into from
Jun 12, 2019

Conversation

sfinkens
Copy link
Member

@sfinkens sfinkens commented May 28, 2019

Attempt to fix #795 by dropping non-dimensional coordinates.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have lon and lat as 2d coords? They wont be dimensional, but still should be kept right ?

@BENR0
Copy link
Collaborator

BENR0 commented May 31, 2019

I've come across this too a couple of days ago. Just calling resample after loading fixes this. I don't know how resample handles 2d coords but a similar approach of handling coords could maybe be used here.
Alternatively the proposed fix maybe could include a check for 2d coords (and any other non dim coords which should be kept and is the same over all datasets) demote those to variables, drop every other coord and promote them to coords again afterwards.

@sfinkens
Copy link
Member Author

sfinkens commented Jun 11, 2019

I've implemented @djhoese's suggestion to exclude "neglible" non-dimensional coordinates (defined in a global list). That also preserves 2d lon/lat.

@djhoese
Copy link
Member

djhoese commented Jun 11, 2019

Wasn't the original problem for this PR the acq_time coordinate? You aren't excluding that here, are you? Also, what does PEP257 say about """ comments?

@sfinkens
Copy link
Member Author

@djhoese As you suggested all non-dimensional coordinates with time in their name are excluded. PEP257 says, attribute docstrings are ok and references PEP258 for the details: https://www.python.org/dev/peps/pep-0258/#id40

@djhoese
Copy link
Member

djhoese commented Jun 11, 2019

Ah I missed the in part of that operation. Looks good (including the docstring).

@djhoese
Copy link
Member

djhoese commented Jun 11, 2019

Is this ready for review (still a draft)?

@sfinkens sfinkens marked this pull request as ready for review June 11, 2019 13:46
@sfinkens sfinkens requested a review from djhoese as a code owner June 11, 2019 13:46
@sfinkens
Copy link
Member Author

Added a test, now ready for review!

@codecov
Copy link

codecov bot commented Jun 11, 2019

Codecov Report

Merging #796 into master will increase coverage by 0.66%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #796      +/-   ##
==========================================
+ Coverage   83.06%   83.72%   +0.66%     
==========================================
  Files         163      165       +2     
  Lines       23592    24136     +544     
==========================================
+ Hits        19596    20209     +613     
+ Misses       3996     3927      -69
Impacted Files Coverage Δ
satpy/composites/abi.py 100% <ø> (ø) ⬆️
satpy/tests/compositor_tests/__init__.py 99.52% <100%> (+0.11%) ⬆️
satpy/composites/cloud_products.py 89.06% <100%> (ø) ⬆️
satpy/composites/viirs.py 83.71% <100%> (ø) ⬆️
satpy/composites/ahi.py 100% <100%> (ø) ⬆️
satpy/composites/__init__.py 74.39% <91.66%> (+3.83%) ⬆️
satpy/readers/avhrr_l1b_gaclac.py 90% <0%> (-1.43%) ⬇️
satpy/tests/test_utils.py 98.79% <0%> (-1.21%) ⬇️
satpy/readers/electrol_hrit.py 91.33% <0%> (-0.67%) ⬇️
satpy/readers/seviri_l1b_native.py 61.06% <0%> (-0.28%) ⬇️
... and 144 more

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 a5733f3...d663f2f. Read the comment docs.

@coveralls
Copy link

coveralls commented Jun 11, 2019

Coverage Status

Coverage increased (+0.7%) to 83.73% when pulling d663f2f on sfinkens:fix-composites into a5733f3 on pytroll:master.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I like the simple fix to the problem. Just one change request.

satpy/composites/__init__.py Outdated Show resolved Hide resolved
@sfinkens sfinkens requested a review from adybbroe as a code owner June 12, 2019 07:20
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy now, LGTM :)

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure match is the best name, but it is definitely not the worst. I'd really like if check_areas got its return values back (see comment below).

satpy/composites/__init__.py Show resolved Hide resolved
@mraspaud mraspaud merged commit 07035c3 into pytroll:master Jun 12, 2019
@sfinkens sfinkens deleted the fix-composites branch June 12, 2019 15:12
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.

Composites delayed in the presence of non-dimensional coordinates
5 participants