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

Fix Scene.available_composite_names showing unavailable composites #921

Merged
merged 4 commits into from
Oct 8, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Oct 3, 2019

This fixes an issue where Scene.available_composite_names would list composites that had missing dependencies. This has been happening for a long time apparently. So long that I don't even know how the previous code ever worked. @yufeizhu600 first pointed this out in #853 and if he could test this it would be much appreciated.

This PR mainly affects:

  1. Scene.available_composite_ids/names
  2. Scene.all_composite_ids/names

I've marked this as backwards-incompatible because I had to remove some functionality (kwargs) that didn't actually do anything useful and removed some functionality that I though would rarely be used. Mainly filtering what composites are shown by specifying what reader or sensors the compositors were based on or configured for. This is an unlikely use case so I made it so these keyword arguments can not be passed to the above mentioned methods.

The "available" methods now return the right composites from what I can tell. What might be surprising to some users is that all now returns less composites than it did before. That's because it is now checking that it actually knows about the dependencies required for a composite rather than just listing all configured composites. So if a generic Vis/IR composite asks for 11.0um band but the reader we are using will never have that band then that composite is not shown in all_composite_ids (or available_composite_ids either); previously it was.

@djhoese djhoese added bug component:scene backwards-incompatibility Causes backwards incompatibility or introduces a deprecation labels Oct 3, 2019
@djhoese djhoese self-assigned this Oct 3, 2019
@coveralls
Copy link

coveralls commented Oct 3, 2019

Coverage Status

Coverage increased (+0.03%) to 85.378% when pulling ee9a108 on djhoese:bugfix-available-composites into 95b0aea on pytroll:master.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

Just few comments.

satpy/node.py Outdated Show resolved Hide resolved
satpy/readers/yaml_reader.py Outdated Show resolved Hide resolved
satpy/scene.py Outdated Show resolved Hide resolved
satpy/scene.py Outdated Show resolved Hide resolved
@yufeizhu600
Copy link
Contributor

I have tested the PR, it works as I expected now. Thanks.

Copy link
Member

@sfinkens sfinkens 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 still struggling with this part of the code, but these changes make it more clear and thanks to all the new docstrings it is easier to understand now! 👍

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.

Quickly tested with modis data, nothing bad to report. LGTM.

@mraspaud mraspaud merged commit 83aff85 into pytroll:master Oct 8, 2019
@mraspaud mraspaud added this to the v0.17.1 milestone Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatibility Causes backwards incompatibility or introduces a deprecation bug component:scene
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scene.available_composite_names() return a composite even the dependency is not fullfilled
6 participants