Confusing and missing Deprecation-/FutureWarnings for ImageContainer and pyresample.bilinear
Open
@pnuu is already working on this.
Since Dec 23, 2020.
documentation
- Dominant language
- Python
- Stars
- 385
- Forks
- 102
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
Code Sample, a minimal, complete, and verifiable piece of code
import numpy as np
from pyresample import image, geometry
area_def = geometry.AreaDefinition('areaD', 'Europe (3km, HRV, VTC)', 'areaD',
{'a': '6378144.0', 'b': '6356759.0',
'lat_0': '50.00', 'lat_ts': '50.00',
'lon_0': '8.00', 'proj': 'stere'},
800, 800,
[-1370912.72, -909968.64,
1029087.28, 1490031.36])
msg_area = geometry.AreaDefinition('msg_full', 'Full globe MSG image 0 degrees',
'msg_full',
{'a': '6378169.0', 'b': '6356584.0',
'h': '35785831.0', 'lon_0': '0',
'proj': 'geos'},
3712, 3712,
[-5568742.4, -5568742.4,
5568742.4, 5568742.4])
data = np.ones((3712, 3712))
msg_con_quick = image.ImageContainerNearest(data, msg_area, radius_of_influence=1000)
Problem description
A few issues are present on the Deprecation warnings:
- Initialising
ImageContainerNearest,ImageContainerQuick, etc. initializesImageContainer, which triggers a FutureWarning saying thatNumpyResamplerBilinearshould be used instead. This is a bit confusing for a user that doesn't want to use bilinear resampling, but another of the available algorithms. The FutureWarning should rather be something likeThe pyresample.image module is deprecated. Please use pyresample.kd_tree or pyresample.bilinear instead., as given in the documentation note: https://pyresample.readthedocs.io/en/latest/grid.html#pyresample-image - The note of the previous link is present only in the documentation page for gridded data, but is missing for the swath data here
https://pyresample.readthedocs.io/en/latest/swath.html#pyresample-image. - In several places (here here here) FutureWarnings indicate the usage of
NumpyResamplerBilinear. However, that class is deprecated and triggers a warning indicating to useNumpyBilinearResampler. It would be better if the updated class would be indicated in all the warnings.
Expected Output
Updated and correct Deprecation/FutureWarnings
Actual Result, Traceback if applicable
/tcenas/home/andream/code/fire_val_packages/pyresample/pyresample/image.py:62: FutureWarning: Usage of ImageContainer is deprecated, please use NumpyResamplerBilinear class instead
FutureWarning)
Versions of Python, package at hand and relevant dependencies
Pyresample 1.17.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.