[Git][debian-gis-team/cftime][master] 2 commits: Add upstream patches to fix FTBFS on 32bit architectures.

Bas Couwenberg gitlab at salsa.debian.org
Sat Oct 27 15:14:18 BST 2018


Bas Couwenberg pushed to branch master at Debian GIS Project / cftime


Commits:
ec83e490 by Bas Couwenberg at 2018-10-27T13:52:51Z
Add upstream patches to fix FTBFS on 32bit architectures.

- - - - -
3ddc23e6 by Bas Couwenberg at 2018-10-27T14:05:39Z
Set distribution to unstable.

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/0001-change-float128-to-longdouble-to-fix-compilation-usi.patch
- + debian/patches/0001-fix-test-for-platforms-with-where-long-double-double.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+cftime (1.0.2-2) unstable; urgency=medium
+
+  * Add upstream patches to fix FTBFS on 32bit architectures.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 27 Oct 2018 16:05:26 +0200
+
 cftime (1.0.2-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/0001-change-float128-to-longdouble-to-fix-compilation-usi.patch
=====================================
@@ -0,0 +1,67 @@
+Description: change float128 to longdouble to fix compilation using MS compiler
+Author: Jeff Whitaker <jswhit at fastmail.fm>
+https://github.com/Unidata/cftime/pull/76/commits/6cabf85b8ed037ff1b7d487ca7a2bab33d80611a
+
+--- a/cftime/_cftime.pyx
++++ b/cftime/_cftime.pyx
+@@ -38,7 +38,7 @@ cdef int[12] _dpm_360  = [30, 30, 30, 30
+ cdef int[13] _spm_365day = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
+ cdef int[13] _spm_366day = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]
+ 
+-__version__ = '1.0.2'
++__version__ = '1.0.2.1'
+ 
+ # Adapted from http://delete.me.uk/2005/03/iso8601.html
+ # Note: This regex ensures that all ISO8601 timezone formats are accepted - but, due to legacy support for other timestrings, not all incorrect formats can be rejected.
+@@ -397,7 +397,7 @@ def JulianDayFromDate(date, calendar='st
+     minute = year.copy()
+     second = year.copy()
+     microsecond = year.copy()
+-    jd = np.empty(year.shape, np.float128)
++    jd = np.empty(year.shape, np.longdouble)
+     cdef long double[:] jd_view = jd
+     cdef Py_ssize_t i_max = len(date)
+     cdef Py_ssize_t i
+@@ -422,7 +422,7 @@ def JulianDayFromDate(date, calendar='st
+     # This is about 45 microseconds in 2000 for Julian date starting -4712.
+     # (pull request #433).
+     if calendar not in ['all_leap','no_leap','360_day','365_day','366_day']:
+-        eps = np.array(np.finfo(np.float64).eps,np.float128)
++        eps = np.array(np.finfo(np.float64).eps,np.longdouble)
+         eps = np.maximum(eps*jd, eps)
+         jd += eps
+ 
+@@ -453,13 +453,13 @@ def DateFromJulianDay(JD, calendar='stan
+     objects are used, which are actually instances of cftime.datetime.
+     """
+ 
+-    julian = np.array(JD, dtype=np.float128)
++    julian = np.array(JD, dtype=np.longdouble)
+ 
+     # 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.atleast_1d(np.int32(_round_half_up(julian)))
+-    F = np.atleast_1d(julian + 0.5 - Z).astype(np.float128)
++    F = np.atleast_1d(julian + 0.5 - Z).astype(np.longdouble)
+ 
+     cdef Py_ssize_t i_max = len(Z)
+     year = np.empty(i_max, dtype=np.int32)
+@@ -486,7 +486,7 @@ def DateFromJulianDay(JD, calendar='stan
+     microsecond = (second % 1)*1.e6
+     # remove the offset from the microsecond calculation.
+     if calendar not in ['all_leap','no_leap','360_day','365_day','366_day']:
+-        eps = np.array(np.finfo(np.float64).eps,np.float128)
++        eps = np.array(np.finfo(np.float64).eps,np.longdouble)
+         eps = np.maximum(eps*julian, eps)
+         microsecond = np.clip(microsecond - eps*86400.*1e6, 0, 999999)
+ 
+@@ -723,7 +723,7 @@ units to datetime objects.
+             if self.origin.year == 0:
+                 msg='zero not allowed as a reference year, does not exist in Julian or Gregorian calendars'
+                 raise ValueError(msg)
+-        self.tzoffset = np.array(tzoffset,dtype=np.float128)  # time zone offset in minutes
++        self.tzoffset = np.array(tzoffset,dtype=np.longdouble)  # time zone offset in minutes
+         self.units = units
+         self.unit_string = unit_string
+         if self.calendar in ['noleap', '365_day'] and self.origin.month == 2 and self.origin.day == 29:


=====================================
debian/patches/0001-fix-test-for-platforms-with-where-long-double-double.patch
=====================================
@@ -0,0 +1,66 @@
+Description: fix test for platforms with where long double=double
+Author: Jeff Whitaker <jswhit at fastmail.fm>
+https://github.com/Unidata/cftime/pull/76/commits/98262535b59b7d700bc84168929cbd734a39cef0
+
+--- a/test/test_cftime.py
++++ b/test/test_cftime.py
+@@ -337,8 +337,13 @@ class cftimeTestCase(unittest.TestCase):
+         dateref = datetime(2015,2,28,12)
+         ntimes = 1001
+         verbose = True # print out max error diagnostics
++        precis = np.finfo(np.longdouble).precision
++        if precis < 18:
++            fact = 10
++        else:
++            fact = 1.
+         for calendar in calendars:
+-            eps = 10.
++            eps = 10.*fact
+             units = 'microseconds since 2000-01-30 01:01:01'
+             microsecs1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0
+@@ -355,7 +360,7 @@ class cftimeTestCase(unittest.TestCase):
+                 print('calender = %s max abs err (microsecs) = %s eps = %s' % \
+                      (calendar,maxerr,eps))
+             units = 'milliseconds since 1800-01-30 01:01:01'
+-            eps = 0.01
++            eps = 0.01*fact
+             millisecs1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0.
+             for n in range(ntimes):
+@@ -370,7 +375,7 @@ class cftimeTestCase(unittest.TestCase):
+             if verbose:
+                 print('calender = %s max abs err (millisecs) = %s eps = %s' % \
+                      (calendar,maxerr,eps))
+-            eps = 1.e-4
++            eps = 1.e-4*fact
+             units = 'seconds since 0001-01-30 01:01:01'
+             secs1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0.
+@@ -386,7 +391,7 @@ class cftimeTestCase(unittest.TestCase):
+             if verbose:
+                 print('calender = %s max abs err (secs) = %s eps = %s' % \
+                      (calendar,maxerr,eps))
+-            eps = 1.e-6
++            eps = 1.e-6*fact
+             units = 'minutes since 0001-01-30 01:01:01'
+             mins1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0.
+@@ -402,7 +407,7 @@ class cftimeTestCase(unittest.TestCase):
+             if verbose:
+                 print('calender = %s max abs err (mins) = %s eps = %s' % \
+                      (calendar,maxerr,eps))
+-            eps = 1.e-7
++            eps = 1.e-7*fact
+             units = 'hours since 0001-01-30 01:01:01'
+             hrs1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0.
+@@ -418,7 +423,7 @@ class cftimeTestCase(unittest.TestCase):
+             if verbose:
+                 print('calender = %s max abs err (hours) = %s eps = %s' % \
+                      (calendar,maxerr,eps))
+-            eps = 1.e-9
++            eps = 1.e-9*fact
+             units = 'days since 0001-01-30 01:01:01'
+             days1 = date2num(dateref,units,calendar=calendar)
+             maxerr = 0.


=====================================
debian/patches/series
=====================================
@@ -0,0 +1,2 @@
+0001-change-float128-to-longdouble-to-fix-compilation-usi.patch
+0001-fix-test-for-platforms-with-where-long-double-double.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/cftime/compare/02d0fba7406a685444b6f88c1adfeabbdff02a11...3ddc23e6934fb26784ec73954d4a46d21fe73465

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/cftime/compare/02d0fba7406a685444b6f88c1adfeabbdff02a11...3ddc23e6934fb26784ec73954d4a46d21fe73465
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/20181027/a91c0e76/attachment-0001.html>


More information about the Pkg-grass-devel mailing list