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 #7 NC_STRING Support. #76

Merged
merged 8 commits into from Jan 20, 2017
Merged

Fix #7 NC_STRING Support. #76

merged 8 commits into from Jan 20, 2017

Conversation

dnadeau4
Copy link
Contributor

@dnadeau4 dnadeau4 commented Jan 12, 2017

No description provided.

@durack1
Copy link
Member

durack1 commented Jan 12, 2017

@dnadeau4 great, what was the issue? It seems you've flaked Cdunifmodule.c so it's not easy to ascertain the fix

@dnadeau4
Copy link
Contributor Author

dnadeau4 commented Jan 12, 2017

Copy link
Contributor

@doutriaux1 doutriaux1 left a comment

@dnadeau4 when there are a lot of style changes it is useful to do them in a separate commit, it's eaiser to review if you do so.


def tearDown(self):
super(TestNCString, self).tearDown()
#os.remove("prcp_1951.nc")
Copy link
Contributor

@doutriaux1 doutriaux1 Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnadeau4 do you want to put that back in?

def testNCStringWrite(self):
cdms2.setNetcdf4Flag(1)
cdms2.setNetcdfClassicFlag(0)
cdms2.setNetcdfShuffleFlag(0)
Copy link
Contributor

@doutriaux1 doutriaux1 Jan 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't cdms2.setNetcdfClassicFlag(0) be after the next 3 lines? I'm sort of remembering the next 3 turn on netcdf3 classic. But I'm not sure.

@dnadeau4
Copy link
Contributor Author

dnadeau4 commented Jan 17, 2017

@doutriaux1 can you merge? Thanks!

@durack1
Copy link
Member

durack1 commented Jan 19, 2017

@dnadeau4 FYI, there's another issue that is occurring with the rewritten data:

ncdump -h ../CMIP6/input4MIPs/UColorado/radiation/RFMIP/fx/atmos/UColorado-RFMIP-0-4/multiple/none/v20170118/multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-0-4_none.nc | grep expt_label
        string expt_label(expt) ;
                expt_label:long_name = "experiment description" ;

The string variables are unable to be read:

Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.

infile = '/work/duro/Shared/160427_CMIP6_Forcing/CMIP6/input4MIPs/UColorado/radiation/RFMIP/fx/atmos/UColorado-RFMIP-0-4/multiple/none/v20170118/multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-0-4_none.nc'

import cdms2 as cdm

f = cdm.open(infile)

f.variables
Out[4]: 
{'c2f6_GM': <cdms2.fvariable.FileVariable at 0x7f599d9c02d0>,
...
 'expt_label': <cdms2.fvariable.FileVariable at 0x7f599de3ca90>,
...
 'water_vapor': <cdms2.fvariable.FileVariable at 0x7f599d9c0790>}

new = f('expt_label')
Traceback (most recent call last):
  File "<ipython-input-5-dc67af7a8c6f>", line 1, in <module>
    new = f('expt_label')
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/cudsinterface.py", line 33, in __call__
    return v(*args, **kwargs)
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/avariable.py", line 159, in __call__
    grid=grid)
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/selectors.py", line 195, in unmodified_select
    raw=raw)
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/avariable.py", line 776, in subRegion
    return self.subSlice(*slicelist, **d)
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/avariable.py", line 566, in subSlice
    d = self.expertSlice (slicelist)
  File "/export/duro/anaconda2/envs/uvcdatNightly/lib/python2.7/site-packages/cdms2/fvariable.py", line 86, in expertSlice
    result = apply(self._obj_.getitem,slist)
ValueError: data type must provide an itemsize

Is reading string variables now working with this PR?

@dnadeau4
Copy link
Contributor Author

dnadeau4 commented Jan 19, 2017

This one is for string attribute, I did not do the string variables yet. We should submit another issue, some people are waiting for this one to be merged.

@durack1
Copy link
Member

durack1 commented Jan 19, 2017

@dnadeau4 ok want me to migrate the comment above to a new issue?

@dnadeau4
Copy link
Contributor Author

dnadeau4 commented Jan 19, 2017

yes thanks!

@durack1
Copy link
Member

durack1 commented Jan 19, 2017

@dnadeau4 done #78 - so this PR should be merged pronto

@doutriaux1
Copy link
Contributor

doutriaux1 commented Jan 20, 2017

@durack1 pronto is rude.

@doutriaux1 doutriaux1 merged commit 05525fc into master Jan 20, 2017
@doutriaux1 doutriaux1 deleted the issue7_NCString branch Jan 20, 2017
@durack1
Copy link
Member

durack1 commented Jan 20, 2017

@doutriaux1 apologies if you feel that way, what other word replacement would you prefer I use?

@dnadeau4
Copy link
Contributor Author

dnadeau4 commented Jan 20, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants