1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
From ee7566c6f5825658b55fc5b196d72b945841065f Mon Sep 17 00:00:00 2001
From: Ghislain Antony Vaillant <ghisvail@gmail.com>
Date: Wed, 28 Dec 2016 11:57:26 +0000
Subject: Use print function in docstrings
---
src/coards/__init__.py | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/coards/__init__.py b/src/coards/__init__.py
index 52a52f6..069460e 100755
--- a/src/coards/__init__.py
+++ b/src/coards/__init__.py
@@ -122,29 +122,29 @@ def format(date, units):
"""
Convert a datetime object into a COARDS compliant date::
- >>> print format(datetime(1970, 1, 1, 0, 0), "hours since 1970-01-01 00:00:00")
+ >>> print(format(datetime(1970, 1, 1, 0, 0), "hours since 1970-01-01 00:00:00"))
0.0
- >>> print format(datetime(1969, 12, 31, 21, 30), "hours since 1970-01-01 00:00:00 +2:30")
+ >>> print(format(datetime(1969, 12, 31, 21, 30), "hours since 1970-01-01 00:00:00 +2:30"))
0.0
- >>> print format(datetime(1996, 1, 1, 10, 0), "hours since 1996-1-1")
+ >>> print(format(datetime(1996, 1, 1, 10, 0), "hours since 1996-1-1"))
10.0
- >>> print format(datetime(1, 1, 1, 10, 0), "hours since 1-1-1")
+ >>> print(format(datetime(1, 1, 1, 10, 0), "hours since 1-1-1"))
10.0
- >>> print format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00:00")
+ >>> print(format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00:00"))
10.0
- >>> print format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00")
+ >>> print(format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00"))
10.0
- >>> print format(datetime(1990, 11, 25, 20, 0), "hours since 1990-11-25 12:00 +2:00")
+ >>> print(format(datetime(1990, 11, 25, 20, 0), "hours since 1990-11-25 12:00 +2:00"))
10.0
- >>> print format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00 UTC")
+ >>> print(format(datetime(1990, 11, 25, 22, 0), "hours since 1990-11-25 12:00 UTC"))
10.0
- >>> print format(datetime(1970, 1, 1, 0, 0, 10), "seconds since 1970-1-1")
+ >>> print(format(datetime(1970, 1, 1, 0, 0, 10), "seconds since 1970-1-1"))
10.0
It works with a year that never existed, since it's usual to have the
origin set to the year zero in climatological datasets::
- >>> print format(datetime(1, 1, 1, 0, 0), "days since 0000-01-01 00:00:00")
+ >>> print(format(datetime(1, 1, 1, 0, 0), "days since 0000-01-01 00:00:00"))
366.0
"""
@@ -159,7 +159,7 @@ def parse_units(units):
This function transforms all Udunits defined time units, returning it
converted to seconds::
- >>> print parse_units("min")
+ >>> print(parse_units("min"))
60.0
"""
|