Skip to content

Commit

Permalink
Merge branch 'master' of github.com:/PCMDI/cmor
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadeau4 committed Aug 31, 2017
2 parents cac55c8 + 9ce2553 commit 84ebebe
Show file tree
Hide file tree
Showing 69 changed files with 9,060 additions and 3,434 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ env:
secure: V5q+wzxrJ5Rmk1vVYXimIdHgWUwZSHINd5W+oi3mTmfbtVyrngau9XQVZyiPyg8S309vHAbys9uMaplp83to7OY1Cw3+w002oMWkCaLwlVMn4UWs+xU7lJGn/wwLwN1OikZnTtiXF8RqrtBZpYsbAxjdebqZ8uZx/zDJXHVvvZY=

after_success:
#- if [ "$TRAVIS_OS_NAME" = "osx" ]; then bash scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then bash scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run -v `pwd`:/travis_home -e CONDA_UPLOAD_TOKEN=${CONDA_UPLOAD_TOKEN} -a STDOUT -a STDERR cdat/conda:conda-forge-cdms2 /travis_home/scripts/conda_upload.sh ${TRAVIS_BRANCH} ; fi
4 changes: 2 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INSTALLATION INSTRUCTIONS
-------------------------
Climate Model Output Rewriter (CMOR) version 3.2.5 installation instructions.
Climate Model Output Rewriter (CMOR) version 3.2.6 installation instructions.


DOWNLOAD
Expand All @@ -13,7 +13,7 @@ cd CMOR

INSTALLATION
------------
CMOR 3.2.5 requires external packages that need to be installed first.
CMOR 3.2.6 requires external packages that need to be installed first.
It can be compiled/linked against either NetCDF3 or NetCDF4. If you
decide to go with NetCDF4 be sure to build NetCDF4 with the
--enable-netcdf-4 option!
Expand Down
2 changes: 1 addition & 1 deletion Lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
close, grid, set_grid_mapping, time_varying_grid_coordinate, dataset_json,
set_cur_dataset_attribute, get_cur_dataset_attribute,
has_cur_dataset_attribute, set_variable_attribute, get_variable_attribute,
has_variable_attribute, get_final_filename, set_deflate)
has_variable_attribute, get_final_filename, set_deflate, set_furtherinfourl)

try:
from check_CMOR_compliant import checkCMOR
Expand Down
11 changes: 10 additions & 1 deletion Lib/pywrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def write(var_id, data, ntimes_passed=None, file_suffix="",
"Error: your data shape (%s) does not match the expected variable shape (%s)\nCheck your variable dimensions before caling cmor_write" %
(str(osh), str(ogoodshape)))
j += 1
elif ntimes_passed != 1:
else:
j += 1

data = numpy.ascontiguousarray(numpy.ravel(data))
Expand Down Expand Up @@ -952,6 +952,15 @@ def get_cur_dataset_attribute(name):
return None


def set_furtherinfourl(varid):
"""Sets further_url_info attribute for ES-DOC
Usage:
cmor.set_futherurlinfo(var_id)
Where:
var_id: is cmor variable id
"""
return _cmor.set_furtherinfourl(varid)

def set_variable_attribute(var_id, name, value):
"""Sets an attribute onto a cmor variable
Usage:
Expand Down
13 changes: 13 additions & 0 deletions LibCV/PrePARE/PrePARE.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ def ControlVocab(self):
varmissing = self.infile[self.var[0]]._FillValue[0]
varid = cmip6_cv.setup_variable(self.var[0], varunits, varmissing, startime, endtime,
startimebnds, endtimebnds)
if(varid == -1):
print bcolors.FAIL
print "====================================================================================="
print " Could not find variable '%s' in table '%s' " % (self.var[0], self.cmip6_table)
print "====================================================================================="
print bcolors.ENDC
cmip6_cv.set_CV_Error()
return

fn = os.path.basename(self.infile.id)
cmip6_cv.check_filename(
self.table_id,
Expand Down Expand Up @@ -337,6 +346,7 @@ def ControlVocab(self):
file_value = file_value[:idx]
table_value = table_value[:idx]


file_value = str(file_value)
table_value = str(table_value)
if table_value != file_value:
Expand All @@ -350,6 +360,9 @@ def ControlVocab(self):
else:
# That attribute is not in the file
table_value = prepLIST[key]
if key == "cell_measures":
if((table_value.find("OPT") != -1) or (table_value.find("MODEL") != -1)):
continue
if isinstance(table_value, numpy.ndarray):
table_value = table_value[0]
if isinstance(table_value, float):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CMOR 3.2 documentation can be found here: http://cmor.llnl.gov


[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.827366.svg)](https://doi.org/10.5281/zenodo.827366)
[![stable version](https://img.shields.io/badge/stable%20version-3.2.5-brightgreen.svg)](https://github.com/PCMDI/cmor/releases/tag/3.2.5)
[![stable version](https://img.shields.io/badge/stable%20version-3.2.6-brightgreen.svg)](https://github.com/PCMDI/cmor/releases/tag/3.2.6)
![platforms](https://img.shields.io/badge/platforms-linux%20|%20osx-lightgrey.svg)
[![Anaconda-Server Badge](https://anaconda.org/pcmdi/cmor/badges/installer/conda.svg)](https://conda.anaconda.org/pcmdi)
[![Anaconda-Server Badge](https://anaconda.org/pcmdi/cmor/badges/downloads.svg)](https://anaconda.org/pcmdi)
1 change: 1 addition & 0 deletions RELEASE-NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2018-08-31 : Release 3.2.6
2017-00-00 : Release 3.2.5
2017-06-16 : Release 3.2.4
2017-04-19 : Release 3.2.3
Expand Down
25 changes: 25 additions & 0 deletions Src/_cmormodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,30 @@ static PyObject *PyCMOR_time_varying_grid_coordinate(PyObject * self,
return (Py_BuildValue("i", coord_var_id));
}

/************************************************************************/
/* PyCMOR_grid() */
/************************************************************************/
static PyObject *PyCMOR_set_furtherinfourl(PyObject * self, PyObject * args)
{
int varid;
int ierr;

signal(signal_to_catch, signal_handler);

if (!PyArg_ParseTuple (args, "i", &varid)) {
return NULL;
}

ierr = cmor_CV_checkFurtherInfoURL(varid);

if (ierr != 0 || raise_exception) {
raise_exception = 0;
PyErr_Format(CMORError, exception_message, "set_futherurlinfo");
return NULL;
}

return (Py_BuildValue("i", ierr));
}
/************************************************************************/
/* PyCMOR_grid() */
/************************************************************************/
Expand Down Expand Up @@ -1006,6 +1030,7 @@ static PyMethodDef MyExtractMethods[] = {
{"has_variable_attribute", PyCMOR_has_variable_attribute,
METH_VARARGS},
{"get_original_shape", PyCMOR_get_original_shape, METH_VARARGS},
{"set_furtherinfourl", PyCMOR_set_furtherinfourl, METH_VARARGS},
{"get_final_filename", PyCMOR_getFinalFilename, METH_VARARGS},
{"set_deflate", PyCMOR_set_deflate, METH_VARARGS},
{NULL, NULL} /*sentinel */
Expand Down
16 changes: 8 additions & 8 deletions Src/_controlvocabulary.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include "numpy/arrayobject.h"
#include "cmor.h"

extern int cmor_CV_variable(int *, char *, char *, float *,
float, float, float, float);
extern int cmor_CV_variable(int *, char *, char *, double *,
double, double, double, double);

/************************************************************************/
/* PyCV_checkFilename */
Expand Down Expand Up @@ -555,15 +555,15 @@ static PyObject *PyCV_setup_variable(PyObject * self, PyObject * args)
{
char *name;
char *units;
float missing;
float startime;
float endtime;
float startimebnds;
float endtimebnds;
double missing;
double startime;
double endtime;
double startimebnds;
double endtimebnds;

int var_id;

if (!PyArg_ParseTuple(args, "ssfffff", &name, &units, &missing,
if (!PyArg_ParseTuple(args, "ssddddd", &name, &units, &missing,
&startime, &endtime, &startimebnds, &endtimebnds)) {
return (Py_BuildValue("i", -1));
}
Expand Down
Loading

0 comments on commit 84ebebe

Please sign in to comment.