sentinelhub-py icon indicating copy to clipboard operation
sentinelhub-py copied to clipboard

[FEAT] 1st example cannot be replicated because of missing `utils.plot_image`

Open mkadunc opened this issue 3 years ago • 2 comments

What is the problem? Please describe.

I tried to follow the first example provided in the documentation https://sentinelhub-py.readthedocs.io/en/latest/examples/process_request.html#Imports and got stuck when trying to render the downloaded image - the example notebook references utils.plot_image which I have no idea how to get to.

Here's the solution ?

Alternatives

  • Provide the utility function on each example page.
  • provide the plot_image as part of the sentinelhub-py package
  • make some other mention (e.g. in the imports section) to help the user get to this function (e.g. link to https://github.com/sentinel-hub/sentinelhub-py/blob/master/examples/utils.py)

mkadunc avatar Jul 17 '22 18:07 mkadunc

For now you have to have utils.py script in the same folder as the notebook that you are running. Then the import should work.

But I agree, it is confusing for users and we got the same question a few times in the past. As suggested, we could:

  • Short-term: add a comment into notebooks explaining where the utility function is being imported from. :heavy_check_mark:
  • Long-term: add plotting functions into sentinelhub-py package. It is already on our internal list of issues but it requires some work. At the moment, matplotlib is not a dependency of sentinelhub-py and we would like to keep it this way. But we can make it an optional dependency if we structure plotting utilities as a package extension.

AleksMat avatar Jul 17 '22 19:07 AleksMat

I think it might make more sense to add the plotting to each notebook. This would make the notebooks more standalone, and perhaps the users more commonly download and run notebooks without cloning/downloading repos.

Also, not sure how much sense it makes to add the matplotlib dependency, unless we have some other plans on how to use it, i.e. automatic batch status plot generation.

mlubej avatar Mar 15 '23 15:03 mlubej