Antonio Valentino pushed to branch master at Debian GIS Project / trollimage
Commits: 7adab2de by Antonio Valentino at 2022-03-06T08:51:57+00:00 New upstream version 1.18.2 - - - - - 7f15b8e2 by Antonio Valentino at 2022-03-06T08:52:04+00:00 Update upstream source from tag 'upstream/1.18.2' Update to upstream version '1.18.2' with Debian dir 7aabda0efa47f9bb16090b79eb35c48c58ed5a28 - - - - - ca434d61 by Antonio Valentino at 2022-03-06T08:52:42+00:00 New upstream release - - - - - d193ed88 by Antonio Valentino at 2022-03-06T08:56:15+00:00 Refresh all patches - - - - - 2ce51e49 by Antonio Valentino at 2022-03-06T08:57:11+00:00 Set distribution to unstable - - - - - 7 changed files: - CHANGELOG.md - RELEASING.md - debian/changelog - debian/patches/0001-No-display.patch - trollimage/tests/test_image.py - trollimage/version.py - trollimage/xrimage.py Changes: ===================================== CHANGELOG.md ===================================== @@ -1,3 +1,14 @@ +## Version 1.18.2 (2022/03/04) + +### Pull Requests Merged + +#### Bugs fixed + +* [PR 103](https://github.com/pytroll/trollimage/pull/103) - Fix geotiff scale/offset failing for non-linear enhancements + +In this release 1 pull request was closed. + + ## Version 1.18.1 (2022/02/28) ### Pull Requests Merged ===================================== RELEASING.md ===================================== @@ -6,7 +6,7 @@ 4. run `loghub` and update the `CHANGELOG.md` file: ``` - loghub pytroll/trollimage --token $LOGHUB_GITHUB_TOKEN -st v<previous version> -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes" -plg backwards-incompatibility "Backward incompatible changes" -plg refactor "Refactoring" + loghub pytroll/trollimage --token $LOGHUB_GITHUB_TOKEN -st $(git tag --sort=-version:refname --list 'v*' | head -n 1) -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes" -plg backwards-incompatibility "Backward incompatible changes" -plg refactor "Refactoring" ``` This uses a `LOGHUB_GITHUB_TOKEN` environment variable. This must be created ===================================== debian/changelog ===================================== @@ -1,3 +1,10 @@ +trollimage (1.18.2-1) unstable; urgency=medium + + * New upstream release. + * Refresh all patches. + + -- Antonio Valentino <[email protected]> Sun, 06 Mar 2022 08:56:35 +0000 + trollimage (1.18.1-1) unstable; urgency=medium * New upstream release. ===================================== debian/patches/0001-No-display.patch ===================================== @@ -8,10 +8,10 @@ Skip tests that require display. 1 file changed, 1 insertion(+) diff --git a/trollimage/tests/test_image.py b/trollimage/tests/test_image.py -index 4a934b3..8fc83d5 100644 +index 0d8497d..fe43b68 100644 --- a/trollimage/tests/test_image.py +++ b/trollimage/tests/test_image.py -@@ -1899,6 +1899,7 @@ class TestXRImage: +@@ -1865,6 +1865,7 @@ class TestXRImage: """Test putalpha.""" pass ===================================== trollimage/tests/test_image.py ===================================== @@ -2193,10 +2193,10 @@ class TestXRImagePalettize: np.testing.assert_allclose(new_brbg.colors, loaded_brbg.colors) -class TestXRImageSaveScaleOffset(unittest.TestCase): +class TestXRImageSaveScaleOffset: """Test case for saving an image with scale and offset tags.""" - def setUp(self) -> None: + def setup_method(self) -> None: """Set up the test case.""" from trollimage import xrimage data = xr.DataArray(np.arange(25).reshape(5, 5, 1), dims=[ @@ -2214,6 +2214,12 @@ class TestXRImageSaveScaleOffset(unittest.TestCase): expected_tags, include_scale_offset_tags=True) + def test_gamma_geotiff_scale_offset(self, tmp_path): + """Test that saving gamma-enhanced data to a geotiff doesn't fail.""" + self.img.gamma(.5) + out_fn = str(tmp_path / "test.tif") + self.img.save(out_fn, scale_offset_tags=("scale", "offset")) + def _save_and_check_tags(self, expected_tags, **kwargs): with NamedTemporaryFile(suffix='.tif') as tmp: self.img.save(tmp.name, **kwargs) ===================================== trollimage/version.py ===================================== @@ -23,9 +23,9 @@ def get_keywords(): # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (HEAD -> main, tag: v1.18.1)" - git_full = "00cdfc459c7b24e512ae47d33e97b0c50c6288a8" - git_date = "2022-02-28 13:49:22 -0600" + git_refnames = " (HEAD -> main, tag: v1.18.2)" + git_full = "e5ddeb0ef5988f307c5f0baa6c8313d6e55a4b64" + git_date = "2022-03-04 09:37:18 -0600" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords ===================================== trollimage/xrimage.py ===================================== @@ -599,9 +599,7 @@ class XRImage(object): if colormap_tag and enhancement_colormap is not None: tags[colormap_tag] = enhancement_colormap.to_csv() if scale_offset_tags: - scale_label, offset_label = scale_offset_tags - scale, offset = self.get_scaling_from_history(data.attrs.get('enhancement_history', [])) - tags[scale_label], tags[offset_label] = invert_scale_offset(scale, offset) + self._add_scale_offset_to_tags(scale_offset_tags, data, tags) # If we are changing the driver then use appropriate kwargs if driver == 'COG': @@ -699,6 +697,15 @@ class XRImage(object): return delay.compute() return delay + def _add_scale_offset_to_tags(self, scale_offset_tags, data_arr, tags): + scale_label, offset_label = scale_offset_tags + try: + scale, offset = self.get_scaling_from_history(data_arr.attrs.get('enhancement_history', [])) + except NotImplementedError: + logger.debug("Ignoring scale/offset tags for non-scaling enhancement operations") + else: + tags[scale_label], tags[offset_label] = invert_scale_offset(scale, offset) + def get_scaling_from_history(self, history=None): """Merge the scales and offsets from the history. View it on GitLab: https://salsa.debian.org/debian-gis-team/trollimage/-/compare/06d9d1f22c6bbc20c4462a34bebd6091fcf73a19...2ce51e494f6bccbaebc67d2e2b1eb82af6b21e82 -- View it on GitLab: https://salsa.debian.org/debian-gis-team/trollimage/-/compare/06d9d1f22c6bbc20c4462a34bebd6091fcf73a19...2ce51e494f6bccbaebc67d2e2b1eb82af6b21e82 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
