[med-svn] [Git][med-team/python-biopython][master] fix-type-cast-i386.patch: new: fix PDB test failure on 32-bit.
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Mon Sep 16 19:29:03 BST 2024
Étienne Mollier pushed to branch master at Debian Med / python-biopython
Commits:
b096ace0 by Étienne Mollier at 2024-09-16T20:28:21+02:00
fix-type-cast-i386.patch: new: fix PDB test failure on 32-bit.
- - - - -
2 changed files:
- + debian/patches/fix-type-cast-i386.patch
- debian/patches/series
Changes:
=====================================
debian/patches/fix-type-cast-i386.patch
=====================================
@@ -0,0 +1,26 @@
+--- python-biopython.orig/Bio/PDB/binary_cif.py
++++ python-biopython/Bio/PDB/binary_cif.py
+@@ -3,6 +3,7 @@
+ """
+
+ import gzip
++import sys
+ from collections import deque
+ from typing import Optional
+
+@@ -82,7 +83,14 @@
+
+ data = column["data"]["data"]
+ dtype = _dtypes[encoding["srcType"]]
+- decoded_data = np.repeat(data[::2].astype(dtype), data[1::2])
++ if sys.maxsize == 2**63 - 1:
++ # We're running classical 64-bit platform here.
++ decoded_data = np.repeat(data[::2].astype(dtype), data[1::2])
++ else:
++ # We're assuming 32-bit platform here, numpy croaks on unsafe
++ # type casts.
++ decoded_data = np.repeat(data[::2].astype('int32', casting='unsafe'),
++ data[1::2].astype('int32', casting='unsafe'))
+
+ assert len(decoded_data) == encoding["srcSize"]
+ column["data"]["data"] = decoded_data
=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ muscle3.patch
#port_tutorial_to_muscle3.patch
skip-scipy-in-codonalign.patch
0010-Python-3.13-Replace-deprecated-PyEval_CallObject.patch
+fix-type-cast-i386.patch
View it on GitLab: https://salsa.debian.org/med-team/python-biopython/-/commit/b096ace064e13939b8bf960e3830a86872443178
--
View it on GitLab: https://salsa.debian.org/med-team/python-biopython/-/commit/b096ace064e13939b8bf960e3830a86872443178
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/debian-med-commit/attachments/20240916/cec140d4/attachment-0001.htm>
More information about the debian-med-commit
mailing list