-
Notifications
You must be signed in to change notification settings - Fork 295
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
Add Scene function to use Hvplot backend visualization #2106
Conversation
New function to plot Scene datasets as Hvplot Overlay
to_hvplot function plot the Scene datasets as Hvplot Overlay. Added Luca Merucci in authors.md (we create this function together )
correction whitespaces, import libraries at beginning
I added hvplot in extra and test sections of setup.py . But hvplot not found error keeps happening |
Add it to https://github.com/pytroll/satpy/blob/main/continuous_integration/environment.yaml Also, please wrap the import in
then later in your code do something like |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2106 +/- ##
==========================================
- Coverage 95.35% 95.35% -0.01%
==========================================
Files 371 371
Lines 52464 52521 +57
==========================================
+ Hits 50028 50082 +54
- Misses 2436 2439 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 7220473626
💛 - Coveralls |
Test for areadefinition data (single band and rgb). Test for swath data (only single band)
satpy/scene.py
Outdated
if hvplot_xarray is None: | ||
raise ImportError("'hvplot' must be installed to use this feature") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if hvplot_xarray is None: | |
raise ImportError("'hvplot' must be installed to use this feature") | |
import hvplot.xarray as hvplot_xarray |
As Martin has suggested I'm importing directly inside method the hvplot library to remove an if condition and resolve "too complex" pre-commit control
This reverts commit 807357a.
I added the holoviews module in setup file but Sphinx keep reporting "missing module error" |
I added the tests :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Could we please get a follow up pull request that moves this functionality to a function in: https://github.com/pytroll/satpy/blob/main/satpy/_scene_converters.py This is a lot of code to add to an already bloated scene.py module. This |
As requested by David in pytroll#2106
This pull request is my attempt to do something similar to "to_geoviews" function.
Hvplot syntax is easier than geoviews. In this case input datasets are optional. If no dataset is selected as input all scene variable keys is plotted and available in the output as obj.variable
It is no very fast, especially when there are many datasets and/or high definition coastlines. But for the time being it is ok. Future improvements may be to use multiprocessing library inside the function.