Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix python 3 aggregation issue and flake8 #244

Merged
merged 2 commits into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Src/Cdunifmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ static int cdopen(const char* controlpath, int ncmode, CuFileType *filetype) {
/* Take care for mode flag */
if ((cdms_classic == 0) || (cdms_shuffle != 0) || (cdms_deflate != 0)
|| (cdms_netcdf4 == 1)) {
ncmode = ncmode | NC_NETCDF4;
if(strstr(controlpath, "http") == NULL){
ncmode = ncmode | NC_NETCDF4;
}
}
#ifdef PARALLEL
/* ok we can only use MPIIO if not using shuffle or deflate for reason
Expand Down Expand Up @@ -3089,14 +3091,20 @@ static int PyCdunifVariableObject_ass_subscript(PyCdunifVariableObject *self,
if (PySlice_Check(index)) {
Py_ssize_t slicelen;
int length;
if( self->dimensions[0] == self->file->recdim ){
length = INT_MAX;
if( self->dimids[0]== self->file->recdim &&
self->dimensions[0] == 0){
length = INT_MAX;
} else {
length = self->dimensions[0];
}
PySlice_GetIndicesEx((PySliceObject *) index, length,
&indices->start, &indices->stop, &indices->stride,
&slicelen);

if(indices->stop == indices->start){
indices->stop = indices->start + indices->stride;
}
return PyCdunifVariable_WriteArray(self, indices, value);
}
if (PyTuple_Check(index)) {
Expand Down
2 changes: 1 addition & 1 deletion regrid2/Lib/esmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def __call__(self, srcField=None, dstField=None, zero_region=None):
# default is keep the masked values intact
zeroregion = ESMF.Region.SELECT
if self.regridMethod == CONSERVE:
zeroregion = None # will initalize to zero
zeroregion = None # will initalize to zero

self.regridHandle(
srcfield=srcField.field,
Expand Down
2 changes: 1 addition & 1 deletion regrid2/Lib/mvESMFRegrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def apply(self, srcData, dstData, rootPe, globalIndexing=False, **args):

zero_region = ESMF.Region.SELECT
if 'zero_region' in args.keys():
zero_region=args.get('zero_region')
zero_region = args.get('zero_region')

self.srcFld.field.data[:] = srcData.T
self.dstFld.field.data[:] = dstData.T
Expand Down