Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Add upstream patch to fix FTBFS on 32bit architectures.
· 466bfe9a
Bas Couwenberg
authored
Dec 02, 2018
466bfe9a
Set distribution to unstable.
· 1a90cd94
Bas Couwenberg
authored
Dec 02, 2018
1a90cd94
Show whitespace changes
Inline
Side-by-side
debian/changelog
View file @
1a90cd94
cftime (1.0.3-2) unstable; urgency=medium
* Add upstream patch to fix FTBFS on 32bit architectures.
-- Bas Couwenberg <sebastic@debian.org> Sun, 02 Dec 2018 18:19:52 +0100
cftime (1.0.3-1) unstable; urgency=medium
* New upstream release.
...
...
debian/patches/pr94_numpy-int32.patch
0 → 100644
View file @
1a90cd94
Description: Fix FTBFS on 32bit architectures.
TypeError: object of type 'numpy.int32' has no len()
Author: Jeff Whitaker <jswhit@fastmail.fm>
Origin: https://github.com/Unidata/cftime/pull/94
Bug: https://github.com/Unidata/cftime/issues/93
--- a/cftime/_cftime.pyx
+++ b/cftime/_cftime.pyx
@@ -455,7 +455,7 @@
def DateFromJulianDay(JD, calendar='stan
# get the day (Z) and the fraction of the day (F)
# use 'round half up' rounding instead of numpy's even rounding
# so that 0.5 is rounded to 1.0, not 0 (cftime issue #49)
- Z = np.int32(_round_half_up(julian))
+ Z = np.atleast_1d(np.int32(_round_half_up(julian)))
F = (julian + 0.5 - Z).astype(np.longdouble)
cdef Py_ssize_t i_max = len(Z)
@@ -498,7 +498,7 @@
def DateFromJulianDay(JD, calendar='stan
# recomputing year,month,day etc
# ms_eps is proportional to julian day,
# about 47 microseconds in 2000 for Julian base date in -4713
- ms_eps = np.array(np.finfo(np.float64).eps,np.longdouble)
+ ms_eps = np.atleast_1d(np.array(np.finfo(np.float64).eps,np.longdouble))
ms_eps = 86400000000.*np.maximum(ms_eps*julian, ms_eps)
microsecond = np.where(microsecond < ms_eps, 0, microsecond)
indxms = microsecond > 1000000-ms_eps
--- a/test/test_cftime.py
+++ b/test/test_cftime.py
@@ -354,7 +354,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (microsecs) = %s eps = %s' % \
+ print('calendar = %s max abs err (microsecs) = %s eps = %s' % \
(calendar,maxerr,eps))
units = 'milliseconds since 1800-01-30 01:01:01'
eps = 0.1
@@ -370,7 +370,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (millisecs) = %s eps = %s' % \
+ print('calendar = %s max abs err (millisecs) = %s eps = %s' % \
(calendar,maxerr,eps))
eps = 1.e-3
units = 'seconds since 0001-01-30 01:01:01'
@@ -386,7 +386,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (secs) = %s eps = %s' % \
+ print('calendar = %s max abs err (secs) = %s eps = %s' % \
(calendar,maxerr,eps))
eps = 1.e-5
units = 'minutes since 0001-01-30 01:01:01'
@@ -402,7 +402,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (mins) = %s eps = %s' % \
+ print('calendar = %s max abs err (mins) = %s eps = %s' % \
(calendar,maxerr,eps))
eps = 1.e-6
units = 'hours since 0001-01-30 01:01:01'
@@ -418,7 +418,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (hours) = %s eps = %s' % \
+ print('calendar = %s max abs err (hours) = %s eps = %s' % \
(calendar,maxerr,eps))
eps = 1.e-8
units = 'days since 0001-01-30 01:01:01'
@@ -434,7 +434,7 @@
class cftimeTestCase(unittest.TestCase):
assert(err < eps)
assert(date1.strftime(dateformat) == date2.strftime(dateformat))
if verbose:
- print('calender = %s max abs err (days) = %s eps = %s' % \
+ print('calendar = %s max abs err (days) = %s eps = %s' % \
(calendar,maxerr,eps))
# issue 353
debian/patches/series
View file @
1a90cd94
dont-cythonize-in-clean-target.patch
pr94_numpy-int32.patch