[cmor] 04/05: WIP: Updates for 3.1
Alastair McKinstry
mckinstry at moszumanska.debian.org
Sat Jul 29 10:19:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch dev-python3
in repository cmor.
commit 30107255fd5f4bb00e30fb3e3432916bd9d58ec8
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Mon Aug 8 15:35:35 2016 +0100
WIP: Updates for 3.1
---
debian/control | 2 +-
debian/patches/cmor_ver.patch | 10 +-
debian/patches/python3.patch | 850 +++++++++++++++++++++++-------------------
3 files changed, 466 insertions(+), 396 deletions(-)
diff --git a/debian/control b/debian/control
index d57ac38..a4981c8 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Alastair McKinstry <mckinstry at debian.org>
Build-Depends: debhelper (>= 9), dh-buildinfo, libossp-uuid-dev,
libudunits2-dev, libnetcdf-dev, uuid-dev,
python-all-dev (>= 2.6.6-3~), python-setuptools (>= 0.6b3), python-numpy,
- python2-all-dev (>= 2.6.6-3~), python3-setuptools (>= 0.6b3), python3-numpy,
+ python3-all-dev (>= 2.6.6-3~), python3-setuptools (>= 0.6b3), python3-numpy,
libgfortran3, automake, gfortran, pkg-config,
libhdf5-serial-dev | libhdf5-dev,
Build-Conflicts: libcmor2, python-cmor, python3-cmor
diff --git a/debian/patches/cmor_ver.patch b/debian/patches/cmor_ver.patch
index b131788..07c8875 100644
--- a/debian/patches/cmor_ver.patch
+++ b/debian/patches/cmor_ver.patch
@@ -3,10 +3,10 @@ Description: Add symbol versioning file.
Last-Updated: 2013-06-11
Forwarded: no
-Index: cmor-2.9.1/cmor.ver
+Index: cmor-2.9.3/cmor.ver
===================================================================
--- /dev/null
-+++ cmor-2.9.1/cmor.ver
++++ cmor-2.9.3/cmor.ver
@@ -0,0 +1,7 @@
+CMOR_2.0.0 {
+ global:
@@ -15,10 +15,10 @@ Index: cmor-2.9.1/cmor.ver
+ Cd*;
+ local: *;
+};
-Index: cmor-2.9.1/configure.ac
+Index: cmor-2.9.3/configure.ac
===================================================================
---- cmor-2.9.1.orig/configure.ac
-+++ cmor-2.9.1/configure.ac
+--- cmor-2.9.3.orig/configure.ac
++++ cmor-2.9.3/configure.ac
@@ -23,7 +23,7 @@ esac
CMOR_VERSION=${PACKAGE_VERSION}" (commit: ${GIT_TAG})"
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 90a9ce2..9318b99 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -3,16 +3,16 @@ Description: Fixes needed to make code python2/3 compatible. NOTE: INCOMPLETE
Last-Updated: 2013-06-12
Forwarded: no
-Index: cmor-2.8.3/Lib/git2svn.py
+Index: cmor-2.9.3/Lib/git2svn.py
===================================================================
---- cmor-2.8.3.orig/Lib/git2svn.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Lib/git2svn.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Lib/git2svn.py
++++ cmor-2.9.3/Lib/git2svn.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import os,sys
svn=sys.argv[1]
-@@ -17,15 +18,15 @@
+@@ -17,15 +18,15 @@ for l in git:
for f in modfiles+newfiles:
cmd = "cp -pf %s %s/%s" % (f,svn,f)
@@ -31,10 +31,10 @@ Index: cmor-2.8.3/Lib/git2svn.py
- print 'svn del :',cmd
+ print('svn del :',cmd)
os.popen(cmd).readlines()
-Index: cmor-2.8.3/Lib/pywrapper.py
+Index: cmor-2.9.3/Lib/pywrapper.py
===================================================================
---- cmor-2.8.3.orig/Lib/pywrapper.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Lib/pywrapper.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Lib/pywrapper.py
++++ cmor-2.9.3/Lib/pywrapper.py
@@ -1,5 +1,5 @@
-
-import cmor_const,numpy,os,_cmor
@@ -43,7 +43,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
try:
import cdtime
-@@ -37,25 +37,25 @@
+@@ -37,25 +37,25 @@ def time_varying_grid_coordinate(grid_id
missing_value : scalar that is used to indicate missing data for this variable. It must be the same type as the data that will be passed to cmor_write. This missing_value will in general be replaced by a standard missing_value specified in the MIP table. If there are no missing data, and the user chooses not to declare the missing value, then this argument may be either omitted or assigned the value 'none' (i.e., missing_value='none').
"""
if not isinstance(table_entry,str):
@@ -75,7 +75,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
missing_value = float(missing_value)
return _cmor.time_varying_grid_coordinate(grid_id,table_entry,units,type,missing_value)
-@@ -68,7 +68,7 @@
+@@ -68,7 +68,7 @@ def _to_numpy(vals, message):
try:
vals = numpy.ascontiguousarray(vals.filled())
except:
@@ -84,7 +84,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
return vals
-@@ -92,32 +92,32 @@
+@@ -92,32 +92,32 @@ def grid(axis_ids,latitude=None,longitud
elif isinstance(axis_ids,(list,tuple)):
axis_ids = numpy.ascontiguousarray(axis_ids)
elif not isinstance(axis_ids, numpy.ndarray):
@@ -124,7 +124,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
type='f'
if nvertices is None :
-@@ -129,19 +129,19 @@
+@@ -129,19 +129,19 @@ def grid(axis_ids,latitude=None,longitud
latitude_vertices = _to_numpy(latitude_vertices, 'latitude_vertices')
if numpy.rank(latitude_vertices)!=len(axis_ids)+1:
@@ -148,7 +148,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
## print 'longitude_vert type:',longitude_vertices.dtype.char
if longitude_vertices.dtype.char!=type:
longitude_vertices = longitude_vertices.astype(type)
-@@ -149,10 +149,10 @@
+@@ -149,10 +149,10 @@ def grid(axis_ids,latitude=None,longitud
if latitude_vertices is None:
nvert = nvert2
elif nvert!=nvert2:
@@ -161,7 +161,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
## if area is not None:
-@@ -160,9 +160,9 @@
+@@ -160,9 +160,9 @@ def grid(axis_ids,latitude=None,longitud
## try:
## area = numpy.ascontiguousarray(area.filled())
## except:
@@ -173,7 +173,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
## if area.dtype.char!=type:
## area = area.astype(type)
n = len(axis_ids)
-@@ -181,27 +181,31 @@
+@@ -181,27 +181,31 @@ def set_grid_mapping(grid_id,mapping_nam
parameter_values :: array/list of parameter values in the same order of parameter_names (ignored if parameter_names is ditcionary)
parameter_units :: array/list of parameter units in the same order of parameter_names (ignored if parameter_names is ditcionary)
"""
@@ -212,7 +212,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
for v in val:
if isinstance(v,str):
punit.append(v)
-@@ -210,20 +214,20 @@
+@@ -210,20 +214,20 @@ def set_grid_mapping(grid_id,mapping_nam
except:
pass
if len(pvals)!=len(punits) or len(pvals)!=len(pnams):
@@ -239,7 +239,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
punit = list(parameter_units)
if isinstance(parameter_values,(list,tuple)):
pvals = list(parameter_values)
-@@ -231,11 +235,11 @@
+@@ -231,11 +235,11 @@ def set_grid_mapping(grid_id,mapping_nam
try:
pvals = numpy.ascontiguousarray(parameter_values.filled())
except:
@@ -254,7 +254,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
pvals = numpy.ascontiguousarray(pvals).astype('d')
return _cmor.set_grid_mapping(grid_id,mapping_name,pnms,pvals,punit)
-@@ -255,11 +259,11 @@
+@@ -255,11 +259,11 @@ def axis(table_entry,units=None,length=N
interval: a string used for time axes only (???)
"""
if not isinstance(table_entry,str):
@@ -268,7 +268,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
if has_cdms2 and isinstance(coord_vals,cdms2.axis.TransientAxis):
if units is None:
-@@ -286,10 +290,10 @@
+@@ -286,10 +290,10 @@ def axis(table_entry,units=None,length=N
coord_vals = numpy.ascontiguousarray(coord_vals.filled())
if not isinstance(coord_vals,numpy.ndarray):
@@ -281,7 +281,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if numpy.ma.isMA(cell_bounds):
cell_bounds = numpy.ascontiguousarray(cell_bounds.filled())
-@@ -304,18 +308,18 @@
+@@ -304,18 +308,18 @@ def axis(table_entry,units=None,length=N
if cell_bounds is not None:
if numpy.rank(cell_bounds)>2:
@@ -304,7 +304,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
cbnds = 0
-@@ -324,7 +328,7 @@
+@@ -324,7 +328,7 @@ def axis(table_entry,units=None,length=N
type = coord_vals.dtype.char[0]
if not type in ['i','l','f','d','S']:
@@ -313,7 +313,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if type == 'S':
type = 'c'
-@@ -344,7 +348,7 @@
+@@ -344,7 +348,7 @@ def axis(table_entry,units=None,length=N
if units is None:
if coord_vals is not None:
@@ -322,7 +322,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
units = "1"
-@@ -359,26 +363,26 @@
+@@ -359,26 +363,26 @@ def axis(table_entry,units=None,length=N
def variable(table_entry,units,axis_ids,type='f',missing_value=None,tolerance = 1.e-4,positive=None,original_name=None,history=None,comment=None):
if not isinstance(table_entry,str):
@@ -354,7 +354,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
comment = ""
-@@ -391,18 +395,18 @@
+@@ -391,18 +395,18 @@ def variable(table_entry,units,axis_ids,
elif isinstance(axis_ids,(list,tuple)):
axis_ids = numpy.ascontiguousarray(axis_ids)
elif not isinstance(axis_ids, numpy.ndarray):
@@ -377,7 +377,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
ndims = len(axis_ids)
-@@ -422,13 +426,13 @@
+@@ -422,13 +426,13 @@ def variable(table_entry,units,axis_ids,
comment = str(comment)
if not isinstance(tolerance,(float,int,numpy.float,numpy.float32,numpy.int,numpy.int32)):
@@ -393,7 +393,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
missing_value = float(missing_value)
-@@ -438,14 +442,14 @@
+@@ -438,14 +442,14 @@ def variable(table_entry,units,axis_ids,
def zfactor(zaxis_id,zfactor_name,units="",axis_ids=None,type=None,zfactor_values=None,zfactor_bounds=None):
if not isinstance(zaxis_id,(int,numpy.int,numpy.int32)):
@@ -411,7 +411,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if numpy.ma.isMA(axis_ids):
axis_ids = numpy.ascontiguousarray(axis_ids.filled())
-@@ -462,10 +466,10 @@
+@@ -462,10 +466,10 @@ def zfactor(zaxis_id,zfactor_name,units=
elif isinstance(axis_ids,(int,numpy.int,numpy.int32)):
axis_ids = numpy.array([axis_ids,])
elif not isinstance(axis_ids, numpy.ndarray):
@@ -424,7 +424,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if axis_ids is None:
ndims = 0
-@@ -474,9 +478,9 @@
+@@ -474,9 +478,9 @@ def zfactor(zaxis_id,zfactor_name,units=
ndims = len(axis_ids)
## if ndims>1 and zfactor_values is not None:
@@ -436,7 +436,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if zfactor_values is not None:
if isinstance(zfactor_values,(float,int,numpy.float,numpy.float32,numpy.int,numpy.int32)):
-@@ -490,7 +494,7 @@
+@@ -490,7 +494,7 @@ def zfactor(zaxis_id,zfactor_name,units=
elif isinstance(zfactor_values,(list,tuple)):
zfactor_values = numpy.ascontiguousarray(zfactor_values)
elif not isinstance(zfactor_values, numpy.ndarray):
@@ -445,7 +445,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if type is None:
try:
-@@ -501,18 +505,18 @@
+@@ -501,18 +505,18 @@ def zfactor(zaxis_id,zfactor_name,units=
elif isinstance(zfactor_values,(int,numpy.int,numpy.int32)):
type = 'd'
else:
@@ -467,7 +467,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if zfactor_bounds is not None:
if numpy.ma.isMA(zfactor_bounds):
-@@ -524,19 +528,19 @@
+@@ -524,19 +528,19 @@ def zfactor(zaxis_id,zfactor_name,units=
elif isinstance(zfactor_bounds,(list,tuple)):
zfactor_bounds = numpy.ascontiguousarray(zfactor_bounds)
elif not isinstance(zfactor_bounds, numpy.ndarray):
@@ -491,7 +491,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
bnds.append(zfactor_bounds[-1][1])
zfactor_bounds=numpy.array(bnds)
axis_ids = axis_ids.astype('i')
-@@ -551,15 +555,15 @@
+@@ -551,15 +555,15 @@ def write(var_id,data,ntimes_passed=None
ierr = write(var_id,data,ntimes_passed=None,file_suffix="",time_vals=None,time_bnds=None,store_with=None
"""
if not isinstance(var_id,(int,numpy.int,numpy.int32)):
@@ -510,7 +510,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
store_with = int(store_with)
if numpy.ma.isMA(data):
-@@ -573,7 +577,7 @@
+@@ -573,7 +577,7 @@ def write(var_id,data,ntimes_passed=None
elif isinstance(data,(list,tuple)):
data = numpy.ascontiguousarray(data)
elif not isinstance(data, numpy.ndarray):
@@ -519,7 +519,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if time_vals is None:
-@@ -594,12 +598,12 @@
+@@ -594,12 +598,12 @@ def write(var_id,data,ntimes_passed=None
try:
time_vals = numpy.ascontiguousarray(time_vals)
except:
@@ -534,7 +534,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
time_vals=time_vals.astype("d")
-@@ -609,7 +613,7 @@
+@@ -609,7 +613,7 @@ def write(var_id,data,ntimes_passed=None
else:
ntimes_passed = len(time_vals)
if not isinstance(ntimes_passed,(int,numpy.int,numpy.int32)):
@@ -543,7 +543,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
ntimes_passed = int(ntimes_passed)
-@@ -627,7 +631,7 @@
+@@ -627,7 +631,7 @@ def write(var_id,data,ntimes_passed=None
if goodshape[i]!=0:
if sh[j]!=goodshape[i]:
if goodshape[i]!=1:
@@ -552,7 +552,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
j+=1
elif ntimes_passed!=1:
j+=1
-@@ -649,13 +653,13 @@
+@@ -649,13 +653,13 @@ def write(var_id,data,ntimes_passed=None
elif isinstance(time_bnds,(list,tuple)):
time_bnds = numpy.ascontiguousarray(time_bnds)
elif not isinstance(time_bnds, numpy.ndarray):
@@ -569,7 +569,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
bnds =[]
if time_bnds.shape[0] > 1:
_check_time_bounds_contiguous(time_bnds)
-@@ -669,7 +673,7 @@
+@@ -669,7 +673,7 @@ def write(var_id,data,ntimes_passed=None
else:
ltv=len(time_vals)
if len(time_bnds)!=ltv+1:
@@ -578,7 +578,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
bnds=[]
for i in range(ltv):
bnds.append([time_bnds[i],time_bnds[i+1]])
-@@ -680,12 +684,12 @@
+@@ -680,12 +684,12 @@ def write(var_id,data,ntimes_passed=None
if time_bnds is not None:
type = time_bnds.dtype.char
if not type in ['f','d','i','l']:
@@ -593,7 +593,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
return _cmor.write(var_id,data,type,file_suffix,ntimes_passed,time_vals,time_bnds,store_with)
-@@ -696,7 +700,7 @@
+@@ -696,7 +700,7 @@ def _check_time_bounds_contiguous(time_b
for i in range(time_bnds.shape[0] - 1 ):
b = time_bnds[i]
if b[1]!=time_bnds[i+1][0]:
@@ -602,7 +602,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
def _flatten_time_bounds(time_bnds):
'''
-@@ -721,21 +725,21 @@
+@@ -721,21 +725,21 @@ def setup(inpath='.',netcdf_file_action=
create_subdirectories: 1 to create subdirectories structure, 0 to dump files directly where cmor_dataset tells to
"""
if not isinstance(exit_control,int) or not exit_control in [ cmor_const.CMOR_EXIT_ON_WARNING, cmor_const.CMOR_EXIT_ON_MAJOR, cmor_const.CMOR_NORMAL]:
@@ -629,7 +629,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
return _cmor.setup(inpath,netcdf_file_action,set_verbosity,exit_control,logfile,create_subdirectories)
def load_table(table):
-@@ -744,7 +748,7 @@
+@@ -744,7 +748,7 @@ def load_table(table):
load_table(table)
"""
if not isinstance(table,str):
@@ -638,7 +638,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
## if not os.path.exists(table):
## raise Exception, "Error, the table you specified (%s) does not exists" % table
return _cmor.load_table(table)
-@@ -782,7 +786,7 @@
+@@ -782,7 +786,7 @@ def dataset(experiment_id,institution,so
if not isinstance(st,str):
for o in dir():
if locals()[o] is st:
@@ -647,7 +647,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
calendar = calendar.lower()
-@@ -790,7 +794,7 @@
+@@ -790,7 +794,7 @@ def dataset(experiment_id,institution,so
if not isinstance(i,int):
for o in dir():
if locals()[o] is i:
@@ -656,7 +656,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if isinstance(month_lengths,(list,tuple)):
month_lengths = numpy.array(month_lengths)
elif has_cdms2 and cdms2.isVariable(month_lengths):
-@@ -802,26 +806,26 @@
+@@ -802,26 +806,26 @@ def dataset(experiment_id,institution,so
if isinstance(month_lengths,numpy.ndarray):
if not numpy.rank(month_lengths)==1:
@@ -689,7 +689,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
else:
branch_time=float(branch_time)
-@@ -829,7 +833,7 @@
+@@ -829,7 +833,7 @@ def dataset(experiment_id,institution,so
def set_table(table):
if not isinstance(table,int):
@@ -698,7 +698,7 @@ Index: cmor-2.8.3/Lib/pywrapper.py
return _cmor.set_table(table)
def close(var_id=None,file_name=False, preserve=False):
-@@ -842,7 +846,7 @@
+@@ -842,7 +846,7 @@ def close(var_id=None,file_name=False, p
[preserve] True/False (default False) if True: close the file but preserve the var definition in CMOR to write more data with this variable (into a new file)
"""
if var_id is not None and not isinstance(var_id,int):
@@ -707,36 +707,33 @@ Index: cmor-2.8.3/Lib/pywrapper.py
if (preserve is False):
if (file_name is False):
-Index: cmor-2.8.3/Lib/__init__.py
+Index: cmor-2.9.3/Lib/__init__.py
===================================================================
---- cmor-2.8.3.orig/Lib/__init__.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Lib/__init__.py 2013-06-15 10:54:40.000000000 +0100
-@@ -1,9 +1,9 @@
+--- cmor-2.9.3.orig/Lib/__init__.py
++++ cmor-2.9.3/Lib/__init__.py
+@@ -1,8 +1,8 @@
-from cmor_const import *
-
-from pywrapper import axis,variable,write,setup,load_table,dataset,set_table,zfactor,close,grid,set_grid_mapping,time_varying_grid_coordinate,set_cur_dataset_attribute,get_cur_dataset_attribute,has_cur_dataset_attribute,create_output_path,set_variable_attribute,get_variable_attribute,has_variable_attribute
-+from __future__ import print_function # Be python2/python3 agnostic
++from __future__ import print_function
+from .cmor_const import *
+from .pywrapper import axis,variable,write,setup,load_table,dataset,set_table,zfactor,close,grid,set_grid_mapping,time_varying_grid_coordinate,set_cur_dataset_attribute,get_cur_dataset_attribute,has_cur_dataset_attribute,create_output_path,set_variable_attribute,get_variable_attribute,has_variable_attribute
try:
- from check_CMOR_compliant import checkCMOR
--except Exception,err:
-- print err
+ from .check_CMOR_compliant import checkCMOR
-+except Exception as err:
-+ print(err)
+ except:
pass
-Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
+Index: cmor-2.9.3/Lib/check_CMOR_compliant.py
===================================================================
---- cmor-2.8.3.orig/Lib/check_CMOR_compliant.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Lib/check_CMOR_compliant.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Lib/check_CMOR_compliant.py
++++ cmor-2.9.3/Lib/check_CMOR_compliant.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cdms2
import os
import unidata
-@@ -8,14 +9,19 @@
+@@ -8,14 +9,19 @@ import cmor
import time
VERBOSE=-999
@@ -758,7 +755,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
ctrl_md5s=eval(url.read())
url.close()
del(url)
-@@ -53,11 +59,11 @@
+@@ -53,11 +59,11 @@ def addcoloring(fout,error):
color=34
else:
return
@@ -772,7 +769,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
return
def manageLog(fout,error,*msg_bits):
-@@ -67,35 +73,35 @@
+@@ -67,35 +73,35 @@ def manageLog(fout,error,*msg_bits):
msg+=" "+str(m)
msg=msg.lstrip()
@@ -823,7 +820,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
return 1
def split_expt_ids(val):
-@@ -143,7 +149,7 @@
+@@ -143,7 +149,7 @@ def readTable(table):
st=st.split('!')[0].strip()
if st[0]=="'":
st=st[1:-1]
@@ -832,7 +829,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if isinstance(gen_attributes[kw],str):
gen_attributes[kw]=[gen_attributes[kw],st]
else:
-@@ -156,11 +162,11 @@
+@@ -156,11 +162,11 @@ def readTable(table):
sp=l.split('_entry:')
entry_type=sp[0]
entry=sp[1].strip()
@@ -846,7 +843,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
cont=1
while cont:
l = ln.pop(0)[:-1]
-@@ -176,26 +182,26 @@
+@@ -176,26 +182,26 @@ def readTable(table):
sp=l.split(':')
kw=sp[0].strip()
val=":".join(sp[1:]).split('!')[0].strip()
@@ -880,7 +877,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
return e
-@@ -227,9 +233,9 @@
+@@ -227,9 +233,9 @@ def checkCMOR(fout,file,table,noerror=cm
for ex in extra_req:
if not ex in req_glbl_att:
req_glbl_att.append(ex)
@@ -892,7 +889,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
onm = Axes[a].get('out_name',a)
if not onm in IPCC_std_axes:
IPCC_std_axes.append(onm)
-@@ -264,7 +270,7 @@
+@@ -264,7 +270,7 @@ def checkCMOR(fout,file,table,noerror=cm
manageLog(fout,VERBOSE, 'Checking file argument',IPCC_std_axes)
manageLog(fout,VERBOSE, 'Checking path structure for path:',pthroot)
manageLog(fout,VERBOSE, 'Checking file structure for file:',fnm)
@@ -901,7 +898,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
ok = False
for v in IPCC_std_vars:
n = len(v)
-@@ -275,8 +281,8 @@
+@@ -275,8 +281,8 @@ def checkCMOR(fout,file,table,noerror=cm
nerr+=manageLog(fout, noerror, ''+shrt_fnm+' does not start with standard %s variable name followed by _' % file.project_id)
vf=v
#Check the variable is actually in the file
@@ -912,7 +909,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if hasattr(file,'cmor_version'):
up = False
rew = False
-@@ -447,7 +453,7 @@
+@@ -447,7 +453,7 @@ def checkCMOR(fout,file,table,noerror=cm
nwarn+=1
manageLog(fout,cmor.CMOR_WARNING, '\t\tIt is often helpful to define the global attribute: ',att)
@@ -921,7 +918,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
ncheck+=1
if not att in req_glbl_att and not att in opt_glbl_att:
nwarn+=1
-@@ -483,7 +489,7 @@
+@@ -483,7 +489,7 @@ def checkCMOR(fout,file,table,noerror=cm
ctrlmd5=tmd5s.get(tbl_date,None)
if ctrlmd5 is None:
nwarn+=1
@@ -930,7 +927,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
else:
ncheck+=1
if ctrlmd5!=tbl_md5:
-@@ -492,7 +498,7 @@
+@@ -492,7 +498,7 @@ def checkCMOR(fout,file,table,noerror=cm
@@ -939,7 +936,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
#no md5 stored in file
pass
ttbl_id = e['general'].get("table_id").split()[1]
-@@ -538,7 +544,7 @@
+@@ -538,7 +544,7 @@ def checkCMOR(fout,file,table,noerror=cm
else:
spoffset=0
@@ -948,7 +945,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if len(sp)<n:
nerr+=manageLog(fout, noerror, 'your file name does not seem to match the profile: varid_tableid_modelid_exptid_rid[iid][pid][_startdate-enddate][_suffix][_clim].nc')
-@@ -874,7 +880,7 @@
+@@ -874,7 +880,7 @@ def checkCMOR(fout,file,table,noerror=cm
manageLog(fout,VERBOSE, 'Ok user asked to check the following variable:',variable,'with from bounds =',fb)
manageLog(fout,VERBOSE, 'Checking variable name is %s compliant' % file.project_id)
if not var in IPCC_std_vars:
@@ -957,7 +954,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, var+' is not valid, did you mean :'+Vars[var]['out_name']+' ?')
else:
nerr+=manageLog(fout, noerror, 'Variable name :'+var+' is not %s compliant' % file.project_id)
-@@ -895,7 +901,7 @@
+@@ -895,7 +901,7 @@ def checkCMOR(fout,file,table,noerror=cm
for ax in axes:
manageLog(fout,VERBOSE, 'Checking axis name is valid for:',ax.id,'on var:',V.id)
if not ax.id in IPCC_std_axes:
@@ -966,7 +963,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if major <2:
ncheck+=1
nwarn+=1
-@@ -970,8 +976,8 @@
+@@ -970,8 +976,8 @@ def checkCMOR(fout,file,table,noerror=cm
gnm=nm
manageLog(fout,VERBOSE, '\tChecking special case %s, i.e' % (nm),'')
tmpax=V.getLevel()
@@ -977,7 +974,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
tmp=Axes[x].get('standard_name',None)
if tmp is not None: tmp=tmp.strip()
if tmp is not None and tmp==tmpax.standard_name:
-@@ -1089,7 +1095,7 @@
+@@ -1089,7 +1095,7 @@ def checkCMOR(fout,file,table,noerror=cm
manageLog(fout,VERBOSE, r,'')
val=getattr(ax,r,None)
if val is None:
@@ -986,7 +983,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'attribute '+r+' is required for axis '+ax.id)
if r!='units':
good_val=Axes[nm].get(r,None)
-@@ -1097,8 +1103,8 @@
+@@ -1097,8 +1103,8 @@ def checkCMOR(fout,file,table,noerror=cm
if val!=good_val:
nerr+=manageLog(fout, noerror, 'axis attribute '+r+' should be: '+str(good_val)+' but is:'+str(val))
if r=='formula_terms':
@@ -997,7 +994,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if not 'units' in Axes[nm].get('ignored',[]):
if not 'units' in Axes[nm].get('optional',[]) or ('units' in Axes[nm].get('optional',[]) and hasattr(ax,'units')):
if not ax.isTime():
-@@ -1200,7 +1206,7 @@
+@@ -1200,7 +1206,7 @@ def checkCMOR(fout,file,table,noerror=cm
manageLog(fout,VERBOSE, '\t\tChecking that the latitude are in degrees (not rads)')
min,max=genutil.minmax(ax[:])
if 0.<max-min<3.2:
@@ -1006,7 +1003,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'latitude must be stored in degree span is:'+str(max-min)+' looks like rad')
elif ax.isTime() and len(ax[:])>1:
manageLog(fout,VERBOSE, '\t\tChecking for axis attribute')
-@@ -1212,7 +1218,7 @@
+@@ -1212,7 +1218,7 @@ def checkCMOR(fout,file,table,noerror=cm
manageLog(fout,VERBOSE, '\t\tView calendar attribute: ','')
c=getattr(ax,'calendar',None)
if c is None:
@@ -1015,7 +1012,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'calendar attribute must be defined on time axis')
else:
manageLog(fout,VERBOSE, c)
-@@ -1255,7 +1261,7 @@
+@@ -1255,7 +1261,7 @@ def checkCMOR(fout,file,table,noerror=cm
t=t.split()[-1]
## manageLog(fout,VERBOSE, 'Now it is:',t)
sp2=ft.split(t+':')[1].split()[0]
@@ -1024,7 +1021,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'formula_terms attribute indicates variable '+sp2+' should be stored in file')
if not docoord:
-@@ -1329,7 +1335,7 @@
+@@ -1329,7 +1335,7 @@ def checkCMOR(fout,file,table,noerror=cm
nerr+=manageLog(fout, noerror, 'dimension:'+Nm+' has no associated bounds')
else:
manageLog(fout,VERBOSE, '\t\tChecking that defined bounds variable is in file')
@@ -1033,7 +1030,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'dimension '+Nm+' associated bounds are defined to be '+b+' but the variable is not present in file')
if ax.isTime():
interv = Axes[nm].get('interval',None)
-@@ -1345,7 +1351,7 @@
+@@ -1345,7 +1351,7 @@ def checkCMOR(fout,file,table,noerror=cm
else:
c=ax.getCalendar()
@@ -1042,7 +1039,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
beg=cdtime.reltime(b[0],ax.units).tocomp(c)
end=cdtime.reltime(b[1],ax.units).tocomp(c)
mid=cdtime.reltime(ax[ib],ax.units).tocomp(c)
-@@ -1363,7 +1369,7 @@
+@@ -1363,7 +1369,7 @@ def checkCMOR(fout,file,table,noerror=cm
opt_var_Att=['original_name','history','long_name','comment','coordinates','cell_methods','original_units',"cell_measures"]
for etmp in etables:
ev = etmp['variable']
@@ -1051,7 +1048,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if v == var:
for p in ev[v].get("optional",[]):
if p in req_var_Att:
-@@ -1408,7 +1414,7 @@
+@@ -1408,7 +1414,7 @@ def checkCMOR(fout,file,table,noerror=cm
if val.find(sp[i+1]+"_")==-1:
nerr+=manageLog(fout,noerror,"associated files should point to file containing:",sp[i+1],'you have:',val)
@@ -1060,7 +1057,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
tp=Vars[V.id].get('type','real')
manageLog(fout,VERBOSE, '\tChecking Variable typecode is',tp)
if tp == 'double' : tp='d'
-@@ -1430,7 +1436,7 @@
+@@ -1430,7 +1436,7 @@ def checkCMOR(fout,file,table,noerror=cm
'1 '+V.units+' is actually :'+str(U2))
except:
nerr+=manageLog(fout, noerror, 'variable units:'+V.units+' do not match IPCC units:'+Vars[var]['units'])
@@ -1069,7 +1066,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
manageLog(fout,VERBOSE, '\tChecking standard name (case independent)')
if getattr(V,'standard_name','').lower().strip()!=Vars[var]['standard_name']:
nerr+=manageLog(fout, noerror, 'standard_name for '+var+' should be:'+Vars[var]['standard_name'])
-@@ -1479,10 +1485,10 @@
+@@ -1479,10 +1485,10 @@ def checkCMOR(fout,file,table,noerror=cm
if cm!=[]:
manageLog(fout,VERBOSE, '\tChecking for cell_methods: ','')
if not hasattr(V,'cell_methods'):
@@ -1082,7 +1079,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
cmv=getattr(V,'cell_methods','')
sp=cm.split('(')
-@@ -1505,8 +1511,8 @@
+@@ -1505,8 +1511,8 @@ def checkCMOR(fout,file,table,noerror=cm
for s in sp[1:]:
dicv[kw]=s.split()[0].strip()
kw=s.split()[-1].strip()
@@ -1093,7 +1090,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
nerr+=manageLog(fout, noerror, 'cell_methods must include '+kw+' defined (to: '+dic[kw]+' )')
elif not dicv[kw]==dic[kw]:
nerr+=manageLog(fout, noerror, 'cell_method: '+kw+' definition does not match table, it is :'+dicv[kw]+' but should be: '+dic[kw])
-@@ -1515,7 +1521,7 @@
+@@ -1515,7 +1521,7 @@ def checkCMOR(fout,file,table,noerror=cm
if not hasattr(V,att):
nwarn+=1
manageLog(fout,cmor.CMOR_WARNING, '\t\tWhen appropriate, it is often helpful to define the variable attribute: ',att)
@@ -1102,7 +1099,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
ncheck+=1
if not att in req_var_Att and not att in opt_var_Att:
nwarn+=1
-@@ -1535,8 +1541,8 @@
+@@ -1535,8 +1541,8 @@ def checkCMOR(fout,file,table,noerror=cm
nerr+=nerr
manageLog(fout,cmor.CMOR_WARNING, '%d warnings issued out of %d checked for (%5.2f%%)' % (nwarn,ncheck,float(nwarn)/ncheck*100))
if nerr!=0:
@@ -1113,7 +1110,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
file.close()
return nwarn,ncheck,nerr
-@@ -1585,7 +1591,7 @@
+@@ -1585,7 +1591,7 @@ if __name__=='__main__':
if o in ['--grid_table','-g']:
grid_table=p
if o in ['--help','-h','-?']:
@@ -1122,7 +1119,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
sys.exit()
if o in ['--noerror','-e']:
if p.lower() in ['off','0']:
-@@ -1595,16 +1601,16 @@
+@@ -1595,16 +1601,16 @@ if __name__=='__main__':
if o in ['--out','-o']:
out=p
@@ -1142,7 +1139,7 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
if out.lower()=='screen':
fout=sys.stdout
elif out.lower()=='file':
-@@ -1617,6 +1623,6 @@
+@@ -1617,6 +1623,6 @@ if __name__=='__main__':
else:
try:
checkCMOR(fout,file.strip(),table,other_tables=[grid_table,],noerror=noerror,variable=var)
@@ -1151,16 +1148,16 @@ Index: cmor-2.8.3/Lib/check_CMOR_compliant.py
+ except Exception as err:
+ print(err)
-Index: cmor-2.8.3/Test/check_results.py
+Index: cmor-2.9.3/Test/check_results.py
===================================================================
---- cmor-2.8.3.orig/Test/check_results.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/check_results.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/check_results.py
++++ cmor-2.9.3/Test/check_results.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from out_files import out
from in_files import input_tables
import sys,os
-@@ -10,7 +11,7 @@
+@@ -10,7 +11,7 @@ test = os.path.split(test)[1]
if test[-4:].lower()=='.f90':
test=test[:-4]
@@ -1169,7 +1166,7 @@ Index: cmor-2.8.3/Test/check_results.py
outfiles = out.get(test,[])
intables = input_tables.get(test,['IPCC_test_table_A',])
-@@ -22,12 +23,12 @@
+@@ -22,12 +23,12 @@ class CMORResultCheckError(Exception):
nfiles = 0
@@ -1184,7 +1181,7 @@ Index: cmor-2.8.3/Test/check_results.py
sys.exit()
tables=[]
for t in intables:
-@@ -39,13 +40,13 @@
+@@ -39,13 +40,13 @@ for f in outfiles:
if os.path.exists(fnm):
nfiles+=1
gotfiles.append(fnm)
@@ -1202,10 +1199,10 @@ Index: cmor-2.8.3/Test/check_results.py
elif nfiles!=len(outfiles):
- raise CMORResultCheckError,["Error checking output files for test: Test/%s.f90 we could only find %i files when %i were expected.\n\n Expected files: \n\t%s\n\nPresent files: \n\t%s\n\nMissing files: \n\t%s\n" % (test,nfiles,len(outfiles),repr(outfiles),repr(gotfiles),repr(missing)),]
+ raise CMORResultCheckError(["Error checking output files for test: Test/%s.f90 we could only find %i files when %i were expected.\n\n Expected files: \n\t%s\n\nPresent files: \n\t%s\n\nMissing files: \n\t%s\n" % (test,nfiles,len(outfiles),repr(outfiles),repr(gotfiles),repr(missing)),])
-Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
+Index: cmor-2.9.3/Test/cmor_speed_and_compression_01.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_01.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_01.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/cmor_speed_and_compression_01.py
++++ cmor-2.9.3/Test/cmor_speed_and_compression_01.py
@@ -1,11 +1,13 @@
+from __future__ import print_function
import cmor,numpy,sys,os
@@ -1221,7 +1218,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
sys.exit()
if len(sys.argv)>1:
-@@ -52,7 +54,7 @@
+@@ -52,7 +54,7 @@ cmor.dataset(
tables=[]
tables.append(cmor.load_table("mytable"))
@@ -1230,7 +1227,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
## read in data, just one slice
-@@ -98,11 +100,11 @@
+@@ -98,11 +100,11 @@ maxcdms=0
mincdms=1000
c0=st
f=cdms2.open("Test/crap.nc","w")
@@ -1245,7 +1242,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
totcmor+=c-c0
if maxcmor<c-c0:
maxcmor=c-c0
-@@ -111,7 +113,7 @@
+@@ -111,7 +113,7 @@ if mincmor>c-c0:
c0=c
f.write(s,id=varout)
c=time.time()
@@ -1254,7 +1251,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
totcdms+=c-c0
if maxcdms<c-c0:
maxcdms=c-c0
-@@ -124,12 +126,12 @@
+@@ -124,12 +126,12 @@ cmor.close()
import cdtime,os
ltime = cdtime.reltime(ntimes-1,'month since 1980').tocomp()
lcmor = os.stat("Test/CMIP5/output/PCMDI/GICCM1/lgm/mon/atmos/tas/r1i1p1/tas_Amon_GICCM1_lgm_r1i1p1_198401-198412.nc")[6]
@@ -1272,7 +1269,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
if os.path.exists("summary.txt"):
f = open("summary.txt")
-@@ -144,7 +146,7 @@
+@@ -144,7 +146,7 @@ dic[(level,shuffle)]=(float(lcmor)/float
for i in range(10):
a = dic.get((i,0),"N/A")
b = dic.get((i,1),"N/A")
@@ -1281,10 +1278,10 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_01.py
f=open("summary.txt","w")
f.write(repr(dic))
f.close()
-Index: cmor-2.8.3/setup.py.in
+Index: cmor-2.9.3/setup.py.in
===================================================================
---- cmor-2.8.3.orig/setup.py.in 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/setup.py.in 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/setup.py.in
++++ cmor-2.9.3/setup.py.in
@@ -1,8 +1,10 @@
+from __future__ import print_function # to be python2/python3 agnostic
import numpy
@@ -1296,7 +1293,7 @@ Index: cmor-2.8.3/setup.py.in
include_dirs = [numpy.lib.utils.get_include(),"include","include/cdTime"]
library_dirs = [ os.path.join("@prefix@","lib") ,'.']
-@@ -38,12 +40,12 @@
+@@ -38,12 +40,12 @@ for p in include_dirs:
ld.append(p)
include_dirs=ld
@@ -1315,10 +1312,10 @@ Index: cmor-2.8.3/setup.py.in
setup (name = "CMOR",
version='2.0',
-Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
+Index: cmor-2.9.3/Test/cmor_speed_and_compression_02.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression_02.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression_02.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/cmor_speed_and_compression_02.py
++++ cmor-2.9.3/Test/cmor_speed_and_compression_02.py
@@ -1,8 +1,9 @@
+from __future__ import print_function
import cmor,numpy,sys,os
@@ -1330,7 +1327,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
sys.exit()
cdms2.setNetcdfShuffleFlag(0)
-@@ -52,7 +53,7 @@
+@@ -52,7 +53,7 @@ cmor.dataset(
tables=[]
tables.append(cmor.load_table("mytable"))
@@ -1339,7 +1336,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
## read in data, just one slice
-@@ -75,7 +76,7 @@
+@@ -75,7 +76,7 @@ except:
except:
missing_value=None
@@ -1348,7 +1345,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
#missing_value = -999.
myaxes[0] = cmor.axis(table_entry = 'latitude',
units = 'degrees_north',
-@@ -115,7 +116,7 @@
+@@ -115,7 +116,7 @@ c0=st
f=cdms2.open("Test/crap.nc","w")
step=10
for i in range(0,ntimes,step):
@@ -1357,7 +1354,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
j1=i
j2=i+step
cmor.write(myvars[0],s[j1:j2].filled(),step,file_suffix="speed-comp-02")
-@@ -154,15 +155,15 @@
+@@ -154,15 +155,15 @@ cmor.close()
import cdtime,os
ltime = cdtime.reltime(Tim[ntimes-1],Tim.units).tocomp()
ftime = cdtime.reltime(Tim[0],Tim.units).tocomp()
@@ -1380,7 +1377,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
if os.path.exists("summary.txt"):
f = open("summary.txt")
-@@ -177,7 +178,7 @@
+@@ -177,7 +178,7 @@ dic[(level,shuffle)]=(float(lcmor)/float
for i in range(10):
a = dic.get((i,0),"N/A")
b = dic.get((i,1),"N/A")
@@ -1389,16 +1386,16 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression_02.py
f=open("summary.txt","w")
f.write(repr(dic))
f.close()
-Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
+Index: cmor-2.9.3/Test/cmor_speed_and_compression.py
===================================================================
---- cmor-2.8.3.orig/Test/cmor_speed_and_compression.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/cmor_speed_and_compression.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/cmor_speed_and_compression.py
++++ cmor-2.9.3/Test/cmor_speed_and_compression.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy,sys,os
try:
import cdms2
-@@ -5,7 +6,7 @@
+@@ -5,7 +6,7 @@ try:
cdms2.setNetcdfDeflateFlag(0)
cdms2.setNetcdfDeflateLevelFlag(0)
except:
@@ -1407,7 +1404,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
sys.exit()
if len(sys.argv)>1:
-@@ -52,7 +53,7 @@
+@@ -52,7 +53,7 @@ cmor.dataset(
tables=[]
tables.append(cmor.load_table("mytable"))
@@ -1416,7 +1413,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
## read in data, just one slice
-@@ -98,7 +99,7 @@
+@@ -99,7 +100,7 @@ mincdms=1000
c0=st
s2=s*1
sh=list(s.shape)
@@ -1425,7 +1422,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
sh.insert(0,1)
s2=MV2.reshape(s2,sh)
s2.setAxis(1,s.getLatitude())
-@@ -135,12 +136,12 @@
+@@ -136,12 +137,12 @@ cmor.close()
import cdtime,os
ltime = cdtime.reltime(ntimes-1,'month since 1980').tocomp()
lcmor = os.stat("Test/CMIP5/output/PCMDI/GICCM1/historical/mon/atmos/tas/r1i1p1/tas_Amon_GICCM1_historical_r1i1p1_198001-%i%.2i.nc" % (ltime.year,ltime.month))[6]
@@ -1443,7 +1440,7 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
if os.path.exists("summary.txt"):
f = open("summary.txt")
-@@ -155,7 +156,7 @@
+@@ -156,7 +157,7 @@ dic[(level,shuffle)]=(float(lcmor)/float
for i in range(10):
a = dic.get((i,0),"N/A")
b = dic.get((i,1),"N/A")
@@ -1452,10 +1449,10 @@ Index: cmor-2.8.3/Test/cmor_speed_and_compression.py
f=open("summary.txt","w")
f.write(repr(dic))
f.close()
-Index: cmor-2.8.3/Test/jamie_hybrid_height.py
+Index: cmor-2.9.3/Test/jamie_hybrid_height.py
===================================================================
---- cmor-2.8.3.orig/Test/jamie_hybrid_height.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/jamie_hybrid_height.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/jamie_hybrid_height.py
++++ cmor-2.9.3/Test/jamie_hybrid_height.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -1463,7 +1460,7 @@ Index: cmor-2.8.3/Test/jamie_hybrid_height.py
import cmor
import numpy
-@@ -45,22 +45,22 @@
+@@ -45,22 +45,22 @@ def main():
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
@@ -1490,10 +1487,10 @@ Index: cmor-2.8.3/Test/jamie_hybrid_height.py
cmor.close()
-Index: cmor-2.8.3/Test/nc2asc.py
+Index: cmor-2.9.3/Test/nc2asc.py
===================================================================
---- cmor-2.8.3.orig/Test/nc2asc.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/nc2asc.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/nc2asc.py
++++ cmor-2.9.3/Test/nc2asc.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -1501,7 +1498,7 @@ Index: cmor-2.8.3/Test/nc2asc.py
import cdms2,sys, genutil
cdms2.setAutoBounds('on')
-@@ -20,18 +20,18 @@
+@@ -20,18 +20,18 @@ else:
f=cdms2.open(fnm)
ntimes= 3
@@ -1523,7 +1520,7 @@ Index: cmor-2.8.3/Test/nc2asc.py
try:
p=s.getLevel()
p.id='pressure'
-@@ -44,41 +44,41 @@
+@@ -44,41 +44,41 @@ f.close()
f=open(fout,'w')
ndim=s.rank()
@@ -1583,10 +1580,10 @@ Index: cmor-2.8.3/Test/nc2asc.py
+print(j,s[-1])
f.close()
-Index: cmor-2.8.3/Src/_cmormodule.c
+Index: cmor-2.9.3/Src/_cmormodule.c
===================================================================
---- cmor-2.8.3.orig/Src/_cmormodule.c 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Src/_cmormodule.c 2013-06-16 17:19:30.000000000 +0100
+--- cmor-2.9.3.orig/Src/_cmormodule.c
++++ cmor-2.9.3/Src/_cmormodule.c
@@ -2,6 +2,26 @@
#include "numpy/arrayobject.h"
#include "cmor.h"
@@ -1614,7 +1611,7 @@ Index: cmor-2.8.3/Src/_cmormodule.c
static PyObject *
PyCMOR_get_original_shape(PyObject *self,PyObject *args)
{
-@@ -315,7 +335,11 @@
+@@ -315,7 +335,11 @@ static PyObject *
char *units;
char *interval;
int length;
@@ -1626,7 +1623,7 @@ Index: cmor-2.8.3/Src/_cmormodule.c
void *coord_vals;
void *cell_bounds;
int cell_bounds_ndim;
-@@ -324,7 +348,11 @@
+@@ -324,7 +348,11 @@ static PyObject *
PyArrayObject *coords=NULL,*bounds=NULL;
/* HUGE assumtion here is that the data is contiguous! */
@@ -1638,7 +1635,7 @@ Index: cmor-2.8.3/Src/_cmormodule.c
return NULL;
if (coords_obj == Py_None) {
-@@ -799,11 +827,62 @@
+@@ -799,11 +827,62 @@ static PyMethodDef MyExtractMethods[]= {
{NULL, NULL} /*sentinel */
};
@@ -1704,10 +1701,10 @@ Index: cmor-2.8.3/Src/_cmormodule.c
}
/* int main(int argc,char **argv) */
-Index: cmor-2.8.3/Test/test_compression.py
+Index: cmor-2.9.3/Test/test_compression.py
===================================================================
---- cmor-2.8.3.orig/Test/test_compression.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_compression.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_compression.py
++++ cmor-2.9.3/Test/test_compression.py
@@ -1,8 +1,9 @@
+from __future__ import print_function
import sys,os
@@ -1719,7 +1716,7 @@ Index: cmor-2.8.3/Test/test_compression.py
sys.exit()
import cmor,numpy
-@@ -44,12 +45,12 @@
+@@ -44,12 +45,12 @@ for ax in Saxes[1:]:
#Now creates a dummy HUGE axis for resizing s as really big
factor = 100
nt = s.shape[0]*factor
@@ -1734,7 +1731,7 @@ Index: cmor-2.8.3/Test/test_compression.py
var_id1 = cmor.variable(s.id,s.units,axes)
## the one with 2 at the end is compressed
var_id2 = cmor.variable(s.id,s.units,axes)
-@@ -58,7 +59,7 @@
+@@ -58,7 +59,7 @@ sh[0]=nt
s=numpy.resize(s,sh)
#s=numpy.where(numpy.greater(s,100.),100,s)
s=numpy.random.random(s.shape)*100.
@@ -1743,11 +1740,11 @@ Index: cmor-2.8.3/Test/test_compression.py
cmor.write(var_id1,s)
cmor.close(var_id1)
cmor.write(var_id2,s)
-Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
+Index: cmor-2.9.3/Test/test_grid_stub_jamie.py
===================================================================
---- cmor-2.8.3.orig/Test/test_grid_stub_jamie.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_grid_stub_jamie.py 2013-06-15 10:54:40.000000000 +0100
-@@ -71,7 +71,7 @@
+--- cmor-2.9.3.orig/Test/test_grid_stub_jamie.py
++++ cmor-2.9.3/Test/test_grid_stub_jamie.py
+@@ -71,7 +71,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid([[1], [2]])
self.fail('should raise exception')
@@ -1756,7 +1753,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals('error axes list/array must be 1D', str(e))
def test_error_on_axis_ids(self):
-@@ -80,7 +80,7 @@
+@@ -80,7 +80,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid(axis_ids)
self.fail('should raise exception')
@@ -1765,7 +1762,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals('Error could not convert axis_ids list to a numpy array',
str(e))
-@@ -88,14 +88,14 @@
+@@ -88,14 +88,14 @@ class TestGridCallErrors(unittest.TestCa
try:
grid([0], latitude = numpy.arange(2))
self.fail('should raise exception')
@@ -1782,7 +1779,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals("latitude and longitude must be BOTH an array or None", str(e))
def test_error_type_lats(self):
-@@ -104,7 +104,7 @@
+@@ -104,7 +104,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid([0, 11], latitude = lats, longitude = lons)
self.fail('should raise exception')
@@ -1791,7 +1788,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals('Error could not convert latitude to a numpy array', str(e))
def test_error_type_lons(self):
lats = numpy.arange(2*3).reshape(2,3)
-@@ -112,7 +112,7 @@
+@@ -112,7 +112,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid([0, 1], latitude = lats, longitude = lons)
self.fail('should raise exception')
@@ -1800,7 +1797,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals('Error could not convert longitude to a numpy array', str(e))
def test_error_rank_lons(self):
axis_ids = [1, 2]
-@@ -121,7 +121,7 @@
+@@ -121,7 +121,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid(axis_ids, latitude = lats, longitude = lons)
self.fail('should raise exception')
@@ -1809,7 +1806,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals("longitude's rank does not match number of axes passed via axis_ids", str(e))
def test_error_rank_lats(self):
-@@ -131,7 +131,7 @@
+@@ -131,7 +131,7 @@ class TestGridCallErrors(unittest.TestCa
try:
grid(axis_ids, latitude = lats, longitude = lons)
self.fail('should raise exception')
@@ -1818,7 +1815,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals("latitude's rank does not match number of axes passed via axis_ids", str(e))
def test_error_rank_lat_verts(self): # this test may be fragile?
-@@ -143,7 +143,7 @@
+@@ -143,7 +143,7 @@ class TestGridCallErrors(unittest.TestCa
grid(axis_ids, latitude = lats, longitude = lons,
latitude_vertices = lat_verts)
self.fail('should raise exception')
@@ -1827,7 +1824,7 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals("latitude_vertices's rank does not match number of axes passed via axis_ids +1 (for vertices)",
str(e))
-@@ -156,7 +156,7 @@
+@@ -156,7 +156,7 @@ class TestGridCallErrors(unittest.TestCa
grid(axis_ids, latitude = lats, longitude = lons,
longitude_vertices = lon_verts)
self.fail('should raise exception')
@@ -1836,17 +1833,17 @@ Index: cmor-2.8.3/Test/test_grid_stub_jamie.py
self.assertEquals("longitude_vertices's rank does not match number of axes passed via axis_ids +1 (for vertices)",
str(e))
-Index: cmor-2.8.3/Test/test_python_2Gb_file.py
+Index: cmor-2.9.3/Test/test_python_2Gb_file.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_2Gb_file.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_2Gb_file.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_2Gb_file.py
++++ cmor-2.9.3/Test/test_python_2Gb_file.py
@@ -1,4 +1,4 @@
-
+from __future__ import print_function
import cmor,numpy
-@@ -37,12 +37,12 @@
+@@ -37,12 +37,12 @@ ntimes=250
data = numpy.random.random((nlev,nlat,nlon))*30+273.15
for i in range(ntimes):
@@ -1862,17 +1859,17 @@ Index: cmor-2.8.3/Test/test_python_2Gb_file.py
-print 'hello'
+print('hello')
-Index: cmor-2.8.3/Test/test_python_2Gb_slice.py
+Index: cmor-2.9.3/Test/test_python_2Gb_slice.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_2Gb_slice.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_2Gb_slice.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_2Gb_slice.py
++++ cmor-2.9.3/Test/test_python_2Gb_slice.py
@@ -1,4 +1,4 @@
-
+from __future__ import print_function
import cmor,numpy
-@@ -20,7 +20,7 @@
+@@ -20,7 +20,7 @@ blons = numpy.arange(0,360.+dlon,dlon)
levs = numpy.array([1000.,925,900,850,800,700,600,500,400,300,250,200,150,100,75,70,50,30,20,10,7.5,5,2.5,1])
alllevs = numpy.arange(1000,0,-dlev).tolist()
@@ -1881,32 +1878,50 @@ Index: cmor-2.8.3/Test/test_python_2Gb_slice.py
cmor.setup(inpath='.',netcdf_file_action=cmor.CMOR_REPLACE)
cmor.dataset('historical', 'ukmo', 'pcmdi-10b HadCM3', 'gregorian',model_id='pcmdi-10b',outpath='Test',forcing='N/A', parent_experiment_id="lgm", parent_experiment_rip="r1i1p1",contact="Bruce Bochy",branch_time=0,institute_id="yep")
-@@ -40,12 +40,12 @@
+@@ -32,24 +32,24 @@ ilat = cmor.axis(table_entry='latitude',
+ ilon = cmor.axis(table_entry='longitude',coord_vals=lons,cell_bounds=blons,units='degrees_east')
+ itim = cmor.axis(table_entry='time',units='months since 2010')#,coord_vals=numpy.arange(ntimes,dtype=numpy.float),cell_bounds=numpy.arange(ntimes+1,dtype=float),units='months since 2000')
+ ilev = cmor.axis(table_entry='plevs',coord_vals=levs,units='hPa')
+-
++
+ axes=[itim,ilev,ilat,ilon]
+
+ var = cmor.variable(table_entry='ta',units='K',axis_ids=axes)
+
+-print "allocating mem for data"
++print ("allocating mem for data")
data = numpy.random.random((nlev,nlat,nlon))*30+273.15
+-print "moving on to writing"
++print ("moving on to writing")
for i in range(ntimes):
-- if i%10==0 : print 'Writing time:',i
-+ if i%10==0 : print('Writing time:',i)
+- print 'Writing time:',i
++ print ('Writing time:',i)
cmor.write(var,data,time_vals=numpy.array([float(i),]),time_bnds=numpy.array([i,i+1.]))
+-print "closing var"
-print cmor.close(var_id=var,file_name=True)
-+print(cmor.close(var_id=var,file_name=True))
+-print "closing cmor"
++print ("closing var")
++print (cmor.close(var_id=var,file_name=True))
++print ("closing cmor")
cmor.close()
-
+-print "done"
++print ("done")
-print 'hello'
-+print('hello')
-Index: cmor-2.8.3/Test/test_python_3hr.py
++print ('hello')
+Index: cmor-2.9.3/Test/test_python_3hr.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_3hr.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_3hr.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_3hr.py
++++ cmor-2.9.3/Test/test_python_3hr.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
error_flag = cmor.setup(inpath='Test', netcdf_file_action=cmor.CMOR_REPLACE)
-@@ -39,7 +40,7 @@
+@@ -39,7 +40,7 @@ iloc = cmor.axis("location",units="1",co
igrid = cmor.grid(axis_ids=[iloc,itm])
@@ -1915,16 +1930,16 @@ Index: cmor-2.8.3/Test/test_python_3hr.py
ilat = cmor.time_varying_grid_coordinate(igrid,table_entry='latitude',units='degrees_north')
ilon = cmor.time_varying_grid_coordinate(igrid,table_entry='longitude',units='degrees_east')
-Index: cmor-2.8.3/Test/test_python_appending.py
+Index: cmor-2.9.3/Test/test_python_appending.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_appending.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_appending.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_appending.py
++++ cmor-2.9.3/Test/test_python_appending.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
nlat = 90
-@@ -13,7 +14,7 @@
+@@ -13,7 +14,7 @@ def mywrite(data = None, time_vals = Non
bnds_req=numpy.array(bnds_req)
bnds_req.shape=(7,2)
@@ -1933,7 +1948,7 @@ Index: cmor-2.8.3/Test/test_python_appending.py
levs=[]
-@@ -22,14 +23,14 @@
+@@ -22,14 +23,14 @@ def mywrite(data = None, time_vals = Non
levs=numpy.array(levs)
@@ -1950,7 +1965,7 @@ Index: cmor-2.8.3/Test/test_python_appending.py
cmor.setup(inpath=ipth,
set_verbosity=cmor.CMOR_NORMAL,
netcdf_file_action = mode,
-@@ -65,22 +66,22 @@
+@@ -65,22 +66,22 @@ def mywrite(data = None, time_vals = Non
#itim = cmor.axis(table_entry='time',units='month since 2008',coord_vals=numpy.arange(0,12,1))
ilat = cmor.axis(table_entry='latitude',coord_vals=lats,units='degrees_north',cell_bounds=bnds_lat)
ilon = cmor.axis(table_entry='longitude',coord_vals=lons,units='degrees_east',cell_bounds=bnds_lon)
@@ -1979,7 +1994,7 @@ Index: cmor-2.8.3/Test/test_python_appending.py
cmor.close()
return file
-@@ -90,6 +91,6 @@
+@@ -90,6 +91,6 @@ data = numpy.random.random((ntime,17,nla
f1 = mywrite(data = data[:6], time_vals = numpy.arange(0,6,1),cell_bounds=numpy.arange(0,7,1))
@@ -1988,16 +2003,16 @@ Index: cmor-2.8.3/Test/test_python_appending.py
f2 = mywrite(data = data[6:], time_vals = numpy.arange(6,12,1), cell_bounds=numpy.arange(6,13,1), append_to=f1)
-print f2
+print(f2)
-Index: cmor-2.8.3/Test/test_python_bad_date.py
+Index: cmor-2.9.3/Test/test_python_bad_date.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_bad_date.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_bad_date.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_bad_date.py
++++ cmor-2.9.3/Test/test_python_bad_date.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
import numpy
-@@ -22,16 +23,16 @@
+@@ -22,16 +23,16 @@ def setup_data():
tbnds = list(tvals)
tbnds.append(43200)
tbnds=numpy.array(tbnds)-3.
@@ -2019,7 +2034,7 @@ Index: cmor-2.8.3/Test/test_python_bad_date.py
axes = [ {'table_entry': 'time1',
'units': tunits,
-@@ -85,7 +86,7 @@
+@@ -85,7 +86,7 @@ def main():
cmor_initialisation()
values,axes = setup_data()
vid = cmor_define_and_write(values, axes)
@@ -2028,16 +2043,16 @@ Index: cmor-2.8.3/Test/test_python_bad_date.py
if __name__ == '__main__':
-Index: cmor-2.8.3/Test/test_python_bentley_01.py
+Index: cmor-2.9.3/Test/test_python_bentley_01.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_bentley_01.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_bentley_01.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_bentley_01.py
++++ cmor-2.9.3/Test/test_python_bentley_01.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
import numpy
import cdtime
-@@ -26,7 +27,7 @@
+@@ -26,7 +27,7 @@ def setup_data():
'coord_vals': [0]},
{'table_entry': 'hybrid_height',
'units': 'm',
@@ -2046,7 +2061,7 @@ Index: cmor-2.8.3/Test/test_python_bentley_01.py
'cell_bounds': [[x-0.5, x+0.5] for x in range(2)],
},
]
-@@ -45,7 +46,7 @@
+@@ -45,7 +46,7 @@ def cmor_define_and_write(values, axes):
igrid = cmor.grid([axis_ids[1]], [0.], [0.])
cmor.zfactor(axis_ids[2], 'b', axis_ids = [axis_ids[2]],
@@ -2055,7 +2070,7 @@ Index: cmor-2.8.3/Test/test_python_bentley_01.py
zfactor_bounds = [[x-0.5, x+0.5] for x in range(2)])
cmor.zfactor(axis_ids[2], 'orog', 'm', axis_ids = [igrid],
-@@ -62,7 +63,7 @@
+@@ -62,7 +63,7 @@ def cmor_define_and_write(values, axes):
for time in [x * 1800./ 86400 for x in range(48)]:
time += 1./3600./24.
tr = cdtime.reltime(time,axes[0]["units"])
@@ -2064,7 +2079,7 @@ Index: cmor-2.8.3/Test/test_python_bentley_01.py
cmor.write(varid, values, time_vals = [time])
return varid
-@@ -73,7 +74,7 @@
+@@ -73,7 +74,7 @@ def main():
values, axes = setup_data()
varid = cmor_define_and_write(values, axes)
fname = cmor.close(varid, file_name = True)
@@ -2073,16 +2088,16 @@ Index: cmor-2.8.3/Test/test_python_bentley_01.py
if __name__ == '__main__':
-Index: cmor-2.8.3/Test/test_python_bounds_request.py
+Index: cmor-2.9.3/Test/test_python_bounds_request.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_bounds_request.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_bounds_request.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_bounds_request.py
++++ cmor-2.9.3/Test/test_python_bounds_request.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
breq = "100000. 80000. 80000. 68000. 68000. 56000. 56000. 44000. 44000. 31000. 31000. 18000. 18000. 0.".split()
-@@ -9,7 +10,7 @@
+@@ -9,7 +10,7 @@ for b in breq:
bnds_req=numpy.array(bnds_req)
bnds_req.shape=(7,2)
@@ -2091,7 +2106,7 @@ Index: cmor-2.8.3/Test/test_python_bounds_request.py
levs=[]
-@@ -18,7 +19,7 @@
+@@ -18,7 +19,7 @@ for b in bnds_req:
levs=numpy.array(levs)
@@ -2100,7 +2115,7 @@ Index: cmor-2.8.3/Test/test_python_bounds_request.py
ipth="Test"
cmor.setup(inpath=ipth,
-@@ -51,7 +52,7 @@
+@@ -51,7 +52,7 @@ data = numpy.random.random((ntime,7,nlat
itim = cmor.axis(table_entry='time',coord_vals=numpy.arange(0,ntime,1),units='month since 2008')
ilat = cmor.axis(table_entry='latitude',coord_vals=lats,units='degrees_north')
ilon = cmor.axis(table_entry='longitude',coord_vals=lons,units='degrees_east')
@@ -2109,11 +2124,11 @@ Index: cmor-2.8.3/Test/test_python_bounds_request.py
ilev = cmor.axis(table_entry="pressure2",coord_vals=levs,cell_bounds=bnds_req,units="Pa")
iv = cmor.variable(table_entry='ta',axis_ids=numpy.array((itim,ilev,ilat,ilon)),units='K')
-Index: cmor-2.8.3/Test/test_python_cfmip_site_axis_test.py
+Index: cmor-2.9.3/Test/test_python_cfmip_site_axis_test.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_cfmip_site_axis_test.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_cfmip_site_axis_test.py 2013-06-15 10:54:40.000000000 +0100
-@@ -28,6 +28,7 @@
+--- cmor-2.9.3.orig/Test/test_python_cfmip_site_axis_test.py
++++ cmor-2.9.3/Test/test_python_cfmip_site_axis_test.py
+@@ -28,6 +28,7 @@ variables:
lev:formula_terms = "a: lev b: b orog: orog";
...
'''
@@ -2121,7 +2136,7 @@ Index: cmor-2.8.3/Test/test_python_cfmip_site_axis_test.py
import cmor
import numpy
-@@ -64,41 +65,41 @@
+@@ -64,41 +65,41 @@ if __name__ == '__main__' :
# Create CMOR axes and grids
table_id = cmor.load_table('CMIP5_cfSites')
taxis_id = cmor.axis('time1', units='days since 2000-01-01 00:00:00') #, length=1, interval='30 minutes')
@@ -2171,17 +2186,17 @@ Index: cmor-2.8.3/Test/test_python_cfmip_site_axis_test.py
# Close CMOR.
cmor.close()
-Index: cmor-2.8.3/Test/test_python_clim_bounds.py
+Index: cmor-2.9.3/Test/test_python_clim_bounds.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_clim_bounds.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_clim_bounds.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_clim_bounds.py
++++ cmor-2.9.3/Test/test_python_clim_bounds.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -37,7 +38,7 @@
+@@ -37,7 +38,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2190,17 +2205,17 @@ Index: cmor-2.8.3/Test/test_python_clim_bounds.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_clim_bounds_02.py
+Index: cmor-2.9.3/Test/test_python_clim_bounds_02.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_clim_bounds_02.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_clim_bounds_02.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_clim_bounds_02.py
++++ cmor-2.9.3/Test/test_python_clim_bounds_02.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -50,7 +51,7 @@
+@@ -50,7 +51,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2209,17 +2224,17 @@ Index: cmor-2.8.3/Test/test_python_clim_bounds_02.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_clim_bounds_03.py
+Index: cmor-2.9.3/Test/test_python_clim_bounds_03.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_clim_bounds_03.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_clim_bounds_03.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_clim_bounds_03.py
++++ cmor-2.9.3/Test/test_python_clim_bounds_03.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -50,7 +51,7 @@
+@@ -50,7 +51,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2228,7 +2243,7 @@ Index: cmor-2.8.3/Test/test_python_clim_bounds_03.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-@@ -62,7 +63,7 @@
+@@ -62,7 +63,7 @@ def main():
history = 'variable history',
missing_value = -99
)
@@ -2237,17 +2252,17 @@ Index: cmor-2.8.3/Test/test_python_clim_bounds_03.py
cmor.write(varid, values)#, ntimes_passed=1)
-Index: cmor-2.8.3/Test/test_python_clim_bounds_04.py
+Index: cmor-2.9.3/Test/test_python_clim_bounds_04.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_clim_bounds_04.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_clim_bounds_04.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_clim_bounds_04.py
++++ cmor-2.9.3/Test/test_python_clim_bounds_04.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -50,7 +51,7 @@
+@@ -50,7 +51,7 @@ def main():
[45959, 52925]],}
axis_ids = list()
for axis in axes:
@@ -2256,16 +2271,16 @@ Index: cmor-2.8.3/Test/test_python_clim_bounds_04.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_YYYMMDDHH_exp_fmt.py
+Index: cmor-2.9.3/Test/test_python_YYYMMDDHH_exp_fmt.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_YYYMMDDHH_exp_fmt.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_YYYMMDDHH_exp_fmt.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_YYYMMDDHH_exp_fmt.py
++++ cmor-2.9.3/Test/test_python_YYYMMDDHH_exp_fmt.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
def path_test():
-@@ -32,7 +33,7 @@
+@@ -32,7 +33,7 @@ def path_test():
cmor.write(varid, [273])
path=cmor.close(varid, file_name=True)
@@ -2274,16 +2289,16 @@ Index: cmor-2.8.3/Test/test_python_YYYMMDDHH_exp_fmt.py
if __name__ == '__main__':
path_test()
-Index: cmor-2.8.3/Test/test_python_direct_calls.py
+Index: cmor-2.9.3/Test/test_python_direct_calls.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_direct_calls.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_direct_calls.py 2013-06-16 17:20:26.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_direct_calls.py
++++ cmor-2.9.3/Test/test_python_direct_calls.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
import os
-@@ -32,7 +33,7 @@
+@@ -32,7 +33,7 @@ tables=[]
a = cmor._cmor.load_table("Tables/CMIP5_Omon")
tables.append(a)
tables.append(cmor._cmor.load_table("Tables/CMIP5_Amon"))
@@ -2292,7 +2307,7 @@ Index: cmor-2.8.3/Test/test_python_direct_calls.py
axes=[]
-@@ -48,7 +49,7 @@
+@@ -48,7 +49,7 @@ units="degrees_east"
myaxes[2] = cmor._cmor.axis(id,units,lon,alons,'d',bnds_lon,2,interval)
id="plevs"
units="Pa"
@@ -2301,7 +2316,7 @@ Index: cmor-2.8.3/Test/test_python_direct_calls.py
myaxes[3] = cmor._cmor.axis(id,units,lev2,plevs.astype("d"),'d',None,0,interval)
-@@ -75,31 +76,31 @@
+@@ -75,31 +76,31 @@ myaxes2[1] = myaxes[3];
myaxes2[2] = myaxes[1];
myaxes2[3] = myaxes[2];
@@ -2342,7 +2357,7 @@ Index: cmor-2.8.3/Test/test_python_direct_calls.py
# /* ok here we decalre a variable for region axis testing */
cmor.set_table(tables[0])
-@@ -114,7 +115,7 @@
+@@ -114,7 +115,7 @@ cmor.set_table(tables[1])
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)
@@ -2351,32 +2366,32 @@ Index: cmor-2.8.3/Test/test_python_direct_calls.py
cmor._cmor.write(myvars[0],numpy.ravel(data2d),data2d.dtype.char,"",1,None,None,None);
cmor._cmor.close(None,0,0)
-Index: cmor-2.8.3/Test/test_python_fx.py
+Index: cmor-2.9.3/Test/test_python_fx.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_fx.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_fx.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_fx.py
++++ cmor-2.9.3/Test/test_python_fx.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
import numpy
-@@ -45,4 +46,4 @@
+@@ -45,4 +46,4 @@ def test_mode(mode):
fnm = cmor.close(varid,file_name=True)
cmor.close()
return fnm
-print test_mode(cmor.CMOR_REPLACE)
+print(test_mode(cmor.CMOR_REPLACE))
-Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
+Index: cmor-2.9.3/Test/test_python_grid_and_ocn_sigma.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_grid_and_ocn_sigma.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_grid_and_ocn_sigma.py
++++ cmor-2.9.3/Test/test_python_grid_and_ocn_sigma.py
@@ -1,4 +1,4 @@
-
+from __future__ import print_function
import cmor,numpy
import os
ntimes=2
-@@ -43,7 +43,7 @@
+@@ -43,7 +43,7 @@ def gen_irreg_grid(lon,lat):
lat_vertices[j,i,1] = lat_coords[j,i]-delta_lat;
lat_vertices[j,i,2] = lat_coords[j,i];
lat_vertices[j,i,3] = lat_coords[j,i]+delta_lat;
@@ -2385,7 +2400,7 @@ Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
return x,y,lon_coords,lat_coords,lon_vertices,lat_vertices
-@@ -86,12 +86,12 @@
+@@ -86,12 +86,12 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Omon"))
@@ -2400,7 +2415,7 @@ Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
myaxes[1] = cmor.axis(table_entry = 'y',
units = 'm',
-@@ -100,13 +100,13 @@
+@@ -100,13 +100,13 @@ myaxes[0] = cmor.axis(table_entry = 'x',
units = 'm',
coord_vals = x)
@@ -2416,7 +2431,7 @@ Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
myaxes[2] = grid_id
## mapnm = 'lambert_conformal_conic'
-@@ -127,19 +127,19 @@
+@@ -127,19 +127,19 @@ myaxes[3] = cmor.axis(table_entry = 'tim
# Now sets up the ocn sigma stuff
levs=-numpy.arange(lev)/float(lev+1.)
blevs=-numpy.arange(lev+1)/float(lev+1.)
@@ -2442,7 +2457,7 @@ Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
myvars[0] = cmor.variable( table_entry = 'thetao',
units = 'K',
axis_ids = pass_axes,
-@@ -154,8 +154,8 @@
+@@ -154,8 +154,8 @@ for i in range(ntimes):
eta = numpy.random.random((lon,lat,ntimes))*10000.
#print 'writing time: ',i,data3d.shape,data3d
#print Time[i],bnds_time[2*i:2*i+2]
@@ -2453,32 +2468,32 @@ Index: cmor-2.8.3/Test/test_python_grid_and_ocn_sigma.py
+ print('Writing time',i,'for eta')
cmor.write(ieta,eta,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2],store_with=myvars[0])
cmor.close()
-Index: cmor-2.8.3/Test/test_python_index_coord.py
+Index: cmor-2.9.3/Test/test_python_index_coord.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_index_coord.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_index_coord.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_index_coord.py
++++ cmor-2.9.3/Test/test_python_index_coord.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
ipth="Test"
-@@ -41,4 +42,4 @@
+@@ -41,4 +42,4 @@ iv = cmor.variable(table_entry='thetao',
cmor.write(iv,data)
f1 = cmor.close(iv,file_name=True)
-print f1
+print(f1)
-Index: cmor-2.8.3/Test/test_python_jamie_10.py
+Index: cmor-2.9.3/Test/test_python_jamie_10.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_10.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_10.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_10.py
++++ cmor-2.9.3/Test/test_python_jamie_10.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -37,7 +38,7 @@
+@@ -37,7 +38,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2487,10 +2502,10 @@ Index: cmor-2.8.3/Test/test_python_jamie_10.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_jamie_12.py
+Index: cmor-2.9.3/Test/test_python_jamie_12.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_12.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_12.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_12.py
++++ cmor-2.9.3/Test/test_python_jamie_12.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -2498,7 +2513,7 @@ Index: cmor-2.8.3/Test/test_python_jamie_12.py
import cmor
import numpy
-@@ -9,7 +9,7 @@
+@@ -9,7 +9,7 @@ def define_axes(axes):
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
@@ -2507,16 +2522,16 @@ Index: cmor-2.8.3/Test/test_python_jamie_12.py
return axis_ids
def define_write_var(axis_ids, entry, unit, values):
-Index: cmor-2.8.3/Test/test_python_jamie_2.py
+Index: cmor-2.9.3/Test/test_python_jamie_2.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_2.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_2.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_2.py
++++ cmor-2.9.3/Test/test_python_jamie_2.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
def multi_call_test():
-@@ -31,15 +32,15 @@
+@@ -31,15 +32,15 @@ def multi_call_test():
axis_ids.append(axis_id)
varid = cmor.variable('ts', 'K', axis_ids)
cmor.write(varid, [275], time_vals = [15], time_bnds = [ [0,30] ])
@@ -2536,16 +2551,16 @@ Index: cmor-2.8.3/Test/test_python_jamie_2.py
if __name__ == '__main__':
-Index: cmor-2.8.3/Test/test_python_jamie_6.py
+Index: cmor-2.9.3/Test/test_python_jamie_6.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_6.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_6.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_6.py
++++ cmor-2.9.3/Test/test_python_jamie_6.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
error_flag = cmor.setup(inpath='Test', netcdf_file_action=cmor.CMOR_REPLACE)
-@@ -106,7 +107,7 @@
+@@ -106,7 +107,7 @@ if table_entry == 'hybrid_height':
units='m' ,
zfactor_values = data2d)
else:
@@ -2554,10 +2569,10 @@ Index: cmor-2.8.3/Test/test_python_jamie_6.py
ilev = cmor.axis(
table_entry='standard_sigma',
units='1',
-Index: cmor-2.8.3/Test/test_python_jamie_8.py
+Index: cmor-2.9.3/Test/test_python_jamie_8.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_8.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_8.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_8.py
++++ cmor-2.9.3/Test/test_python_jamie_8.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -2565,7 +2580,7 @@ Index: cmor-2.8.3/Test/test_python_jamie_8.py
import cmor
import numpy
-@@ -9,7 +9,7 @@
+@@ -9,7 +9,7 @@ def define_axes(axes):
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
@@ -2574,7 +2589,7 @@ Index: cmor-2.8.3/Test/test_python_jamie_8.py
return axis_ids
def define_write_var(axis_ids, entry, unit, values):
-@@ -19,11 +19,11 @@
+@@ -19,11 +19,11 @@ def define_write_var(axis_ids, entry, un
missing_value = -99
)
@@ -2588,17 +2603,17 @@ Index: cmor-2.8.3/Test/test_python_jamie_8.py
def cmor_ini():
-Index: cmor-2.8.3/Test/test_python_jamie_9.py
+Index: cmor-2.9.3/Test/test_python_jamie_9.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_9.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_9.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_9.py
++++ cmor-2.9.3/Test/test_python_jamie_9.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -37,7 +38,7 @@
+@@ -37,7 +38,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2607,16 +2622,16 @@ Index: cmor-2.8.3/Test/test_python_jamie_9.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_jamie_site_surface.py
+Index: cmor-2.9.3/Test/test_python_jamie_site_surface.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_jamie_site_surface.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_jamie_site_surface.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_jamie_site_surface.py
++++ cmor-2.9.3/Test/test_python_jamie_site_surface.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor
import numpy
-@@ -55,7 +56,7 @@
+@@ -55,7 +56,7 @@ def main():
cmor_initialisation()
values, axes = setup_data()
cmor_define_and_write(values, axes)
@@ -2625,16 +2640,16 @@ Index: cmor-2.8.3/Test/test_python_jamie_site_surface.py
if __name__ == '__main__':
-Index: cmor-2.8.3/Test/test_python_joerg_10.py
+Index: cmor-2.9.3/Test/test_python_joerg_10.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_10.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_10.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_10.py
++++ cmor-2.9.3/Test/test_python_joerg_10.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -42,7 +43,7 @@
+@@ -42,7 +43,7 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Omon"))
@@ -2643,7 +2658,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_10.py
cmor.set_table(tables[0])
-@@ -62,7 +63,7 @@
+@@ -62,7 +63,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -2652,7 +2667,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_10.py
myaxes[2] = grid_id
## mapnm = 'lambert_conformal_conic'
-@@ -83,7 +84,7 @@
+@@ -83,7 +84,7 @@ myaxes[3] = cmor.axis(table_entry = 'tim
pass_axes = [myaxes[3],myaxes[2]]
@@ -2661,7 +2676,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_10.py
myvars[0] = cmor.variable( table_entry = 'calc',
units = 'mol m-3',
axis_ids = pass_axes,
-@@ -97,7 +98,7 @@
+@@ -97,7 +98,7 @@ for i in range(0,ntimes,2):
data2d_1 = read_2d_input_files(i, varin2d[0], lat,lon)
data2d_2 = read_2d_input_files(i+1, varin2d[0], lat,lon)
data2d=numpy.array((data2d_1,data2d_2))
@@ -2671,16 +2686,16 @@ Index: cmor-2.8.3/Test/test_python_joerg_10.py
+ print(Time[i:i+2],bnds_time[2*i:2*i+4])
cmor.write(myvars[0],data2d,2,time_vals=numpy.arange(i,i+2),time_bnds=numpy.arange(i,i+3))
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_11.py
+Index: cmor-2.9.3/Test/test_python_joerg_11.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_11.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_11.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_11.py
++++ cmor-2.9.3/Test/test_python_joerg_11.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -41,7 +42,7 @@
+@@ -41,7 +42,7 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Omon"))
@@ -2689,7 +2704,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_11.py
cmor.set_table(tables[0])
-@@ -61,7 +62,7 @@
+@@ -61,7 +62,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -2698,7 +2713,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_11.py
myaxes[2] = grid_id
## mapnm = 'lambert_conformal_conic'
-@@ -85,7 +86,7 @@
+@@ -85,7 +86,7 @@ myaxes[4] = cmor.axis(table_entry = 'oli
pass_axes = [myaxes[3],myaxes[4]]
@@ -2707,7 +2722,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_11.py
myvars[0] = cmor.variable( table_entry = 'mfo',
units = 'kg s-1',
axis_ids = pass_axes,
-@@ -94,7 +95,7 @@
+@@ -94,7 +95,7 @@ myvars[0] = cmor.variable( table_entry =
)
for i in range(ntimes):
data2d = numpy.random.random((1,15))
@@ -2717,16 +2732,16 @@ Index: cmor-2.8.3/Test/test_python_joerg_11.py
+ print(Time[i],bnds_time[2*i:2*i+2] )
cmor.write(myvars[0],data2d,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2])
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_12.py
+Index: cmor-2.9.3/Test/test_python_joerg_12.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_12.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_12.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_12.py
++++ cmor-2.9.3/Test/test_python_joerg_12.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -41,7 +42,7 @@
+@@ -41,7 +42,7 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Lmon"))
@@ -2735,7 +2750,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_12.py
cmor.set_table(tables[0])
-@@ -61,7 +62,7 @@
+@@ -61,7 +62,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -2744,7 +2759,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_12.py
myaxes[2] = grid_id
## mapnm = 'lambert_conformal_conic'
-@@ -85,7 +86,7 @@
+@@ -85,7 +86,7 @@ myaxes[4] = cmor.axis(table_entry = 'veg
pass_axes = [myaxes[2],myaxes[3],myaxes[4]]
@@ -2753,7 +2768,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_12.py
myvars[0] = cmor.variable( table_entry = 'landCoverFrac',
units = '%',
axis_ids = pass_axes,
-@@ -94,7 +95,7 @@
+@@ -94,7 +95,7 @@ myvars[0] = cmor.variable( table_entry =
)
for i in range(ntimes):
data2d = numpy.random.random((3,4,3))
@@ -2763,36 +2778,68 @@ Index: cmor-2.8.3/Test/test_python_joerg_12.py
+ print(Time[i],bnds_time[2*i:2*i+2] )
cmor.write(myvars[0],data2d,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2])
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_2.py
+Index: cmor-2.9.3/Test/test_python_joerg_2.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_2.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_2.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_2.py
++++ cmor-2.9.3/Test/test_python_joerg_2.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -57,7 +58,7 @@
+@@ -14,7 +15,7 @@ def test_mode(mode,i,suffix=''):
+ history = 'some global history',
+ parent_experiment_rip="r1i3p2",
+ parent_experiment_id="lgm",branch_time=0)
+-
++
+ table = 'CMIP5_Amon'
+ cmor.load_table(table)
+ levels = [100000.,
+@@ -40,14 +41,14 @@ def test_mode(mode,i,suffix=''):
+ 996,
+ 995,
+ 994]
+-
++
+ axes = [ {'table_entry': 'time',
+ 'units': 'months since 2000-01-01 00:00:00',
+ },
+ {'table_entry': 'latitude',
+ 'units': 'degrees_north',
+ 'coord_vals': [0],
+- 'cell_bounds': [-1, 1]},
++ 'cell_bounds': [-1, 1]},
+ {'table_entry': 'longitude',
+ 'units': 'degrees_east',
+ 'coord_vals': [90],
+@@ -56,8 +57,8 @@ def test_mode(mode,i,suffix=''):
+ 'units': 'Pa',
'coord_vals': levels},
]
-
+-
- values = numpy.array(range(len(levels)), numpy.float32)+195
++
+ values = numpy.array(list(range(len(levels))), numpy.float32)+195
axis_ids = list()
for axis in axes:
axis_id = cmor.axis(**axis)
-@@ -70,7 +71,7 @@
+@@ -70,20 +71,19 @@ def test_mode(mode,i,suffix=''):
history = 'variable history',
missing_value = -99
)
- print 'suffix is:',suffix
-+ print('suffix is:',suffix)
+- print "Sending time bounds:",[[i,i+1]]
++ print ('suffix is:',suffix)
++ print ("Sending time bounds:",[[i,i+1]])
cmor.write(varid, values, time_vals = [i], time_bnds = [ [i,i+1] ],file_suffix=suffix)
fnm = cmor.close(varid,file_name=True)
-@@ -79,7 +80,7 @@
-
+ cmor.close()
+ return fnm
+-
++
fnm=''
for i in range(5):
- print i,fnm
@@ -2800,16 +2847,19 @@ Index: cmor-2.8.3/Test/test_python_joerg_2.py
if i==0:
mode = cmor.CMOR_REPLACE
else:
-Index: cmor-2.8.3/Test/test_python_joerg_3.py
+ mode = cmor.CMOR_APPEND
+ fnm = test_mode(cmor.CMOR_APPEND,i,fnm)
+-
+Index: cmor-2.9.3/Test/test_python_joerg_3.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_3.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_3.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_3.py
++++ cmor-2.9.3/Test/test_python_joerg_3.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
ntimes=1
-@@ -127,24 +128,24 @@
+@@ -127,24 +128,24 @@ for d in range(2):
for i in range(4):
tval = [i/4.+d]
tbnd = [i/4.+d-.125,i/4.+d+.125]
@@ -2841,16 +2891,16 @@ Index: cmor-2.8.3/Test/test_python_joerg_3.py
-print cmor.close(ivar1,True)
+print(cmor.close(ivar1,True))
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_8.py
+Index: cmor-2.9.3/Test/test_python_joerg_8.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_8.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_8.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_8.py
++++ cmor-2.9.3/Test/test_python_joerg_8.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -41,7 +42,7 @@
+@@ -41,7 +42,7 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Omon"))
@@ -2859,7 +2909,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_8.py
cmor.set_table(tables[0])
-@@ -61,7 +62,7 @@
+@@ -61,7 +62,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -2868,7 +2918,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_8.py
myaxes[2] = grid_id
## mapnm = 'lambert_conformal_conic'
-@@ -82,7 +83,7 @@
+@@ -82,7 +83,7 @@ myaxes[3] = cmor.axis(table_entry = 'tim
pass_axes = [myaxes[3],myaxes[2]]
@@ -2877,7 +2927,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_8.py
myvars[0] = cmor.variable( table_entry = 'epc100',
units = 'mol m-2 s-1',
axis_ids = pass_axes,
-@@ -93,7 +94,7 @@
+@@ -93,7 +94,7 @@ myvars[0] = cmor.variable( table_entry =
)
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)
@@ -2887,16 +2937,16 @@ Index: cmor-2.8.3/Test/test_python_joerg_8.py
+ print(Time[i],bnds_time[2*i:2*i+2] )
cmor.write(myvars[0],data2d,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2])
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_9.py
+Index: cmor-2.9.3/Test/test_python_joerg_9.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_9.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_9.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_9.py
++++ cmor-2.9.3/Test/test_python_joerg_9.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy,cdms2
f=cdms2.open("Test/GR30s_halo.nc")
-@@ -75,7 +76,7 @@
+@@ -75,7 +76,7 @@ var_ids = cmor.variable(
fnm=""
for i in range(ntimes):
@@ -2905,7 +2955,7 @@ Index: cmor-2.8.3/Test/test_python_joerg_9.py
data = numpy.random.random((nlon,nlat))
error_flag = cmor.write(
var_id = var_ids,
-@@ -86,6 +87,6 @@
+@@ -86,6 +87,6 @@ for i in range(ntimes):
time_bnds = bnds_time[i:i+2])
fnm = cmor.close(var_ids,file_name=True,preserve=True)
@@ -2913,17 +2963,17 @@ Index: cmor-2.8.3/Test/test_python_joerg_9.py
+ print('dumped to:',fnm)
cmor.close()
-Index: cmor-2.8.3/Test/test_python_joerg_tim2_clim.py
+Index: cmor-2.9.3/Test/test_python_joerg_tim2_clim.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_joerg_tim2_clim.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_joerg_tim2_clim.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_joerg_tim2_clim.py
++++ cmor-2.9.3/Test/test_python_joerg_tim2_clim.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -40,12 +41,12 @@
+@@ -40,12 +41,12 @@ def main():
axis_ids = list()
for axis in axes:
@@ -2938,16 +2988,16 @@ Index: cmor-2.8.3/Test/test_python_joerg_tim2_clim.py
varid = cmor.variable(var,
units,
axis_ids,
-Index: cmor-2.8.3/Test/test_python_max_variables_2.py
+Index: cmor-2.9.3/Test/test_python_max_variables_2.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_max_variables_2.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_max_variables_2.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_max_variables_2.py
++++ cmor-2.9.3/Test/test_python_max_variables_2.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
error_flag = cmor.setup(inpath='Test', netcdf_file_action=cmor.CMOR_REPLACE)
-@@ -84,11 +85,11 @@
+@@ -84,11 +85,11 @@ for it in range(ntimes):
if (it == ntimes-1) :
fnm = cmor.close(var3d_ids, True)
@@ -2961,11 +3011,11 @@ Index: cmor-2.8.3/Test/test_python_max_variables_2.py
else:
ierr = cmor.close(var3d_ids, False, True)
-Index: cmor-2.8.3/Test/test_python_memory_check.py
+Index: cmor-2.9.3/Test/test_python_memory_check.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_memory_check.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_memory_check.py 2013-06-15 10:54:40.000000000 +0100
-@@ -5,7 +5,7 @@
+--- cmor-2.9.3.orig/Test/test_python_memory_check.py
++++ cmor-2.9.3/Test/test_python_memory_check.py
+@@ -5,7 +5,7 @@ Note the memory size from repeated calls
Memory stats are taken from http://code.activestate.com/recipes/286222/
'''
@@ -2974,7 +3024,7 @@ Index: cmor-2.8.3/Test/test_python_memory_check.py
import os
_proc_status = '/proc/%d/status' % os.getpid()
-@@ -124,7 +124,7 @@
+@@ -124,7 +124,7 @@ def memory_check():
cmor.write(varid, [275])
mem,res,stk = memory_usage(sys.stdout,mem,res,stk)
#mem,res,stk = memory_usage(sys.stdout,memi,resi,stki)
@@ -2983,17 +3033,17 @@ Index: cmor-2.8.3/Test/test_python_memory_check.py
cmor.close(varid)
-Index: cmor-2.8.3/Test/test_python_open_close_cmor_multiple.py
+Index: cmor-2.9.3/Test/test_python_open_close_cmor_multiple.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_open_close_cmor_multiple.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_open_close_cmor_multiple.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_open_close_cmor_multiple.py
++++ cmor-2.9.3/Test/test_python_open_close_cmor_multiple.py
@@ -1,4 +1,4 @@
-
+from __future__ import print_function
import cmor,numpy
-@@ -50,10 +50,10 @@
+@@ -50,10 +50,10 @@ for var in tvars:
cmor.write(var,data)
path=cmor.close(var, file_name=True)
@@ -3006,16 +3056,16 @@ Index: cmor-2.8.3/Test/test_python_open_close_cmor_multiple.py
-print 'hello'
+print('hello')
-Index: cmor-2.8.3/Test/test_python_reverted_lats.py
+Index: cmor-2.9.3/Test/test_python_reverted_lats.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_reverted_lats.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_reverted_lats.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_reverted_lats.py
++++ cmor-2.9.3/Test/test_python_reverted_lats.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
import cmor,numpy
nlat = 10
-@@ -34,7 +35,7 @@
+@@ -34,7 +35,7 @@ ivar = cmor.variable(table_entry='tasmin
cmor.write(ivar,data,ntimes_passed=1,time_vals=[0.],time_bnds=[0.,1.])
fnm = cmor.close(ivar,file_name=True)
@@ -3024,10 +3074,10 @@ Index: cmor-2.8.3/Test/test_python_reverted_lats.py
ivar2 = cmor.variable(table_entry='tasmin',units='K',axis_ids=[itim,ilat2,ilon])
cmor.write(ivar2,data,ntimes_passed=1,time_vals=[1.],time_bnds=[1.,2.])
-Index: cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py
+Index: cmor-2.9.3/Test/test_python_singleton_anywhere_in_table_def.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_singleton_anywhere_in_table_def.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_singleton_anywhere_in_table_def.py
++++ cmor-2.9.3/Test/test_python_singleton_anywhere_in_table_def.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -3035,7 +3085,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -56,7 +56,7 @@
+@@ -56,7 +56,7 @@ ts='days'
tscl=2.e-2
tables.append(cmor.load_table("/git/cmip5-cmor-tables/Tables/%s" % t))
@@ -3044,7 +3094,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py
cmor.set_table(tables[0])
-@@ -76,7 +76,7 @@
+@@ -76,7 +76,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -3053,7 +3103,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py
myaxes[2] = grid_id
mapnm = 'lambert_conformal_conic'
-@@ -107,8 +107,8 @@
+@@ -107,8 +107,8 @@ myvars[0] = cmor.variable( table_entry =
ntimes=2
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)*1.E-6
@@ -3064,10 +3114,10 @@ Index: cmor-2.8.3/Test/test_python_singleton_anywhere_in_table_def.py
- print 'wrote'
+ print('wrote')
cmor.close()
-Index: cmor-2.8.3/Test/test_python_singleton_string.py
+Index: cmor-2.9.3/Test/test_python_singleton_string.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_singleton_string.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_singleton_string.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_singleton_string.py
++++ cmor-2.9.3/Test/test_python_singleton_string.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
@@ -3075,7 +3125,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_string.py
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -56,7 +56,7 @@
+@@ -56,7 +56,7 @@ ts='months'
tscl=3.5e-4
tables.append(cmor.load_table("/git/cmip5-cmor-tables/Tables/%s" % t))
@@ -3084,7 +3134,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_string.py
cmor.set_table(tables[0])
-@@ -76,7 +76,7 @@
+@@ -76,7 +76,7 @@ grid_id = cmor.grid(axis_ids = myaxes[:2
longitude = lon_coords,
latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
@@ -3093,7 +3143,7 @@ Index: cmor-2.8.3/Test/test_python_singleton_string.py
myaxes[2] = grid_id
mapnm = 'lambert_conformal_conic'
-@@ -107,8 +107,8 @@
+@@ -107,8 +107,8 @@ myvars[0] = cmor.variable( table_entry =
ntimes=2
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)*1.E-6
@@ -3105,17 +3155,17 @@ Index: cmor-2.8.3/Test/test_python_singleton_string.py
- print 'wrote'
+ print('wrote')
cmor.close()
-Index: cmor-2.8.3/Test/test_python_stephanie_6hrPlev_minutes.py
+Index: cmor-2.9.3/Test/test_python_stephanie_6hrPlev_minutes.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_stephanie_6hrPlev_minutes.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_stephanie_6hrPlev_minutes.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_stephanie_6hrPlev_minutes.py
++++ cmor-2.9.3/Test/test_python_stephanie_6hrPlev_minutes.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+from __future__ import print_function
import cmor
import numpy
-@@ -37,7 +38,7 @@
+@@ -37,7 +38,7 @@ def main():
axis_ids = list()
for axis in axes:
@@ -3124,16 +3174,16 @@ Index: cmor-2.8.3/Test/test_python_stephanie_6hrPlev_minutes.py
axis_id = cmor.axis(**axis)
axis_ids.append(axis_id)
-Index: cmor-2.8.3/Test/test_python_user_interface_00.py
+Index: cmor-2.9.3/Test/test_python_user_interface_00.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_user_interface_00.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_user_interface_00.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_user_interface_00.py
++++ cmor-2.9.3/Test/test_python_user_interface_00.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -40,18 +41,18 @@
+@@ -40,18 +41,18 @@ tables=[]
a = cmor.load_table(os.path.join(ipth,"../Tables/CMIP5_Omon"))
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Amon"))
@@ -3155,7 +3205,7 @@ Index: cmor-2.8.3/Test/test_python_user_interface_00.py
id='latitude'
units="degrees_north"
interval=""
-@@ -87,30 +88,30 @@
+@@ -87,30 +88,30 @@ myaxes2[1] = myaxes[3];
myaxes2[2] = myaxes[1];
myaxes2[3] = myaxes[2];
@@ -3194,7 +3244,7 @@ Index: cmor-2.8.3/Test/test_python_user_interface_00.py
# /* ok here we decalre a variable for region axis testing */
cmor.set_table(tables[0])
-@@ -125,7 +126,7 @@
+@@ -125,7 +126,7 @@ cmor.set_table(tables[1])
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)
@@ -3203,16 +3253,16 @@ Index: cmor-2.8.3/Test/test_python_user_interface_00.py
cmor.write(myvars[0],data2d,1)
cmor.close()
-Index: cmor-2.8.3/Test/test_python_user_interface_01.py
+Index: cmor-2.9.3/Test/test_python_user_interface_01.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_user_interface_01.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_user_interface_01.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_user_interface_01.py
++++ cmor-2.9.3/Test/test_python_user_interface_01.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from test_python_common import * # common subroutines
import cmor._cmor
-@@ -41,7 +42,7 @@
+@@ -41,7 +42,7 @@ tables=[]
a = cmor.load_table("Tables/CMIP5_grids")
tables.append(a)
tables.append(cmor.load_table("Tables/CMIP5_Amon"))
@@ -3221,29 +3271,49 @@ Index: cmor-2.8.3/Test/test_python_user_interface_01.py
cmor.set_table(tables[0])
-@@ -61,7 +62,7 @@
- longitude = lon_coords,
- latitude_vertices = lat_vertices,
+@@ -49,19 +50,19 @@ x,y,lon_coords,lat_coords,lon_vertices,l
+
+
+
+-myaxes[0] = cmor.axis(table_entry = 'y',
+- units = 'm',
++myaxes[0] = cmor.axis(table_entry = 'y',
++ units = 'm',
+ coord_vals = y)
+-myaxes[1] = cmor.axis(table_entry = 'x',
+- units = 'm',
++myaxes[1] = cmor.axis(table_entry = 'x',
++ units = 'm',
+ coord_vals = x)
+
+-grid_id = cmor.grid(axis_ids = myaxes[:2],
+- latitude = lat_coords,
+- longitude = lon_coords,
+- latitude_vertices = lat_vertices,
++grid_id = cmor.grid(axis_ids = myaxes[:2],
++ latitude = lat_coords,
++ longitude = lon_coords,
++ latitude_vertices = lat_vertices,
longitude_vertices = lon_vertices)
-print 'got grid_id:',grid_id
+print('got grid_id:',grid_id)
myaxes[2] = grid_id
mapnm = 'lambert_conformal_conic'
-@@ -91,7 +92,7 @@
+@@ -91,7 +92,7 @@ myvars[0] = cmor.variable( table_entry =
)
for i in range(ntimes):
data2d = read_2d_input_files(i, varin2d[0], lat,lon)
-- print 'writing time: ',i,data2d.shape,data2d
+- print 'writing time: ',i,Time[i],data2d.shape,data2d
- print Time[i],bnds_time[2*i:2*i+2]
-+ print('writing time: ',i,data2d.shape,data2d)
++ print('writing time: ',i,Time[i],data2d.shape,data2d)
+ print(Time[i],bnds_time[2*i:2*i+2] )
cmor.write(myvars[0],data2d,1,time_vals=Time[i],time_bnds=bnds_time[2*i:2*i+2])
cmor.close()
-Index: cmor-2.8.3/Test/test_python_user_interface_03.py
+Index: cmor-2.9.3/Test/test_python_user_interface_03.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_user_interface_03.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_user_interface_03.py 2013-06-15 10:56:19.000000000 +0100
+--- cmor-2.9.3.orig/Test/test_python_user_interface_03.py
++++ cmor-2.9.3/Test/test_python_user_interface_03.py
@@ -1,11 +1,12 @@
+from __future__ import print_function
import numpy
@@ -3259,7 +3329,7 @@ Index: cmor-2.8.3/Test/test_python_user_interface_03.py
import sys
sys.exit()
import os
-@@ -44,7 +45,7 @@
+@@ -44,7 +45,7 @@ def prep_var(data):
id=cmor.axis(table_entry='latitude',units=ax.units,coord_vals=ax[:],cell_bounds=ax.getBounds())
else:
id=cmor.axis(table_entry=str(ax.id),units=ax.units,coord_vals=ax[:],cell_bounds=ax.getBounds())
@@ -3268,7 +3338,7 @@ Index: cmor-2.8.3/Test/test_python_user_interface_03.py
axes.append(id)
var = cmor.variable(table_entry = data.id,
units = data.units,
-@@ -84,13 +85,13 @@
+@@ -84,13 +85,13 @@ def prep_cmor():
for var in ['tas',]:
@@ -3285,7 +3355,7 @@ Index: cmor-2.8.3/Test/test_python_user_interface_03.py
var_id = prep_var(data)
df = data.filled(data.missing_value)
cmor.write(var_id,df)
-@@ -100,8 +101,8 @@
+@@ -100,8 +101,8 @@ for var in ['tas',]:
if not numpy.allclose(s,data_ordered):
raise "Error reordering: %s"%o
else:
@@ -3297,21 +3367,21 @@ Index: cmor-2.8.3/Test/test_python_user_interface_03.py
#cmor.close()
-print 'Finito'
+print('Finito')
-Index: cmor-2.8.3/Lib/cmor_const.py
+Index: cmor-2.9.3/Lib/cmor_const.py
===================================================================
---- cmor-2.8.3.orig/Lib/cmor_const.py 2013-06-15 10:54:40.000000000 +0100
-+++ cmor-2.8.3/Lib/cmor_const.py 2013-06-15 10:54:40.000000000 +0100
+--- cmor-2.9.3.orig/Lib/cmor_const.py
++++ cmor-2.9.3/Lib/cmor_const.py
@@ -1,4 +1,4 @@
-import _cmor
+from . import _cmor
atts = """
CMOR_MAX_STRING
CMOR_MAX_ELEMENTS
-Index: cmor-2.8.3/Test/test_python_common.py
+Index: cmor-2.9.3/Test/test_python_common.py
===================================================================
---- cmor-2.8.3.orig/Test/test_python_common.py 2013-06-15 09:11:22.000000000 +0100
-+++ cmor-2.8.3/Test/test_python_common.py 2013-06-15 11:01:29.000000000 +0100
-@@ -105,7 +105,7 @@
+--- cmor-2.9.3.orig/Test/test_python_common.py
++++ cmor-2.9.3/Test/test_python_common.py
+@@ -105,7 +105,7 @@ def read_3d_input_files(it, varname, n0,
for k in range(n2):
for j in range(n1):
for i in range(n0):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cmor.git
More information about the debian-science-commits
mailing list