[Git][debian-gis-team/pyninjotiff][upstream] New upstream version 0.4.4

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Tue Dec 16 06:47:08 GMT 2025



Antonio Valentino pushed to branch upstream at Debian GIS Project / pyninjotiff


Commits:
80b3a750 by Antonio Valentino at 2025-12-16T06:35:32+00:00
New upstream version 0.4.4
- - - - -


6 changed files:

- .github/workflows/deploy-sdist.yaml
- .pre-commit-config.yaml
- CHANGELOG.md
- pyninjotiff/ninjotiff.py
- pyninjotiff/tests/test_ninjotiff.py
- pyninjotiff/tifffile.py


Changes:

=====================================
.github/workflows/deploy-sdist.yaml
=====================================
@@ -11,10 +11,17 @@ jobs:
 
     steps:
       - name: Checkout source
-        uses: actions/checkout at v2
+        uses: actions/checkout at v5
 
-      - name: Install Poetry
-        uses: abatilo/actions-poetry at v2.0.0
+      - name: Create sdist
+        shell: bash -l {0}
+        run: |
+          python -m pip install -q build
+          python -m build -s
 
-      - name: Build and publish
-        run: poetry publish --build -u __token__ -p ${{ secrets.pypi_password }}
+      - name: Publish package to PyPI
+        if: github.event.action == 'published'
+        uses: pypa/gh-action-pypi-publish at v1.13.0
+        with:
+          user: __token__
+          password: ${{ secrets.pypi_password }}


=====================================
.pre-commit-config.yaml
=====================================
@@ -1,8 +1,15 @@
-exclude: '^$'
+exclude: "^$"
 fail_fast: false
+
 repos:
--   repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v2.2.3
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    # Ruff version.
+    rev: "v0.14.9"
     hooks:
-    - id: flake8
-      additional_dependencies: [flake8-docstrings, flake8-debugger, flake8-bugbear]
+      - id: ruff
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v6.0.0
+    hooks:
+      - id: trailing-whitespace
+      - id: end-of-file-fixer
+      - id: no-commit-to-branch


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,31 @@
+## Version 0.4.4 (2025/12/15)
+
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 37](https://github.com/pytroll/pyninjotiff/pull/37) - Fix sdist and precommit
+
+In this release 1 pull request was closed.
+
+
+## Version 0.4.3 (2025/12/15)
+
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 36](https://github.com/pytroll/pyninjotiff/pull/36) - Fix compatibility with numpy 2.3
+
+#### Features added
+
+* [PR 34](https://github.com/pytroll/pyninjotiff/pull/34) - remove stray six usage
+
+In this release 2 pull requests were closed.
+
+
 ## Version 0.4.2 (2025/09/03)
 
 
@@ -13,5 +41,3 @@
 * [PR 30](https://github.com/pytroll/pyninjotiff/pull/30) - Add test deployment to pypi
 
 In this release 2 pull requests were closed.
-
-


=====================================
pyninjotiff/ninjotiff.py
=====================================
@@ -209,7 +209,7 @@ class ProductConfigs(object):
 
     def read_config(self, config_filename=None):
         """Read the ninjo products config file."""
-        from six.moves.configparser import RawConfigParser
+        from configparser import RawConfigParser
         import ast
 
         def _eval(val):


=====================================
pyninjotiff/tests/test_ninjotiff.py
=====================================
@@ -519,7 +519,10 @@ def test_write_rgb_tb():
         for key, val in tags.items():
             if key in ['datetime', '40002', '40003', '40006']:
                 continue
-            assert(val == read_tags[key].value)
+            if np.asarray(val).dtype.kind == "f":
+                np.testing.assert_allclose(val, read_tags[key].value)
+            else:
+                assert(val == read_tags[key].value)
 
 
 @pytest.mark.skip(reason="this is no implemented yet.")


=====================================
pyninjotiff/tifffile.py
=====================================
@@ -1889,13 +1889,13 @@ class TiffPage(object):
 
                 def unpack(x):
                     try:
-                        return numpy.fromstring(x, typecode)
+                        return numpy.frombuffer(x, typecode)
                     except ValueError as e:
                         # strips may be missing EOI
                         warnings.warn("unpack: %s" % e)
                         xlen = ((len(x) // (bits_per_sample // 8))
                                 * (bits_per_sample // 8))
-                        return numpy.fromstring(x[:xlen], typecode)
+                        return numpy.frombuffer(x[:xlen], typecode)
 
             elif isinstance(bits_per_sample, tuple):
                 def unpack(x):
@@ -2724,7 +2724,7 @@ class FileHandle(object):
             else:
                 size = count * numpy.dtype(dtype).itemsize
             data = self._fh.read(size)
-            return numpy.fromstring(data, dtype, count, sep)
+            return numpy.frombuffer(data, dtype, count, sep)
 
     def read_record(self, dtype, shape=1, byteorder=None):
         """Return numpy record from file."""
@@ -2737,7 +2737,7 @@ class FileHandle(object):
                 shape = self._size // dtype.itemsize
             size = product(sequence(shape)) * dtype.itemsize
             data = self._fh.read(size)
-            return numpy.rec.fromstring(data, dtype, shape,
+            return numpy.rec.frombuffer(data, dtype, shape,
                                         byteorder=byteorder)
         return rec[0] if shape == 1 else rec
 
@@ -2800,7 +2800,7 @@ class FileHandle(object):
 def read_bytes(fh, byteorder, dtype, count):
     """Read tag data from file and return as byte string."""
     dtype = 'b' if dtype[-1] == 's' else byteorder+dtype[-1]
-    return fh.read_array(dtype, count).tostring()
+    return fh.read_array(dtype, count).tobytes()
 
 
 def read_numpy(fh, byteorder, dtype, count):
@@ -3168,7 +3168,7 @@ def imagej_metadata(data, bytecounts, byteorder):
 
     def read_bytes(data, byteorder):
         #return struct.unpack('b' * len(data), data)
-        return numpy.fromstring(data, 'uint8')
+        return numpy.frombuffer(data, 'uint8')
 
     metadata_types = {  # big endian
         b'info': ('info', read_string),
@@ -3264,7 +3264,7 @@ def decodejpg(encoded, tables=b'', photometric=None,
     if photometric == 'rgb' and ycbcr_subsampling and ycbcr_positioning:
         # TODO: convert YCbCr to RGB
         pass
-    return image.tostring()
+    return image.tobytes()
 
 
 @_replace_by('_tifffile.decodepackbits')
@@ -3396,7 +3396,7 @@ def unpackints(data, dtype, itemsize, runlen=0):
 
     """
     if itemsize == 1:  # bitarray
-        data = numpy.fromstring(data, '|B')
+        data = numpy.frombuffer(data, '|B')
         data = numpy.unpackbits(data)
         if runlen % 8:
             data = data.reshape(-1, runlen + (8 - runlen % 8))
@@ -3405,7 +3405,7 @@ def unpackints(data, dtype, itemsize, runlen=0):
 
     dtype = numpy.dtype(dtype)
     if itemsize in (8, 16, 32, 64):
-        return numpy.fromstring(data, dtype)
+        return numpy.frombuffer(data, dtype)
     if itemsize < 1 or itemsize > 32:
         raise ValueError("itemsize out of range: %i" % itemsize)
     if dtype.kind not in "biu":
@@ -3481,7 +3481,7 @@ def unpackrgb(data, dtype='<B', bitspersample=(5, 6, 5), rescale=True):
     if not (bits <= 32 and all(i <= dtype.itemsize*8 for i in bitspersample)):
         raise ValueError("sample size not supported %s" % str(bitspersample))
     dt = next(i for i in 'BHI' if numpy.dtype(i).itemsize*8 >= bits)
-    data = numpy.fromstring(data, dtype.byteorder+dt)
+    data = numpy.frombuffer(data, dtype.byteorder+dt)
     result = numpy.empty((data.size, len(bitspersample)), dtype.char)
     for i, bps in enumerate(bitspersample):
         t = data >> int(numpy.sum(bitspersample[i+1:]))



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyninjotiff/-/commit/80b3a75072d262b32b8436e8a3afbc5a00ea80b6

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyninjotiff/-/commit/80b3a75072d262b32b8436e8a3afbc5a00ea80b6
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20251216/18ae9025/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list