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 error when calling to_xarray_dataset on an empty scene #1698

Merged
merged 2 commits into from
Jun 7, 2021

Conversation

BENR0
Copy link
Collaborator

@BENR0 BENR0 commented May 28, 2021

If to_xarray_dataset is called on an empty Scene instead of an error an empty xarray dataset is now returned.

@BENR0 BENR0 requested review from djhoese and mraspaud as code owners May 28, 2021 12:32
@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #1698 (23168a6) into main (25993ff) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1698      +/-   ##
==========================================
+ Coverage   92.32%   92.42%   +0.10%     
==========================================
  Files         258      258              
  Lines       38125    37625     -500     
==========================================
- Hits        35200    34776     -424     
+ Misses       2925     2849      -76     
Flag Coverage Δ
behaviourtests 4.65% <0.00%> (-0.19%) ⬇️
unittests 92.98% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/scene.py 92.22% <100.00%> (-0.07%) ⬇️
satpy/tests/test_scene.py 99.44% <100.00%> (+<0.01%) ⬆️
satpy/tests/features/steps/steps-load.py 49.12% <0.00%> (-6.94%) ⬇️
...ts/features/steps/steps-real-load-process-write.py 30.76% <0.00%> (-4.95%) ⬇️
satpy/readers/maia.py 19.27% <0.00%> (-1.90%) ⬇️
satpy/readers/abi_base.py 93.00% <0.00%> (-1.59%) ⬇️
satpy/readers/goes_imager_nc.py 63.88% <0.00%> (-1.59%) ⬇️
satpy/readers/__init__.py 95.51% <0.00%> (-1.16%) ⬇️
satpy/readers/olci_nc.py 90.29% <0.00%> (-1.14%) ⬇️
satpy/readers/viirs_edr_active_fires.py 89.28% <0.00%> (-1.04%) ⬇️
... and 151 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 25993ff...23168a6. Read the comment docs.

@coveralls
Copy link

coveralls commented May 28, 2021

Coverage Status

Coverage increased (+0.2%) to 93.041% when pulling 23168a6 on BENR0:fix_to_xarray_dataset_empty_scene into 25993ff on pytroll:main.

@gerritholl
Copy link
Member

This needs a unit test. It should be quite easy to write a unit test for this case.

@djhoese
Copy link
Member

djhoese commented Jun 5, 2021

@BENR0 Can you add a small test for this?

@BENR0
Copy link
Collaborator Author

BENR0 commented Jun 7, 2021

@djhoese Added a test for the empty Scene.

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.

Thanks!

@djhoese djhoese changed the title Fix empty scene call of to_xarray_dataset raising error Fix error when calling to_xarray_dataset on an empty scene Jun 7, 2021
@djhoese djhoese merged commit a2cfa24 into pytroll:main Jun 7, 2021
@BENR0 BENR0 deleted the fix_to_xarray_dataset_empty_scene branch June 7, 2021 18:25
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.

to_xarray_dataset on empty scene fails with TypeError
4 participants