Repository navigation
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 )
trying to follow and correct stickler-ci messages
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. |
pnuu
left a comment
There was a problem hiding this comment.
Some initial thoughts.
- Couple of suggestions inline for better wording and docstring formatting.
- Could there be some unit tests for
.to_hvplot()with different scenarios that use all the sub-methods? That way possible syntax errors would be revealed. Then perhaps the returned plot could be inspected to have the correct attributes or something like that.
|
Looks good, but would there be a way to add a unittest? |
Pull Request Test Coverage Report for Build 4892941043Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Test for areadefinition data (single band and rgb). Test for swath data (only single band)
| if hvplot_xarray is None: | ||
| raise ImportError("'hvplot' must be installed to use this feature") |
There was a problem hiding this comment.
| 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 :) |
|
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.