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

cdutil.region.domain: variable loses unit attribute #9

Closed
chengzhuzhang opened this issue Feb 23, 2017 · 2 comments
Closed

cdutil.region.domain: variable loses unit attribute #9

chengzhuzhang opened this issue Feb 23, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@chengzhuzhang
Copy link

@chengzhuzhang chengzhuzhang commented Feb 23, 2017

After applying cdutil.region.domain, the transient variable lost the unit attributes

@doutriaux1
Copy link
Contributor

@doutriaux1 doutriaux1 commented Feb 28, 2017

import cdms2
import cdutil
import vcs
vcs.download_sample_data_files
f=cdms2.open(vcs.sample_data+"/clt.nc")
s=f("clt")
AA = cdutil.region.AAZ()
s2=s(AA)
print s.units
print s2.units

fails with:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-5cf75df63c22> in <module>()
      7 s2=s(AA)
      8 print s.units
----> 9 print s2.units

AttributeError: 'TransientVariable' object has no attribute 'units'

@doutriaux1
Copy link
Contributor

@doutriaux1 doutriaux1 commented Feb 28, 2017

actually loses all attributes from s

@dnadeau4 dnadeau4 closed this in 07627e2 Mar 23, 2017
@doutriaux1 doutriaux1 added this to the 2.10 milestone May 8, 2017
@doutriaux1 doutriaux1 added the bug label May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants