[Python-modules-commits] [cf-python] 02/03: merge patched into master

Klaus Zimmermann zklaus-guest at moszumanska.debian.org
Sun Dec 11 12:27:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

zklaus-guest pushed a commit to branch master
in repository cf-python.

commit 1f814875146a66cd6cb32043fc8608dd158ea70b
Merge: d2bd0ad bbf9f2b
Author: Klaus Zimmermann <klaus_zimmermann at gmx.de>
Date:   Fri Dec 9 22:22:12 2016 +0100

    merge patched into master

 cf/cfdatetime.py                                   |  58 +++++++++--
 cf/units.py                                        |   6 +-
 debian/.git-dpm                                    |   4 +-
 debian/patches/0005-netcdftime-compatibility.patch | 111 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 5 files changed, 171 insertions(+), 9 deletions(-)

diff --cc debian/.git-dpm
index 60dc298,0000000..5a6bd0d
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,8 -1,0 +1,8 @@@
 +# see git-dpm(1) from git-dpm package
- d05d0ffd05aae3700553050e51308e4bb78cd468
- d05d0ffd05aae3700553050e51308e4bb78cd468
++bbf9f2be93a1f9105ee93b50fa3f0c841dbc6e71
++bbf9f2be93a1f9105ee93b50fa3f0c841dbc6e71
 +d4e86cfcda573bdd7ecc73d6a1639ccb172685c5
 +d4e86cfcda573bdd7ecc73d6a1639ccb172685c5
 +cf-python_1.3.2+dfsg1.orig.tar.gz
 +12caae9152d38445a4fd96aa4d35371dca91fbf7
 +1714332
diff --cc debian/patches/0005-netcdftime-compatibility.patch
index 0000000,0000000..54626ce
new file mode 100644
--- /dev/null
+++ b/debian/patches/0005-netcdftime-compatibility.patch
@@@ -1,0 -1,0 +1,111 @@@
++From bbf9f2be93a1f9105ee93b50fa3f0c841dbc6e71 Mon Sep 17 00:00:00 2001
++From: Klaus Zimmermann <klaus_zimmermann at gmx.de>
++Date: Fri, 9 Dec 2016 18:15:24 +0100
++Subject: netcdftime compatibility
++
++Remove some internal netcdftime functions that are no longer accessible.
++
++Signed-off-by: Klaus Zimmermann <klaus_zimmermann at gmx.de>
++---
++ cf/cfdatetime.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++------
++ cf/units.py      |  6 +++++-
++ 2 files changed, 57 insertions(+), 7 deletions(-)
++
++diff --git a/cf/cfdatetime.py b/cf/cfdatetime.py
++index 36819e2..b438362 100644
++--- a/cf/cfdatetime.py
+++++ b/cf/cfdatetime.py
++@@ -14,9 +14,60 @@ from .units        import Units
++ if netCDF4.__version__ <= '1.1.1':
++     _netCDF4_netcdftime_parse_date = netCDF4.netcdftime._parse_date
++     _netCDF4_netcdftime_strftime   = netCDF4.netcdftime._strftime
++-else:
+++elif netCDF4.__version__ <= '1.2.4':
++     _netCDF4_netcdftime_parse_date = netCDF4.netcdftime.netcdftime._parse_date
++     _netCDF4_netcdftime_strftime   = netCDF4.netcdftime._datetime._strftime
+++else:
+++    import time
+++
+++    def _findall(text, substr):
+++        # Also finds overlaps
+++        sites = []
+++        i = 0
+++        while 1:
+++            j = text.find(substr, i)
+++            if j == -1:
+++                break
+++            sites.append(j)
+++            i = j + 1
+++        return sites
+++
+++
+++    def _netCDF4_netcdftime_strftime(dt, fmt):
+++        if _illegal_s.search(fmt):
+++            raise TypeError("This strftime implementation does not handle %s")
+++        # don't use strftime method at all.
+++        # if dt.year > 1900:
+++        #    return dt.strftime(fmt)
+++
+++        year = dt.year
+++        # For every non-leap year century, advance by
+++        # 6 years to get into the 28-year repeat cycle
+++        delta = 2000 - year
+++        off = 6 * (delta // 100 + delta // 400)
+++        year = year + off
+++
+++        # Move to around the year 2000
+++        year = year + ((2000 - year) // 28) * 28
+++        timetuple = dt.timetuple()
+++        s1 = time.strftime(fmt, (year,) + timetuple[1:])
+++        sites1 = _findall(s1, str(year))
+++
+++        s2 = time.strftime(fmt, (year + 28,) + timetuple[1:])
+++        sites2 = _findall(s2, str(year + 28))
+++
+++        sites = []
+++        for site in sites1:
+++            if site in sites2:
+++                sites.append(site)
+++
+++        s = s1
+++        syear = "%4d" % (dt.year,)
+++        for site in sites:
+++            s = s[:site] + syear + s[site + 4:]
+++        return s
+++
+++    _netCDF4_netcdftime_parse_date = netCDF4.netcdftime._parse_date
++ 
++ 
++ # Define some useful units
++@@ -730,11 +781,6 @@ second).
++ 
++     return jd
++ #--- End: def
++-if netCDF4.__version__ <= '1.1.1':
++-    netCDF4.netcdftime._NoLeapDayFromDate = _NoLeapDayFromDate
++-else:
++-    netCDF4.netcdftime.netcdftime._NoLeapDayFromDate = _NoLeapDayFromDate
++-
++ 
++ def interval(value, units_in, units_out=None, dummy1=None):
++     '''
++diff --git a/cf/units.py b/cf/units.py
++index ada337c..d35c967 100644
++--- a/cf/units.py
+++++ b/cf/units.py
++@@ -263,10 +263,14 @@ if netCDF4.__version__ <= '1.1.1':
++     _DateFromNoLeapDay = netCDF4.netcdftime._DateFromNoLeapDay
++     _DateFromAllLeap   = netCDF4.netcdftime._DateFromAllLeap
++     _DateFrom360Day    = netCDF4.netcdftime._DateFrom360Day
++-else:
+++elif netCDF4.__version__ <= '1.2.4':
++     _DateFromNoLeapDay = netCDF4.netcdftime.netcdftime._DateFromNoLeapDay
++     _DateFromAllLeap   = netCDF4.netcdftime.netcdftime._DateFromAllLeap
++     _DateFrom360Day    = netCDF4.netcdftime.netcdftime._DateFrom360Day
+++else:
+++    # In 1.2.5 these functions have been moved to pure cython (cdef)
+++    # functions, inaccessible from python.
+++    pass
++ 
++ # --------------------------------------------------------------------
++ # Aliases for netCDF4.netcdftime functions
diff --cc debian/patches/series
index 348fd82,0000000..9617e9b
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,4 -1,0 +1,5 @@@
 +0001-Remove-check-for-python-version.patch
 +0002-Patch-sphinx-config-to-avoid-network-access-and-add-.patch
 +0003-Improve-umread-building-and-handling.patch
 +0004-Sphinx-fixes.patch
++0005-netcdftime-compatibility.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/cf-python.git



More information about the Python-modules-commits mailing list