Étienne Mollier pushed to branch master at Debian Med / pynn
Commits: a29d8e05 by Étienne Mollier at 2023-01-14T15:23:16+01:00 numpy1.24.patch: add; fix test failures with numpy 1.24. - - - - - 98bdfa1b by Étienne Mollier at 2023-01-14T15:25:47+01:00 d/copyright: bump copyright year. - - - - - b33fe3a9 by Étienne Mollier at 2023-01-14T15:29:08+01:00 ready to upload to unstable. - - - - - 4 changed files: - debian/changelog - debian/copyright - + debian/patches/numpy1.24.patch - + debian/patches/series Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,11 @@ +pynn (0.10.1-2) unstable; urgency=medium + + * numpy1.24.patch: add; fix test failures with numpy 1.24. + (Closes: #1028812) + * d/copyright: bump copyright year. + + -- Étienne Mollier <[email protected]> Sat, 14 Jan 2023 15:28:08 +0100 + pynn (0.10.1-1) unstable; urgency=medium * New upstream version ===================================== debian/copyright ===================================== @@ -15,7 +15,7 @@ Files: debian/* Copyright: 2010-2011, Yaroslav Halchenko <[email protected]> 2012, Michael Hanke <[email protected]> 2020, Andreas Tille <[email protected]> - 2021-2022, Étienne Mollier <[email protected]> + 2021-2023, Étienne Mollier <[email protected]> License: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ===================================== debian/patches/numpy1.24.patch ===================================== @@ -0,0 +1,79 @@ +Description: fix test failures with numpy 1.24. +Author: Étienne Mollier <[email protected]> +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1028812 +Forwarded: no +Last-Update: 2023-01-14 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- pynn.orig/pyNN/common/populations.py ++++ pynn/pyNN/common/populations.py +@@ -261,7 +261,7 @@ + assert isinstance(n, int) + if not rng: + rng = random.NumpyRNG() +- indices = rng.permutation(np.arange(len(self), dtype=np.int))[0:n] ++ indices = rng.permutation(np.arange(len(self), dtype=int))[0:n] + logger.debug("The %d cells selected have indices %s" % (n, indices)) + logger.debug("%s.sample(%s)", self.label, n) + return self._get_view(indices) +@@ -658,7 +658,7 @@ + else: + raise Exception( + "A maximum of 3 dimensions is allowed. What do you think this is, string theory?") +- # NEST doesn't like np.int, so to be safe we cast to Python int ++ # NEST doesn't like int, so to be safe we cast to Python int + size = int(reduce(operator.mul, size)) + self.size = size + self.label = label or 'population%d' % Population._nPop +@@ -718,7 +718,7 @@ + if (self.first_id > id.min()) or (self.last_id < id.max()): + raise ValueError("ids should be in the range [%d,%d], actually [%d, %d]" % ( + self.first_id, self.last_id, id.min(), id.max())) +- return (id - self.first_id).astype(np.int) # this assumes ids are consecutive ++ return (id - self.first_id).astype(int) # this assumes ids are consecutive + + def id_to_local_index(self, id): + """ +@@ -906,7 +906,7 @@ + if self._is_sorted: + return np.searchsorted(self.all_cells, id) + else: +- result = np.array([], dtype=np.int) ++ result = np.array([], dtype=int) + for item in id: + data = np.where(self.all_cells == item)[0] + if len(data) == 0: +@@ -1159,7 +1159,7 @@ + if self._is_sorted: + return np.searchsorted(all_cells, id) + else: +- result = np.array([], dtype=np.int) ++ result = np.array([], dtype=int) + for item in id: + data = np.where(all_cells == item)[0] + if len(data) == 0: +@@ -1261,7 +1261,7 @@ + assert isinstance(n, int) + if not rng: + rng = random.NumpyRNG() +- indices = rng.permutation(np.arange(len(self), dtype=np.int))[0:n] ++ indices = rng.permutation(np.arange(len(self), dtype=int))[0:n] + logger.debug("The %d cells recorded have indices %s" % (n, indices)) + logger.debug("%s.sample(%s)", self.label, n) + return self[indices] +--- pynn.orig/pyNN/random.py ++++ pynn/pyNN/random.py +@@ -136,11 +136,11 @@ + elif n > 0: + if mask is not None: + assert isinstance(mask, np.ndarray) +- if mask.dtype == np.bool: ++ if mask.dtype == bool: + if mask.size != n: + raise ValueError("boolean mask size must equal n") + if not self.parallel_safe: +- if mask.dtype == np.bool: ++ if mask.dtype == bool: + n = mask.sum() + elif mask.dtype == np.integer: + n = mask.size ===================================== debian/patches/series ===================================== @@ -0,0 +1 @@ +numpy1.24.patch View it on GitLab: https://salsa.debian.org/med-team/pynn/-/compare/4c005e2648470fbb4837126dd0d0ac6592773597...b33fe3a9928f928100bd573fae1f128445460789 -- View it on GitLab: https://salsa.debian.org/med-team/pynn/-/compare/4c005e2648470fbb4837126dd0d0ac6592773597...b33fe3a9928f928100bd573fae1f128445460789 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
