anjaroesel / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Request of Variable.cmp_type attribute #178

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi again. Sorry to bombard you with requests but I am really using your library 
intensively and therefore run into a lot of things.

Currently, if a variable has compound type you can see this by its dtype 
attribute. However, there exists no reference to its compound type, which is 
defined elsewhere in the ncdf file.

I was wondering if you can add an function or attribute in the Variable class 
that returns the CompoundType object. I suppose it can return None if the 
variable is not compound (or throw an exception).

Thanks in advance.

Original issue reported on code.google.com by titus...@gmail.com on 6 May 2013 at 4:23

GoogleCodeExporter commented 8 years ago
Not easily done, since the information is not saved when the variable is 
created.  I'll think about it some more and get back to you.

Original comment by whitaker.jeffrey@gmail.com on 7 May 2013 at 12:45

GoogleCodeExporter commented 8 years ago
added "datatype" property for Variable that returns numpy dtype for primitive
datatypes (same as dtype attribute) but returns CompoundType or VLType 
instance for compound or vlen variables.  Let me know how if this works for you.

Original comment by whitaker.jeffrey@gmail.com on 7 May 2013 at 4:59

GoogleCodeExporter commented 8 years ago
Haven't been able to test this since I'm not at work but this is what I was 
looking for. Thanks.

Original comment by titus...@gmail.com on 9 May 2013 at 7:49

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04