pax_global_header00006660000000000000000000000064126412512520014512gustar00rootroot0000000000000052 comment=71e19501f4adbeb817012859da682f0bdd849d8a netcdf4-python-1.2.2rel/000077500000000000000000000000001264125125200150655ustar00rootroot00000000000000netcdf4-python-1.2.2rel/.travis.yml000066400000000000000000000012361264125125200172000ustar00rootroot00000000000000language: python sudo: false addons: apt: packages: - libhdf5-serial-dev - netcdf-bin - libnetcdf-dev env: global: - DEPENDS="numpy cython" - NO_NET=1 python: - "2.7" - "3.3" - "3.4" - "3.5" matrix: include: # Absolute minimum dependencies. - python: 2.6 env: - DEPENDS="numpy==1.7.0 cython==0.19 ordereddict==1.1" # Test without Cython installed. - python: 2.6 env: - DEPENDS="numpy ordereddict" notifications: email: false before_install: - pip install $DEPENDS install: - python setup.py build - python setup.py install script: - cd test - python run_all.py netcdf4-python-1.2.2rel/COPYING000066400000000000000000000035671264125125200161330ustar00rootroot00000000000000copyright: 2008 by Jeffrey Whitaker. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation. THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. parts of pyiso8601 are included in netcdftime under the following license: Copyright (c) 2007 Michael Twomey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. netcdf4-python-1.2.2rel/Changelog000066400000000000000000001377551264125125200167210ustar00rootroot00000000000000 version 1.2.2 (not yet released) ================================ * fix failing tests on python 2.6 (issue #497). Change minimum required python from 2.5 to 2.6. * Potential memory leaks fixed by freeing string pointers internally allocated in netcdf-c using nc_free_string. Also use nc_free_vlens to free space allocated for vlens inside netcdf-c (issue #495). * invoke str on filename argument to Dataset constructor, so pathlib instances can be used (issue #489). * don't use hardwired NC_MAX_DIMS or NC_MAX_VARS internally to allocate space for dimension or variable ids. Instead, find out the number of dims and vars and use malloc. NC_MAX_NAME is still used to allocate space for attribute and variable names, since there is no obvious way to determine the length of these names. * if trying to write a unicode attribute, check to see if it exists first and is NC_CHAR, and if so, delete it and recreate it. Workaround for C lib bug discovered in issue #485. * support for NETCDF3_64BIT_DATA format supported in netcdf-c 4.4.0. Similar to NETCDF3_64BIT (now NETCDF3_64BIT_OFFSET), but includes 64 bit dimensions and sizes, plus unsigned and 64 bit integer data types. * make sure chunksize does not exceed dimension size (for non-unlimited dimensions) on variable creation (issue #480). * add 'size' attribute to Dimension (same as len(d), where d is a Dimension instance, issue #477). * fix bug in nc3tonc4 with --unpackshort=1 (issue #474). * dates do not have to be contiguous, i.e. can be before and after the missing dates in Gregorian calendar (pull request #476). version 1.2.1 (tag v1.2.1rel) ============================= * add the capability to slice variables with unsorted integer sequences, or integer sequences with duplicates (issue #467). This was done by converting boolean array slices to integer array slices internally, instead of the other way around. * raise TypeError if masked array assigned to a VLEN str variable slice (issue #464). * Ellipsis now can be used with scalar VLEN str variables (issue #458). Slicing of scalar VLEN (non-str) variables now works. * Allow non-positive reference years in non-real-world calendars (issue #442). version 1.2.0 (tag v1.2.0rel) ============================= * Fixes to setup.py for building on windows (issue #460). * warnings now issued if file being read contains unsupported variables or data types (they were previously being silently skipped). * added 'get_variables_by_attributes' method (issue #454). * check for 'units' attribute in date2index (issue #453). * added support for enum types (issue #452). * added 'isopen' Dataset method (issue #450). * raise ValueError if year 0 or negative year used in time units string. The year 0 does not exist in the Julian and Gregorian calendars (issue #442). version 1.1.9 (tag v1.1.9rel) ============================= * fix for issue #391 (data is already byte-swapped to native endian format by the HDF4 library). * fix for issue #415 (copy.deepcopy does not work on netcdftime datetime object). * fix for issue #420 - len(v) where v is a scalar variable returned unexpected IndexError, now returns "TypeError: len() on unsized object" (same as numpy does for len() on a scalar array). * translate docstrings from epydoc markup to markdown, so pdoc can be used (epydoc is dead). * add small offset in conversion to Julian date for numerical stability (more accurate round trip calculations). This offset is removed in back conversion only from microseconds. Pull request #433. * add detection of unsigned integers to handling of automatic packing (set_auto_scale and set_auto_maskandscale) when writing. Pull request #435. * use USE_SETUPCFG env var to over-ride use of setup.cfg. If USE_SETUPCFG evaluates to false, setup.cfg will not be used and all configuration variables can be set from environment variables. Useful when using 'pip install' and nc-config is broken (issue #438). * fix for integer overflow in date2index (issue #444). version 1.1.8 (tag v1.1.8rel) ============================= * v[...] now returns a numpy scalar array (not just a scalar) when v is a scalar netcdf variable (issue #413). * unix-like paths can now be used in createVariable and createGroup. v = nc.createVariable('/path/to/var1',('xdim','ydim'),float) will create a Variable named 'var1', while also creating the Groups 'path' and 'path/to' if they do not already exist. Similarly, g = nc.createGroup('/path/to') acts like 'mkdir -p' in unix, creating the Groups 'path' and '/path/to', if they don't already exist. Users who relied on nc.createGroup(groupname) failing when the group already exists will have to modify their code, since nc.createGroup will now return the existing group instance. Dataset.__getitem__ also added. nc['/path/to'] returns a Group instance, and nc['/path/to/var1'] returns a Variable instance. * change minimum required numpy to 1.7.0, fix so all tests pass with 1.7.0. Added travis tests for minimum required cython, numpy (issue #404). * enable abbreviations to time units specification, as allowed in CF (issue #402). Now, instead of just 'seconds' and 'seconds', 'secs', 'sec' and 's' are also allowed (similar to minutes, days and hours). * install utility scripts in utils directory with setuptools entry points (pull request #392 from @mindw). Code for utilities moved to netCDF4_utils.py - makes utilities more windows-friendly. * make sure booleans are treated correctly in setup.cfg. Add use_cython (default True) to setup.cfg. If set to False, then cython will not be used to compile netCDF4.pyx (existing netCDF4.c will be used instead). * use "from Cython.Build import cythonize" instead of "from Cython.Distutils import build_ext" in setup.py (issue #393) to conform to new cython build mechanism (CEP 201, described at https://github.com/cython/cython/wiki/enhancements-distutils_preprocessing). * unicode attributes now written as strings, not bytes (using nc_put_att_string instead of nc_put_att_text, issue #388). * add __orthogonal_indexing__ attribute to Variable, Dataset and Group (issue #385) to denote that Variable objects do not follow numpy indexing semantics for integer and boolean array indices. * make sure application of scale_factor and add_offset works correctly when scale_factor not given (issue #381). * add man pages for nc3tonc4, nc4tonc3, ncinfo in man directory. Not installed by setup.py (contributed by Ross Gammon, issue #383). * replace tabs with spaces by running reindent.py on all *.py and *.pyx files (issue #378). * refactor netCDF4_utils and netCDF4 module into netCDF4 package. Refactoring effectively removes netCDF4 utils private attributes from netCDF4 namespace, so has the potential to break code using private attributes (issue #409). version 1.1.7 (tag v1.1.7rel) ============================= * check to make sure cython >= 0.19 is available before trying to use it (otherwise compilation with fail). Issue 367. * add ipython notebooks from Unidata workshop in examples directory. * fix ellipsis variable slicing regression (issue 371). * release the Global Interpreter Lock (GIL) when calling the C library for read operations. Speeds up multi-threaded reads (issue 369). Caution - the HDF5 library may need to be compiled with the threadsafe option to ensure that global data structures are not corrupted by simultaneous manipulation by different threads. * Make sure USE_NCCONFIG environment variable takes precedence over value of use_ncconfig in setup.cfg. With this change, 'pip install netCDF4' with USE_NCCONFIG=1 will use environment variables to find paths to libraries and include files, instead of relying on nc-config (issue #341). version 1.1.6 (tag v1.1.6rel) ============================= * fix for issue 353 (num2date can no longer handle units like 'hours since 2000-01-01 0'). * fix for issue 354 (num2date no longer supports multi-dimensional arrays). * fix for spurious UserWarning about endian-ness mismatch (issue 364). * make calendar name keyword for num2date/date2num case insensitive (issue 362). * make sure units parser returns time-zone naive datetime instance that includes UTC offset (issue 357). UTC offset was applied incorrectly in netcdftime.date2num and num2date. No longer need to depend on python-dateutil. version 1.1.5 (tag v1.1.5rel) ============================= * add dependency on python-dateutil in setup.py and install docs. * use python datetime in num2date and date2num whenever possible. Remove duplicate num2date and date2num functions from netcdftime. Addresses issue #344. Add microsecond capability to netcdftime.datetime. Roundtrip accuracy of num2date/date2num now down to less than a millisecond. * use nc-config by default to find dependencies. setup.py modified to handle failure to find nc-config more gracefully (issue #340). If you wish to use env vars to point to the libs, you must first move the setup.cfg file out of the way (rename it to setup.cfg.save), or set USE_NCCONFIG to 0. * if endian-ness of variable is specified, adjust datatype to reflect this when opening a file (issue 346). * fix for issue #349 (seconds outside the range 0-59 in netcdftime.num2date). version 1.1.4 (tag v1.1.4rel) ============================= * speedup conversion of array indices to slices (issue #325). * fix for issue #330 (incorrect values for seconds returned by netcdftime). * fix reading of scalar vlen variables (issue #333). * setting fill_value=False in createVariable for vlen and compound variables now does nothing, instead of causing an error when the Dataset is closed (issue #331). * cython will regenerate netCDF4.c when install is run, not just build. Makes 'pip install' do the right thing when cython is installed (issue #263). version 1.1.3 (tag v1.1.3rel) ============================= * checked in _datetime.c to git (resolves issue #315). Note - _datetime.c was *not* included in the 1.1.2 release. * Changed __str__ to __repr__ in MFDataset, to be consistent with Dataset (issue #317). IPython uses __repr__ to make use-friendly human-readable summaries of objects in the terminal. version 1.1.2 (tag v1.1.2rel) ============================= * fix for issue 312 (allow slicing with objects that can be cast to ints). * indexing netCDF variables with integer sequences and boolean arrays now behave the same way (integer sequences are converted to boolean arrays internally). Addresses issue #300. Since indexing using integer sequences does not behave exactly as before, some client code may break. For example, previously when integer index arrays had the same length, and that length was equal to the number of dimensions of the array being indexed, netcdf4-python mirrored the numpy indexing behavior and treated the elements of the index arrays as individual sets of integer indices. This special case has been removed. An IndexError is now raised when the new behavior would produce a different result than the old, i.e. when the indices in an integer sequence are not sorted, or there are duplicate indices in the sequence. * fix for issue #310 (masked arrays not returned correctly when variable has non native endian-ness). * fix for issue #306 (slicing variable with "-1" when there is only one element along that dimension). * Improved speed of num2date and date2num for standard, julian, gregorian and proleptic gregorian calendars by vectorizing the functions. See Issue #296 * Fix for issue #301 ("Datestring parser chokes on years with extra space"). * Add name property for Dimension, Variable and Group instances (to access string name associated with instance). * Allow for null byte attributes (so _FillValue='\x00' can be set manually). Issue 273. * Added __repr__ (matching __str__) for all types (pull request #291). IPython uses __repr__ to make use-friendly human-readable summaries of objects in the terminal. version 1.1.1 (tag v1.1.1rel) ============================== * make sure _FillValue is a byte for character arrays in Python 3 (issue 271). * add numpy to install_requires in setup.py (issue #282, fixes issue #211). 'pip install netcdf4-python' will no longer fail if numpy not installed. * Fix for issue 278 (UnicodeDecodeError reading netcdf.h from setup.py with Python 3.4). * Make netcdftime.datetime immutable and hashable (issue 255). * Fix issue with slicing of scalar VLEN arrays (issue 270). * Add set_auto_mask and set_auto_scale methods to control auto scaling and auto masking separately. (issue 269). Also added set_auto_maskandscale, set_auto_scale, set_auto_mask Dataset/Group methods that recursively walk through all variables in the Dataset/Group. * Make sure file_format attribute propagated to Group instances (issue 265). * Fix for issue #259 ("Cannot use broadcasting to set all elements of a Variable to a given value"). version 1.1.0 (tag v1.1.0rel) ============================= * revert weakref change, so that previous behaviour (Dimensions and Variables keep strong references to parent Dataset) is the default. New keyword argument 'keepweakref' for Dataset.__init__ can be set to true to get weak references. version 1.0.9 (tag v1.0.9rel) ============================= * speed up the creation of new Group instances (issue 239). * fix logic errors in setup.py (issue 236). * it is now possible to create and set variable length string variables with numpy string datatypes (pull request 224). * add .travis.yml (for travis-ci testing on github), silence warnings from test output (issue 225). * modify __unicode__ for Variable and Dimension to return more useful error message when Dataset object has been garbage collected. * use weak references to group instances when creating Dimension and Variable objects. This prevents cyclic references messing up garbage collection (issue 218, pull request 219). * accessing values from a 0-dimensional Variable now returns a 0-dimensional numpy array, not a 1-dimensional array (issue 220). To write code compatible with both the old and new (fixed) behavior, wrap values accessed from a 0-dimensional Variable with numpy.asscalar. * add an __array__ method to Variable to make numpy ufuncs faster (issue 216). * change download_url in setup.py to point to pypi instead of googlecode. * fix for date2index error when time variable has only one entry (issue 215). * silence warnings ("Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line") with Cython 0.2. * reduced memory usage for Variable.__getitem__ under Python 2. version 1.0.8 (tag v1.0.8rel) ============================= * change file_format Dataset attribute to data_model (keeping file_format for backward compatibility). Add disk_format attribute (underlying disk format, one of NETCDF3, HDF4, HDF5, DAP2, DAP4, PNETCDF or UNDEFINED). Uses nc_inq_format_extended, added in version 4.3.1 of library. If using earlier version of lib, disk_format will be set to UNDEFINED. * default _FillValue now ignored for byte data types (int8 and uint8) as per http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/Fill-Values.html#Fill-Values "If you need a fill value for a byte variable, it is recommended that you explicitly define an appropriate _FillValue attribute, as generic utilities such as ncdump will not assume a default fill value for byte variables". ncinfo now returns fill mode information (issue 209). * check to see if filling was disabled before masking data equal to default fill value (issue 209). * add variable type information to Dataset.__repr__ (output of ncinfo). version 1.0.7 (tag v1.0.7rel) ============================= * add the ability to specify the locations of hdf4,jpeg and curl libs, in case netCDF4 was built statically with HDF4 and/or OpenDAP support (issue 207). * add 'ncinfo' utility (like 'ncdump -h' but less verbose). * more information displayed when Dataset or Group instance is printed. * fix for issue 194 (versions after 1.0.5 fail for netcdf 4.1.1, due to call to nc_inq_path, which was added in netcdf 4.1.2). Fixed by adding compile time API check similar to what was done for nc_rename_grp. If filepath Dataset method is called an exception will be raised at runtime if the module was built with netcdf < 4.1.2, or cython was not installed at build time. * fix for issues 202 and 206 (exception raised by numpy.isnan for character data types). * if dateutils not installed and time unit accuracy < 1 second requested, have netcdftime raise an ImportError. version 1.0.6 (svn revision 1312) ================================ * issue warning of endian-ness of dtype argument does not match endian kwarg in createVariable. * make sure netcdf type NC_CHAR always returned in numpy array dtype 'S1' (sometimes arrays of type 'U1' were being returned). Fixes intermittently failing test tst_compoundatt.py on python 3.3. * fix for issue 201 (if data associated with numpy array not the same endian-ness as dtype, data was written incorrectly). Now bytes are swapped if necessary. Variable.endian() now returns 'native' instead of None for NETCDF3 formatted files. createVariable now enforces endian='native' for NETCDF3 files. Added tst_endian.py test case. * fix for issue 200 (library version detection failed on cygwin). * fix for issue 199 (nc4tonc3 utility not copying global attributes). * fix for issue 198 (setup.py chokes when no arguments given). * fix for issue 197 (slicing of netCDF variables using lists of integers). * create 'path' attribute for group instance using posixpath, instead of os.path (to ensure the unix path is used on all platforms). Issue 196. * fix for issue 196 (test failures on win32 due to files being deleted before they are closed). version 1.0.5 (svn revision 1278) ================================ * change setup.py to compile the Cython sources directly, if cython is available. This allows for "ifdef" like capability to modify source at compile time to account for changes in netcdf API (e.g. the forthcoming addition of the nc_rename_grp in version 4.3.1). * added a "renameGroup" method, which raises an exception if the netcdf lib version linked does not support it. Requires netcdf >= 4.3.1. * support for more than one missing value (missing_value attribute is a vector) when converting to masked array. * add 'renameAttribute' method to Dataset, Group and Variable. * fix so that var[:] = x works if x is a scalar, and var is a netcdf variable with an unlimited dimension that has shape () - i.e. no data has been written to it yet. Before this change, var[:] = x did not write any data. Now the scalar x will be written as the first entry in var along the unlimited dimension. * remove dos line feeds from nc3tonc4 (issue 181). * add 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 (issue 178). * fix logic for deciding where to look for nc-config in setup.py (issue 177). * issue a warning and don't try to apply scale_factor or add_offset if these attributes are not convertible to floats (issue 176). * add filepath method to Dataset instance to return file path (or opendap URL) used to create Dataset (issue 172). * fix for issue 170 (opening a remote DAP dataset fails after creating a NETCDF4 formatted file). * fix for issue 169 (error in chartostring function on 64-bit windows). * add support for missing_value or _FillValue == NaN (issue 168). * added a Dimension.group() method (issue 165). version 1.0.4 (svn revision 1229) ================================= * fixed alignment bug that could cause memory corruption when reading compound type variables. All users of compound types should upgrade. version 1.0.3 (svn revision 1219) ================================= * don't try to write empty data array to netcdf file (fixed failing test with netcdf 4.3.0rc2). * date2num, num2date and date2index now can handle units of microseconds and milliseconds (for proleptic_gregorian calendar, or gregorian and standard calendars as long as the time origin is after 1582-10-15). Issue 159. * Added a _grp attribute to Dimension (issue 165). * don't bundle ordereddict (issue 164). * support reading of vlen string attributes (issue 156). * add --vars option to nc3tonc4 (issue 154). * Don't try to set fletcher32 checksum on scalar variables (it causes HDF5 to crash). Fixes issue 150. * Add --istart/--istop options to nc3tonc4 (issue 148, courtesy of Rich Signell). * fix for proleptic_gregorian in netcdftime.py (courtesy of Matthias Cuntz). version 1.0.2 (svn revision 1196) ================================= * disable version check for HDF5, which is broken by hdf5 1.8.10. * make sure all files have a calendar attribute in MFTime (issue 144). * more robust fix to issue 90 (array shape modified by assignment to a netCDF variable with one more dimension), including test case. version 1.0.1 (svn revision 1190) ================================= * fix error that occurred when retrieving data from a variable that has a missing_value attribute specified as a string (issue 142). * automatically close netcdf files when there are no references left to Dataset object (using __dealloc__ method). Fixes issue 137. * fix for slicing of scalar vlen string variables (issue 140). * fix to allow writing of unicode data to a NC_CHAR variable. * allow for writing of large variables (> 2**32 elements). Fixes issue 130. version 1.0fix1 =============== * fix python 3 incompatibility in setup.py (issue 125). version 1.0 (svn revision 1164) =============================== * add 'aggdim' keyword to MFDataset, so the name of the dimension to aggregate over can be specified (instead of using the unlimited dimension). aggdim=None by default, which results in the previous behavior. aggdim must be the leftmost dimension of all the variables to be aggregated. * raise IndexError when indexing a netcdf variable out of range so iterating over a variable in a for loop behaves as expected (as described in http://effbot.org/zone/python-for-statement.htm). Fixes issue 121. * added MacPorts portfile (so it can be installed via MacPorts on macosx using a "local Portfile repository"). Installs from svn HEAD using 'port install netcdf4-python'. * added experimental 'diskless' file capability (only added to the C lib after the 4.2 release). Controlled by kwarg 'diskless' to netCDF4.Dataset (default False). diskless=True when creating a file results in a file that exists only in memory, closing the file makes the data disapper, except if persist=True keyword given in which case it is persisted to a disk file on close. diskless=True when opening a file creates an in-memory copy of the file for faster access. * add the ability to specify the location of the required libs (and whether to use nc-config) with setup.cfg, instead of using environment variables. * fix ISO9601 date parser so it recognizes time zone offsets in time unit strings (contributed by David Hassel, issue 114, r1117). * add setncatts Dataset,Group and Variable method to add a bunch of attributes (given in a python dictionary) at once. Speeds things up for NETCDF3 and NETCDF4_CLASSIC files a lot, since nc_redef/nc_enddef not need to be called for each attribute (issue 85, r1113). Adding 1000 attributes is about 35 times faster using setncatts to add them all at once. Makes no difference for NETCDF4 formatted files, since nc_redef/nc_enddef is not called. * only round after apply scale_factor and add_offset if variable type is integer (issue 111, r1109). * Fixed bug with all False Boolean index (r1107). * added support for after, before and nearest selection method to date2index fast "first guess" indexing (r1106). * Remove white space in time units string (netcdftime._parse_date). An extra space in the time units of one CMIP3 model caused an error (r1105). * based on results with examples/bench_compress2.py, change default complevel for zlib compression from 6 to 4. If complevel=0, turn compression off entirely (set zlib=False) (r1102). version 0.9.9 (svn revision 1099) ================================ * changed default unicode encoding from "latin-1" to "utf-8", since this is the python 3 default, and the only encoding that appears to work for dimension and variable names. * added test case for unicode attributes, variable and dimension names. * fixes for unicode variable, dimension and group names. * fix for unicode attributes in python3 (ncdump did not intrepret them as text strings). Issue 107. * add --format option to nc4tonc3 utility (can be either NETCDF3_CLASSIC or NETCDF3_64BIT). Fixes issue 104. version 0.9.8 (svn revision 1080) ================================ * use numpy.ma.isMA to check for masked array (instead of checking for presence of 'mask' attribute). * fixes for AIX with ibm xlc compiler. * make sure unicode attributes don't get converted to ascii strings (issue 98). version 0.9.7 (svn revision 1073) ================================ * Added __str__ methods to Dataset, Variable, Dimension, CompoundType, VLType and MFDataset, so useful human-readable information is provided when these objects are printed in an interactive session. * don't try to apply scale_factor and offset if scale_factor=1 and add_offset=0 (to avoid making copies of large arrays). * changed netCDF4._default_fillvals to netCDF4.default_fillvals (to make part of public API). Added to docs (issue 94). version 0.9.6 (svn revision 1043) ================================= * changed default unicode encoding from "ascii" to "latin-1" (iso-8859-1). * add "unicode_error" module variable to control what happens when characters cannot be decoded by the encoding specified by the "default_encoding" module variable (which is "ascii" by default). unicode_error = "replace" by default which means bad characters are replace by "?". Previously an error was raised, the old behavior can be obtained by setting unicode_error = 'strict'. Fixes issue 92. * add __enter__ and __exit__ methods so you can do "with Dataset(url) as f:" (issue 89). * don't add extra singleton dimensions to rhs numpy arrays when assigning to a netcdf variable. Fixes issue 90. * coerce missing_value attribute to same type as variable (for primitive types). Fixes issue 91. version 0.9.5 (svn revision 1031) ================================ * fix for compound variables on python 3.2. * fix slicing of masked MFDataset variables (issue 83). * round to nearest integer after packing with scale_factor and add_offset (instead of truncation) (issue 84). * if add_offset missing, but scale_factor present, assume add_offset zero. if scale_factor missing, but add_offset present, assume scale_factor one. (this is consistent with unidata recommendations - issue 86). * only try to convert strings to bytes for python 3 so Dataset can be subclassed (issue 87). version 0.9.4 (svn revision 1018) ================================ * tested with python 2.7.1/3.1.3 using netcdf 4.1.2 and hdf5 1.8.6. * Added a 'default_encoding' module variable that controls how unicode strings are encoded into bytes. Default is 'ascii'. * now works on Python 3. * netCDF3 module removed. If you still need it, get it from netCDF4 0.9.3. * regenerated C source with Cython 0.14.1. * Added a MFTime class. Provide a unified interface to MFDataset time variable using different time units. * Fixed bug in netcdftime (issue 75) that occurs when time specified is within one second of the end of the month. * on unix-like systems, the environment variable USE_NCCONFIG can be set to tell setup.py to use the nc-config script installed by netcdf to figure out where all the libs and headers are (without having to specify NETCDF_DIR, HDF5_DIR, etc). Only works with netcdf 4.1.2. version 0.9.3 (svn revision 930) ================================ * fix chunk sizes bug (chunk sizes pointer should be size_t, not int). Fixes issue 66. Added test in tst_compression.py * fixed writing of data with missing values with scale/offset packing. Added test (tst_masked2.py). * fix iso8601 regex in netcdftime date parser so it can parse 'hours since 1-1-1 ...' (year had to be 4 digits previously) version 0.9.2 (svn revision 907) ================================ * fix netcdftime bug with '360_day' calendar. Fixes issue 59. * make sure scalar slice of 1d variable returns array scalar (not array of shape (1,)). Fixes issue 57. * updated date parser in netcdftime. Can now handle units like "seconds since 1970-01-01T00:00:00Z". * added support in setup.py for specifying the locations of the HDF5/netcdf-4 headers and libs separately with environment variables (HDF5_INCDIR, HDF5_LIBDIR).i Patch contributed by Patrice Dumas. * add masked array support to num2date (dates for missing times set to None). * add chunk_cache keyword to createVariable. HDF5 default is 1mb, which can cause problems when creating 1000's of variables. In such cases, chunk_cache can be reduced, or set to zero. * add set_var_chunk_cache and get_var_chunk_cache Variable methods. * raise AttributeError when trying to set _FillValue attribute (it can only be reliably set on variable creation, using the fill_value keyword to createVariable). version 0.9.1 (svn revision 879) ================================ * raise ImportError if netcdf-4 < 4.1.1 or hdf5 <= 1.8.4. * add __netcdf4libversion__ and __hdf5libversion__ module variables. * make sure data is not truncated to integers before scale_factor and add_offset is applied (issue 46). * fix bug in date2num with noleap calendar in netcdftime (issue 45). * fix bug in 360day calendar in netcdftime (issue 44). * python 2.4 compatibility restored (by modifying OrderedDict). Fixes issue 37. * make sure int64 attributes cast to int32 when format=NETCDF4_CLASSIC. This was causing tst_multifile.py to fail on 64-bit platforms. * fix tutorial.py to cast 64 bit integers to 32 bit when writing to 32-bit integer vlen (was causing tutorial.py to fail on 64-bit platforms). * remove nose dependency from tst_netcdftime.py. version 0.9 (svn revision 846) ============================== * fixed bug (issue 30) with date2index occurring with dates outside the support. * make sure that auto masking works with MFDataset. * fix bug (issue 34) when slicing MFDataset variables with dimensions of length 1. * used ordered dictionaries for variables, dimensions, groups etc to preserve creation order (makes it easier to copy files, fixes issue 28). * change auto_maskandscale default to True. This means data will automatically be converted to and from masked arrays. Data scaled as short integers using the scale_factor and add_offset attributes will also be automatically converted to/from float arrays. * add setncattr, getncattr, delncattr methods (for setting/getting/deleting netcdf attributes with names that clash with the reserved python attributes). version 0.8.2 (svn revision 769) ================================ * compound type tests re-enabled. Compound and vlen types now fully supported in netcdf-4.1-beta2. * make sure data retrieved from a netCDF variable is not coerced to a python scalar (it should remain a numpy scalar array). * fix docs to point out that an unlimited dimension can be created by setting size to *either* None or 0 in createDimension. * fix another slicing corner case. * remove auto pickling/unpickling into vlen strings (too cute, sometimes produced surprising results). version 0.8.1 (svn revision 744) ================================ * added 'cmptypes' and 'vltypes' Group/Dataset attributes, which contain dictionaries that map the names of compound and vlen types to CompoundType and VLType instances. * Experimental variable-length (vlen) data type support added. * changes to accomodate compound types in netcdf-4.1-beta snapshots. Compound types now work correctly for snapshots >= 20090603. * Added __len__ method and 'size' property to Variable class. * In date2index, replaced the brute force method by the bisection method and added a 'select' keyword to find the index of the date before, after or nearest the given date. * Fixed bug occurring when indexing with a numpy array of length 1. * Fixed bug that occured when -1 was used as a variable index. * enabled 'shared access' mode for NETCDF3 formatted files (mode='ws', 'r+s' or 'as'). Writes in shared mode are unbuffered, which can improve performance for non-sequential access. * fixed bug in renameVariable that caused failure when new name is longer than old name, and file format is NETCDF3_64BIT or NETCDF3_CLASSIC. version 0.8 (svn revision 685) ============================== * added 'stringtoarr' utility function for converting python strings to numpy character arrays of a specified size. * initial support for compound data types (which are mapped to structured numpy arrays). Compound data types are created with the createCompoundTYpe Dataset or Group method. Both attributes and variables can be compound types. * make sure 64-bit integer attributes converted to 32 bits when writing to a NETCDF3 formatted file. * added nc4tonc3 utility for converted NETCDF4_CLASSIC files to NETCDF3_64BIT files (useful for sharing data with colleagues that don't have netcdf-4 capable clients). version 0.7.7 (svn revision 626) ================================ * David Huard reworked fancy indexing - it is now much more efficient and less of a memory hog. Now works differently than numpy fancy indexing - 1d arrays of boolean or integer indices work independently on each dimension. This enables things like: >>> tempdat = temp[[0,1,3],lats>0,lons>0] (retrieves 1st, 2nd and 4th levels, all Northern Hem. and Eastern Hem. grid points - note that this would raise an IndexError in numpy) * added opendap test (tst_dap.py). * bugfix for nc3tonc4 utility. * fix MFDataset.Variable. __getattr__ to raise AttributeError instead of KeyError when attribute not found. * netcdftime version number upped to 0.7. version 0.7.6 (svn revision 574) ================================ * added date2index function, courtesy of David Huard, which finds the indices in a netCDF time variable corresponding to a sequence of datetime instances. * make _get_att/_set_att raise AttributeError instead of RuntimeError, so that getattr(object, 'nonexistantattribute', None) works. (thanks David Huard) * v[:] = data now works along unlim dim, i.e. you can do this: file = Dataset('test.nc', "w") file.createDimension("time", None) # unlimited dimension var = file.createVariable("var", 'd', ("time",)) # you used to have to do this #var[0:10] = numpy.arange(10) # but now you can simply do this var[:] = numpy.arange(10) version 0.7.5 (svn revision 549) ================================ * return a scalar array, not a python scalar, when a slice returns a single number. This is more consistent with numpy behavior, and fixes a bug in MFDataset slicing. * added 'exclude' parameter to MFDataset.__init__ * added set_auto_maskandscale method to MFDataset variables. version 0.7.4 (svn revision 540) ================================ * ensure all arithmetic is done with float64 in netcdftime (Rob Hetland). * fixes for netcdf-4.0-beta2 ('chunking' keyword to createVariable replaced by 'contiguous'). Now works with netcdf-4.0-beta2 and hdf5-1.8.0 final, but is incompatible with netcdf-4.0-beta1. version 0.7.3.1 (svn revision 507) ================================== * netCDF3 docs were missing from 0.7.3. * make sure quantization function preserves fill_value of masked arrays. version 0.7.3 (svn revision 501) ================================ * MFnetCDF4 module merged into netCDF4 and netCDF3 (now called MFDataset). * added netCDF3 module for those who can't install the netCDF 4 lib. * added set_auto_maskandscale Variable method to enable automatic packing and unpacking of short integers (using scale_factor and add_offset attributes) and automatic conversion to/from masked arrays (using missing_value or _FillValue attribute) on a per-variable basis. var.set_auto_maskandscale(True) turns automatic conversion on (it is off by default). * automatically pack/unpack short integer variables if scale_factor and add_offset variable attributes are set. * added support for masked arrays. If you try to write a masked array to a variable with the missing_value or _FillValue attributes set, the masked array is filled with that value before being written to the file. If you read data from a variable with the missing_value or _FillValue attribute set, a masked array is returned with the appropriate values masked. * added date2num and num2date functions. * added capability to use 'fancy indexing' with variable objects (i.e. using sequences of integers or booleans in slices). WARNING: if a sequence of integers or booleans is used to slice a netCDF4 variable, all of the data in that dimension is read into a numpy array, and then the sequence is used to slice the numpy array, returning just the requested elements to the user. This can potentially gobble a lot of memory and degrade performance (especially if 'fancy indexing' is done on the left-most dimension). * added convenience functions stringtochar and chartostring for converting character arrays to arrays of fixed-length strings and vice-versa. Example usage in examples/test_stringarr.py. 20070826 - version 0.7.1 (svn revision 400) =========================================== * added 'endian()' and 'chunking()' Variable methods (to inquire about endian and chunking variable settings). * 'ndim' attribute was not public (so it couldn't be accessed from python). Fixed. * added 'endian' kwarg to createVariable (to set the endian-ness used in the HDF5 file). * can now manually set HDF5 chunksizes for each dimension at variable creation, using 'chunksizes' kwarg to createVariable. * added "getlibversion()" function to get info about version of netcdf-4 library used to build module. * if a variable has an unsupported datatype (such as 'compound', or 'vlen'), then instead of raising an exception, just skip it. Print a useful error message when an attribute with an unsupported datatype is accessed. * if variable dimension is specified as 'dimname' or ('dimname') in createVariable, it is automatically converted to a tuple ('dimname',). Better error messages when specified dimension can't be found. * createVariable accepts numpy dtype object as datatype. dtype variable attribute is now a numpy dtype object. 20070723 - version 0.7 (svn revision 361) ========================================= * renamed MFnetCDF4_classic --> MFnetCDF4. * eliminated netCDF4_classic module (all file formats handled by netCDF4 module now). * removed all user-defined data type stuff (it was hacky and made the code too complex - wait till there is a real use case to refactor and put back in). * added 'ndim' variable attribute (number of variable dimensions). 20070424 - version 0.6.3 (svn revision 302) =========================================== * passes all tests with netcdf-4.0-beta1/hdf5-1.8.0-beta1. * if slice index is not a slice object, assume it's an integer (and try to convert to one if it is not). This allows numpy scalar arrays to work as slice indices. * (netCDF4_classic only) try to make sure file is not left in 'define mode' when execption is raised. * if slicing a variable results in a array with shape (1,), just return a scalar (except for compound types). * added instructions for using the netCDF4_classic module to serve data over http with the DAP using pydap (http://pydap.org). * added --quiet and --chunk options to nc3tonc4. * Turned off zlib compression by default so as not to violate the 'principle of least surprise'. Shuffle filter still activated by default when zlib compression turned on. * Fixed bug in fletcher32 checksum activation call. Renamed compression() variable method to filters(), include fletcher32 checksum flag in output. * added utility for converting GRIB1 files to compressed NETCDF4_CLASSIC files (requires PyNIO). * added 'compression()' variable method that returns a dict with compression filter parameter settings for that variable. (rev 237) * reimplemented 'shape' and 'dimensions' variable attributes as properties. * fixed bug when 'chunking' keyword in createVariable was set to 'sub' (caused Bus Error on MacOS X). * Setting 'shuffle=0' keyword in createVariable was turning off zlib compression filter instead of shuffle filter. Fixed. 20070213 - version 0.6.2 ======================== * updated for compatibility with netcdf-4.0-alpha18 and hdf5 1.8.0alpha5 (shared dimensions actually work now). * netCDF4.createVariable can now use old single character Numeric typecodes for datatype specification. * Improvements to MFDataset (now called MFnetCDF4_classic) by Rob Hetland. 20061121 - version 0.6.1 ======================== * bugfixes for negative strides. * bugfix for empty string attributes. * support for shared dimensions (variables can use dimensions defined only in a parent group). This doesn't actually work yet, because of a bug in netcdf-4.0-alpha17. * now requires Pyrex (C source files generated on the fly when setup.py is run). 20061003 - version 0.6 ====================== * if fill_value keyword to createVariable is set to the Boolean False (not an integer that evaluates to False), no pre-filling is done for that variable. * updated to be compatible with netcdf-4.0-alpha17. Can now install pure-python netcdftime separately with setup-netcdftime.py. netcdftime will try to use numpy, but fall back to Numeric if numpy not installed. * generated source files with a version of pyrex (from http://codespeak.net/svn/lxml/pyrex/) that produces extensions compatible with python 2.5. * added new module for multi-file access of NETCDF3 and NETCDF4_CLASSIC files (MFDataset). Based on CDFMF from pycdf. * implement negative strides in variable slicing (feature missing from Scientific.IO.NetCDF). Now variables support full python extended slicing syntax. 20060925 - version 0.5.1 ======================== * on 64-bit systems integer attributes in netCDF4_classic failed, since there is no 64-bit integer data type. Fixed by downcasting to 32-bit integer. 20060920 - version 0.5 ====================== * Compound type support! (members must be fixed data primitive types - no user-defined types or NC_STRING variables allowed). Attributes are still restricted to primitive data types (no vlen or compound type attributes). * Assigning single values to a slice now does the Right Thing, i.e. >>> data[:] = 1 fills all the elements with 1 (instead of raising an IndexError). * Tested with numpy 1.0b5, netcdf-4.0-alpha16, HDF5 1.7.52 alpha. * Added renameDimension and renameVariable methods to Dataset and Group classes. * netCDF attributes can be deleted using python del (i.e. 'del dset.foo'). * Moved examples from test and test_classic to examples and examples_classic directories. * Added proper unit tests (in test and test_classic directories). * NULL characters are removed from text attributes. * Variable _FillValue can be set using new keyword argument 'fill_value' to createVariable Dataset and Group method. * docstrings now formatted with epydoc (http://epydoc.sf.net). * improved Scientific.IO.NetCDF compatibility for netCDF4_classic (typecode method, ability to use old Numeric typecodes). * zlib=False or complevel=0 disables shuffle filter in createVariable. * subversion repository hosted on Google projects (http://code.google.com/p/netcdf4-python/). * examples_classic/bench2.py is a performance comparison with Scientific.IO.NetCDF (the numpy version provided by pynetcdf). * __dict__ attribute of Dataset, Group or Variable provides a python dictionary with all netCDF attribute name/value pairs (just like Scientific.IO.NetCDF). 20060710 - version 0.4.5 ======================== * fixed to work with recent svn versions of numpy * Now requires at least numpy 0.9.8. * Raise a AttributeError if user tries to rebind a private attribute (like 'variables', 'dimensions' or 'dtype'). 20060629 - version 0.4.4 ======================== * fixed to work with netcdf-4.0-alpha14. * automatically cast _FillValue attribute to variable type, to avoid surprising error message. 20060320 - version 0.4.3 ======================== updated netcdftime module yet again added 'all_leap'/'366_day' and '360_day' calendars. netCDFTime class renamed utime, fwd and inv methods renamed date2num and num2date. These methods can now handle numpy arrays as well as scalars. a 'real' python datetime instance is returned if calendar is gregorian, otherwise a 'datetime-like' instance is returned (python datetime can't handle funky dates in 'all_leap' and '360_day' calendars). 20060316 - version 0.4.2 ======================== udunits module replaced by pure python version, renamed 'netcdftime' No longer requires udunits library. Includes 4 calendars ('julian','standard'/'gregorian','proleptic_gregorian','noleap'/'365_day'). Calendar names and their interpretations follow the CF metadata convention. 20060310 - version 0.4.1 ======================== udunits module included for doing time conversions. 20060306 - version 0.4 ====================== netCDF4_classic module can now write NETCDF3_CLASSIC, NETCDF4_64BIT as well as NETCDF4_CLASSIC files. The file format is given as an optional keyword to the Dataset constructor ('NETCDF4_CLASSIC' is the default). Preliminary work on compound types done - but awaiting the next alpha of the netCDF 4 library to complete (bugs in alpha12 prevent it from working properly if the compound type has fields which are arrays). 20060217 - version 0.3.1 ======================== refactored user-defined data type support - user-defined data types are now described by an instance of the class UserType. usertype and usertype_name keyword args eliminated from createVariable. 20060214 - version 0.3 ====================== support for variable length strengths (typecode = 'S') and variable-length, or 'ragged' arrays (vlen user-defined datatype). Arrays of python objects can be saved as pickled strings with datatype = 'S'. 20050128 - version 0.2.5 ======================== added support for scalar variables (and assignValue, getValue Variable methods for Scientific.IO.NetCDF compatibility). 20051123 - version 0.2.4 ======================== numpy 0.9.4 compatibility Changed data type codes from ('d', 'f', 'i', 'h', ...) to ('f8', 'f4', 'i4', 'i2', ...). 20050110 - version 0.2.3 ======================== added ellipsis slicing capability 20050106 - version 0.2.2 ======================== changed scipy_core to numpy. 20051228 - version 0.2.1 ======================== bugfixes, added 'nc3tonc4' utility to convert netCDF version 3 files to NETCDF4_CLASSIC files (with compression). The converted files can be read from netCDF 3 clients that have been re-linked to the netCDF 4 library. 'chunking' keyword added to createVariable in netCDF4 module. 20051224 - version 0.2 ====================== Added netCDF4_classic module - which creates files in NETCDF4_CLASSIC format. These files are compatible with netCDF 3 clients which have been linked against the netCDF 4 lib. This module does not use any new features of the netCDF 4 API except zlib compression. Unlike any other netCDF 3 python client, it can transparently compress data with zlib compression and the HDF5 shuffle filter. 20051222 - version 0.1 ====================== First release. Supports groups, multiple unlimited dimensions, zlib compression (plus shuffle filter and fletcher32 checksum) and all new primitive data types. No support for user-defined data types yet. netcdf4-python-1.2.2rel/MANIFEST.in000066400000000000000000000011341264125125200166220ustar00rootroot00000000000000recursive-include docs * recursive-include man * recursive-include include * include MANIFEST.in include README.md include COPYING include Changelog include setup.cfg include setup.cfg.template include examples/*py include examples/*ipynb include examples/README.md include test/*py include test/*nc include utils/nc3tonc4 include utils/nc4tonc3 include utils/ncinfo include netcdftime/__init__.py include netcdftime/_datetime.pyx include netcdftime/netcdftime.py include netcdftime/_datetime.c include netCDF4/__init__.py include netCDF4/_netCDF4.pyx include netCDF4/utils.py include netCDF4/_netCDF4.c netcdf4-python-1.2.2rel/PKG-INFO000066400000000000000000000021041264125125200161570ustar00rootroot00000000000000Metadata-Version: 1.0 Name: netCDF4 Version: 0.5 Summary: netCDF version 4 has many features not found in earlier versions of the library, such as hierarchical groups, zlib compression, multiple unlimited dimensions, and new data types. It is implemented on top of HDF5. This module implements many of the new features, and can read netCDF files created with older versions of the library. The API is modelled after Scientific.IO.NetCDF, and should be familiar to users of that module Home-page: http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/python/netCDF4.html Author: Jeff Whitaker Author-email: jeffrey.s.whitaker@noaa.gov License: ['OSI Approved'] Download-URL: http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/python/netCDF4-0.4.4.tar.gz Description: UNKNOWN Platform: any Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Archiving :: Compression Classifier: Operating System :: OS Independent netcdf4-python-1.2.2rel/README.gh-pages000066400000000000000000000007661264125125200174500ustar00rootroot00000000000000To update web docs at http://github.unidata.io/netcdf4-python: First install fork of pdoc from https://github.com/jswhit/pdoc (requires mako, markdown, pygments and future). Then in netcdf4-python github clone directory (after building and installing github master), * generate docs (sh create_docs.sh) * copy docs/netCDF4/index.html up one level (cp docs/netCDF4/index.html ..) * git checkout gh-pages * cp ../index.html . * git commit index.html * git push origin gh-pages * git checkout master netcdf4-python-1.2.2rel/README.md000066400000000000000000000112211264125125200163410ustar00rootroot00000000000000# netcdf4-python [Python](http://python.org)/[numpy](http://numpy.org) interface to the netCDF [C library](https://github.com/Unidata/netcdf-c). [![Build Status](https://travis-ci.org/Unidata/netcdf4-python.svg?branch=master)](https://travis-ci.org/Unidata/netcdf4-python) [![PyPI package](https://badge.fury.io/py/netCDF4.svg)](http://python.org/pypi/netCDF4) ## News For the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). 1/1/2016: Version [1.2.2](https://pypi.python.org/pypi/netCDF4/1.2.2) released. Mostly bugfixes, but with two new features. * support for the new ``NETCDF3_64BIT_DATA`` format introduced in netcdf-c 4.4.0. Similar to ``NETCDF3_64BIT`` (now ``NETCDF3_64BIT_OFFSET``), but includes 64 bit dimension sizes (> 2 billion), plus unsigned and 64 bit integer data types. Uses the classic (netcdf-3) data model, and does not use HDF5 as the underlying storage format. * Dimension objects now have a ``size`` attribute, which is the current length of the dimension (same as invoking ``len`` on the Dimension instance). The minimum required python version has now been increased from 2.5 to 2.6. 10/15/2015: Version [1.2.1](https://pypi.python.org/pypi/netCDF4/1.2.1) released. Adds the ability to slice Variables with unsorted integer sequences, and integer sequences with duplicates. 9/23/2015: Version [1.2.0](https://pypi.python.org/pypi/netCDF4/1.2.0) released. New features: * [get_variables_by_attributes](http://unidata.github.io/netcdf4-python/#netCDF4.Dataset.get_variables_by_attributes) ``Dataset`` and ``Group`` method for retrieving variables that have matching attributes. * Support for [Enum](http://unidata.github.io/netcdf4-python/#section12) data types. * [isopen](http://unidata.github.io/netcdf4-python/#netCDF4.Dataset.isopen) `Dataset` method. 7/28/2015: Version [1.1.9](https://pypi.python.org/pypi/netCDF4/1.1.9) bugfix release. 5/14/2015: Version [1.1.8](https://pypi.python.org/pypi/netCDF4/1.1.8) released. Unix-like paths can now be used in `createVariable` and `createGroup`. ```python v = nc.createVariable('/path/to/var1', ('xdim', 'ydim'), float) ``` will create a variable named 'var1', while also creating the groups 'path' and 'path/to' if they do not already exist. Similarly, ```python g = nc.createGroup('/path/to') ``` now acts like `mkdir -p` in unix, creating groups 'path' and '/path/to', if they don't already exist. Users who relied on `nc.createGroup(groupname)` failing when the group already exists will have to modify their code, since `nc.createGroup` will now return the existing group instance. `Dataset.__getitem__` was also added. `nc['/path/to']` now returns a group instance, and `nc['/path/to/var1']` now returns a variable instance. 3/19/2015: Version [1.1.7](https://pypi.python.org/pypi/netCDF4/1.1.7) released. Global Interpreter Lock (GIL) now released when extension module calls C library for read operations. This speeds up concurrent reads when using threads. Users who wish to use netcdf4-python inside threads should read http://www.hdfgroup.org/hdf5-quest.html#gconc regarding thread-safety in the HDF5 C library. Fixes to `setup.py` now ensure that `pip install netCDF4` with `export USE_NCCONFIG=0` will use environment variables to find paths to libraries and include files, instead of relying exclusively on the nc-config utility. ## Quick Start * Clone GitHub repository (`git clone https://github.com/Unidata/netcdf4-python.git`), or get source tarball from [PyPI](https://pypi.python.org/pypi/netCDF4). Links to Windows and OS X precompiled binary packages are also available on [PyPI](https://pypi.python.org/pypi/netCDF4). * Make sure [numpy](http://www.numpy.org/) (required) and [Cython](http://cython.org/) (recommended) are installed and you have [Python](https://www.python.org) 2.6 or newer. * Make sure [HDF5](http://www.h5py.org/) and netcdf-4 are installed, and the `nc-config` utility is in your Unix PATH. If `setup.cfg` does not exist, copy `setup.cfg.template` to `setup.cfg`, and make sure the line with `use_ncconfig=True` is un-commented. * Run `python setup.py build`, then `python setup.py install` (with `sudo` if necessary). * To run all the tests, execute `cd test && python run_all.py`. ## Documentation See the online [docs](http://unidata.github.io/netcdf4-python) for more details. ## Usage ###### Sample [iPython](http://ipython.org/) notebooks available in the examples directory on [reading](http://nbviewer.ipython.org/github/Unidata/netcdf4-python/blob/master/examples/reading_netCDF.ipynb) and [writing](http://nbviewer.ipython.org/github/Unidata/netcdf4-python/blob/master/examples/writing_netCDF.ipynb) netCDF data with Python. netcdf4-python-1.2.2rel/README.wheels.md000066400000000000000000000073231264125125200176370ustar00rootroot00000000000000# Building and uploading wheels ## For OSX We automate OSX wheel building using a custom github repository that builds on the travis-ci OSX machines. The travis-ci interface for the builds is : https://travis-ci.org/MacPython/netcdf4-python-wheels The driving github repository is : https://github.com/MacPython/netcdf4-python-wheels ### How it works The wheel-building repository: * does a fresh build of the required C / C++ libraries; * builds a netcdf4-python wheel, linking against these fresh builds; * processes the wheel using [delocate](https://pypi.python.org/pypi/delocate). `delocate` copies the required dynamic libraries into the wheel and relinks the extension modules against the copied libraries; * uploads the built wheel to http://wheels.scipy.org (a Rackspace container kindly donated by Rackspace to scikit-learn). The resulting wheel is therefore self-contained and does not need any external dynamic libraries apart from those provided as standard by OSX. ### Triggering a build You will need write permision to the github repository to trigger new builds on the travis-ci interface. Contact us on the mailing list if you need this. You can trigger a build by: * making a commit to the `netcdf4-python-wheels` repository (e.g. with `git commit --allow-empty`); or * clicking on the circular arrow icon towards the top right of the travis-ci page, to rerun the previous build. In general, it is better to trigger a build with a commit, because this makes a new set of build products and logs, keeping the old ones for reference. Keeping the old build logs helps us keep track of previous problems and successful builds. ### Which netcdf4-python commit does the repository build? By default, the `netcd4-python-wheels` repository is usually set up to build the latest git tag. To check whether this is so have a look around line 5 of `.travis.yml` in the `netcdf4-python-wheels` repository. You should see something like: ``` - BUILD_COMMIT='latest-tag' ``` If this is commented out, then the repository is set up to build the current commit in the `netcdf4-python` submodule of the repository. If it is set to another value then it will be specifying a commit to build. You can therefore build any arbitrary commit by specificying the commit hash or branch name or tag name in this line of the `.travis.yml` file. ### Uploading the built wheels to pypi Be careful, http://wheels.scipy.org points to a container on a distributed content delivery network. It can take up to 15 minutes for the new wheel file to get updated into the container at http://wheels.scipy.org. When the wheels are updated, you can of course just download them to your machine manually, and then upload them manually to pypi, or by using [twine][twine]. You can also use a script for doing this, housed at : https://github.com/MacPython/terryfy/blob/master/wheel-uploader You'll need [twine][twine] and [beautiful soup 4][bs4]. You will typically have a directory on your machine where you store wheels, called a `wheelhouse`. The typical call for `wheel-uploader` would then be something like: ``` wheel-uploader -v -w ~/wheelhouse netCDF4 1.1.8 ``` where: * `-v` means give verbose messages; * `-w ~/wheelhouse` means download the wheels from https://wheels.scipy.org to the directory `~/wheelhouse`; * `netCDF4` is the root name of the wheel(s) to download / upload; * `1.1.8` is the version to download / upload. So, in this case, `wheel-uploader` will download all wheels starting with `netCDF4-1.1.8-` from http://wheels.scipy.org to `~/wheelhouse`, then upload them to pypi. Of course, you will need permissions to upload to pypi, for this to work. [twine]: https://pypi.python.org/pypi/twine [bs4]: https://pypi.python.org/pypi/beautifulsoup4 netcdf4-python-1.2.2rel/checkversion.py000066400000000000000000000003721264125125200201240ustar00rootroot00000000000000import netCDF4 import sys sys.stdout.write('netcdf4-python version: %s\n'%netCDF4.__version__) sys.stdout.write('HDF5 lib version: %s\n'%netCDF4.__hdf5libversion__) sys.stdout.write('netcdf lib version: %s\n'%netCDF4.__netcdf4libversion__) netcdf4-python-1.2.2rel/create_docs.sh000066400000000000000000000004461264125125200177000ustar00rootroot00000000000000# Uses pdoc (https://github.com/BurntSushi/pdoc) # to create html docs from docstrings in Cython source. # Use hacked version at https://github.com/jswhit/pdoc # which extracts cython method docstrings and function signatures. pdoc --html --html-no-source --overwrite --html-dir 'docs' netCDF4 netcdf4-python-1.2.2rel/docs/000077500000000000000000000000001264125125200160155ustar00rootroot00000000000000netcdf4-python-1.2.2rel/docs/netCDF4/000077500000000000000000000000001264125125200172045ustar00rootroot00000000000000netcdf4-python-1.2.2rel/docs/netCDF4/index.html000066400000000000000000012170671264125125200212170ustar00rootroot00000000000000 netCDF4 API documentation Top

netCDF4 module

Version 1.2.2


Introduction

netcdf4-python is a Python interface to the netCDF C library.

netCDF version 4 has many features not found in earlier versions of the library and is implemented on top of HDF5. This module can read and write files in both the new netCDF 4 and the old netCDF 3 format, and can create files that are readable by HDF5 clients. The API modelled after Scientific.IO.NetCDF, and should be familiar to users of that module.

Most new features of netCDF 4 are implemented, such as multiple unlimited dimensions, groups and zlib data compression. All the new numeric data types (such as 64 bit and unsigned integer types) are implemented. Compound (struct), variable length (vlen) and enumerated (enum) data types are supported, but not the opaque data type. Mixtures of compound, vlen and enum data types (such as compound types containing enums, or vlens containing compound types) are not supported.

Download

Requires

  • Python 2.6 or later (python 3 works too).
  • numpy array module, version 1.7.0 or later.
  • Cython, version 0.19 or later, is optional - if it is installed setup.py will use it to recompile the Cython source code into C, using conditional compilation to enable features in the netCDF API that have been added since version 4.1.1. If Cython is not installed, these features (such as the ability to rename Group objects) will be disabled to preserve backward compatibility with older versions of the netCDF library.
  • For python < 2.7, the ordereddict module.
  • The HDF5 C library version 1.8.4-patch1 or higher (1.8.8 or higher recommended) from . Be sure to build with --enable-hl --enable-shared.
  • Libcurl, if you want OPeNDAP support.
  • HDF4, if you want to be able to read HDF4 "Scientific Dataset" (SD) files.
  • The netCDF-4 C library from ftp://ftp.unidata.ucar.edu/pub/netcdf. Version 4.1.1 or higher is required (4.2 or higher recommended). Be sure to build with --enable-netcdf-4 --enable-shared, and set CPPFLAGS="-I $HDF5_DIR/include" and LDFLAGS="-L $HDF5_DIR/lib", where $HDF5_DIR is the directory where HDF5 was installed. If you want OPeNDAP support, add --enable-dap. If you want HDF4 SD support, add --enable-hdf4 and add the location of the HDF4 headers and library to $CPPFLAGS and $LDFLAGS.

Install

  • install the requisite python modules and C libraries (see above). It's easiest if all the C libs are built as shared libraries.
  • By default, the utility nc-config, installed with netcdf 4.1.2 or higher, will be run used to determine where all the dependencies live.
  • If nc-config is not in your default $PATH, rename the file setup.cfg.template to setup.cfg, then edit in a text editor (follow the instructions in the comments). In addition to specifying the path to nc-config, you can manually set the paths to all the libraries and their include files (in case nc-config does not do the right thing).
  • run python setup.py build, then python setup.py install (as root if necessary).
  • pip install can also be used, with library paths set with environment variables. To make this work, the USE_SETUPCFG environment variable must be used to tell setup.py not to use setup.cfg. For example, USE_SETUPCFG=0 HDF5_INCDIR=/usr/include/hdf5/serial HDF5_LIBDIR=/usr/lib/x86_64-linux-gnu/hdf5/serial pip install has been shown to work on an Ubuntu/Debian linux system. Similarly, environment variables (all capitalized) can be used to set the include and library paths for hdf5, netCDF4, hdf4, szip, jpeg, curl and zlib. If the libraries are installed in standard places (e.g. /usr or /usr/local), the environment variables do not need to be set.
  • run the tests in the 'test' directory by running python run_all.py.

Tutorial

  1. Creating/Opening/Closing a netCDF file.
  2. Groups in a netCDF file.
  3. Dimensions in a netCDF file.
  4. Variables in a netCDF file.
  5. Attributes in a netCDF file.
  6. Writing data to and retrieving data from a netCDF variable.
  7. Dealing with time coordinates.
  8. Reading data from a multi-file netCDF dataset.
  9. Efficient compression of netCDF variables.
  10. Beyond homogeneous arrays of a fixed type - compound data types.
  11. Variable-length (vlen) data types.
  12. Enum data type.

1) Creating/Opening/Closing a netCDF file.

To create a netCDF file from python, you simply call the Dataset constructor. This is also the method used to open an existing netCDF file. If the file is open for write access (mode='w', 'r+' or 'a'), you may write any type of data including new dimensions, groups, variables and attributes. netCDF files come in five flavors (NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET, NETCDF3_64BIT_DATA, NETCDF4_CLASSIC, and NETCDF4). NETCDF3_CLASSIC was the original netcdf binary format, and was limited to file sizes less than 2 Gb. NETCDF3_64BIT_OFFSET was introduced in version 3.6.0 of the library, and extended the original binary format to allow for file sizes greater than 2 Gb. NETCDF3_64BIT_DATA is a new format that requires version 4.4.0 of the C library - it extends the NETCDF3_64BIT_OFFSET binary format to allow for unsigned/64 bit integer data types and 64-bit dimension sizes. NETCDF3_64BIT is an alias for NETCDF3_64BIT_OFFSET. NETCDF4_CLASSIC files use the version 4 disk format (HDF5), but omits features not found in the version 3 API. They can be read by netCDF 3 clients only if they have been relinked against the netCDF 4 library. They can also be read by HDF5 clients. NETCDF4 files use the version 4 disk format (HDF5) and use the new features of the version 4 API. The netCDF4 module can read and write files in any of these formats. When creating a new file, the format may be specified using the format keyword in the Dataset constructor. The default format is NETCDF4. To see how a given file is formatted, you can examine the data_model attribute. Closing the netCDF file is accomplished via the close method of the Dataset instance.

Here's an example:

>>> from netCDF4 import Dataset
>>> rootgrp = Dataset("test.nc", "w", format="NETCDF4")
>>> print rootgrp.data_model
NETCDF4
>>> rootgrp.close()

Remote OPeNDAP-hosted datasets can be accessed for reading over http if a URL is provided to the Dataset constructor instead of a filename. However, this requires that the netCDF library be built with OPenDAP support, via the --enable-dap configure option (added in version 4.0.1).

2) Groups in a netCDF file.

netCDF version 4 added support for organizing data in hierarchical groups, which are analagous to directories in a filesystem. Groups serve as containers for variables, dimensions and attributes, as well as other groups. A Dataset defines creates a special group, called the 'root group', which is similar to the root directory in a unix filesystem. To create Group instances, use the createGroup method of a Dataset or Group instance. createGroup takes a single argument, a python string containing the name of the new group. The new Group instances contained within the root group can be accessed by name using the groups dictionary attribute of the Dataset instance. Only NETCDF4 formatted files support Groups, if you try to create a Group in a netCDF 3 file you will get an error message.

>>> rootgrp = Dataset("test.nc", "a")
>>> fcstgrp = rootgrp.createGroup("forecasts")
>>> analgrp = rootgrp.createGroup("analyses")
>>> print rootgrp.groups
OrderedDict([("forecasts", 
              <netCDF4._netCDF4.Group object at 0x1b4b7b0>),
             ("analyses", 
              <netCDF4._netCDF4.Group object at 0x1b4b970>)])

Groups can exist within groups in a Dataset, just as directories exist within directories in a unix filesystem. Each Group instance has a groups attribute dictionary containing all of the group instances contained within that group. Each Group instance also has a path attribute that contains a simulated unix directory path to that group. To simplify the creation of nested groups, you can use a unix-like path as an argument to createGroup.

>>> fcstgrp1 = rootgrp.createGroup("/forecasts/model1")
>>> fcstgrp2 = rootgrp.createGroup("/forecasts/model2")

If any of the intermediate elements of the path do not exist, they are created, just as with the unix command 'mkdir -p'. If you try to create a group that already exists, no error will be raised, and the existing group will be returned.

Here's an example that shows how to navigate all the groups in a Dataset. The function walktree is a Python generator that is used to walk the directory tree. Note that printing the Dataset or Group object yields summary information about it's contents.

>>> def walktree(top):
>>>     values = top.groups.values()
>>>     yield values
>>>     for value in top.groups.values():
>>>         for children in walktree(value):
>>>             yield children
>>> print rootgrp
>>> for children in walktree(rootgrp):
>>>      for child in children:
>>>          print child
<type "netCDF4._netCDF4.Dataset">
root group (NETCDF4 file format):
    dimensions:
    variables:
    groups: forecasts, analyses
<type "netCDF4._netCDF4.Group">
group /forecasts:
    dimensions:
    variables:
    groups: model1, model2
<type "netCDF4._netCDF4.Group">
group /analyses:
    dimensions:
    variables:
    groups:
<type "netCDF4._netCDF4.Group">
group /forecasts/model1:
    dimensions:
    variables:
    groups:
<type "netCDF4._netCDF4.Group">
group /forecasts/model2:
    dimensions:
    variables:
    groups:

3) Dimensions in a netCDF file.

netCDF defines the sizes of all variables in terms of dimensions, so before any variables can be created the dimensions they use must be created first. A special case, not often used in practice, is that of a scalar variable, which has no dimensions. A dimension is created using the createDimension method of a Dataset or Group instance. A Python string is used to set the name of the dimension, and an integer value is used to set the size. To create an unlimited dimension (a dimension that can be appended to), the size value is set to None or 0. In this example, there both the time and level dimensions are unlimited. Having more than one unlimited dimension is a new netCDF 4 feature, in netCDF 3 files there may be only one, and it must be the first (leftmost) dimension of the variable.

>>> level = rootgrp.createDimension("level", None)
>>> time = rootgrp.createDimension("time", None)
>>> lat = rootgrp.createDimension("lat", 73)
>>> lon = rootgrp.createDimension("lon", 144)

All of the Dimension instances are stored in a python dictionary.

>>> print rootgrp.dimensions
OrderedDict([("level", <netCDF4._netCDF4.Dimension object at 0x1b48030>),
             ("time", <netCDF4._netCDF4.Dimension object at 0x1b481c0>),
             ("lat", <netCDF4._netCDF4.Dimension object at 0x1b480f8>),
             ("lon", <netCDF4._netCDF4.Dimension object at 0x1b48a08>)])

Calling the python len function with a Dimension instance returns the current size of that dimension. The isunlimited method of a Dimension instance can be used to determine if the dimensions is unlimited, or appendable.

>>> print len(lon)
144
>>> print len.isunlimited()
False
>>> print time.isunlimited()
True

Printing the Dimension object provides useful summary info, including the name and length of the dimension, and whether it is unlimited.

>>> for dimobj in rootgrp.dimensions.values():
>>>    print dimobj
<type "netCDF4._netCDF4.Dimension"> (unlimited): name = "level", size = 0
<type "netCDF4._netCDF4.Dimension"> (unlimited): name = "time", size = 0
<type "netCDF4._netCDF4.Dimension">: name = "lat", size = 73
<type "netCDF4._netCDF4.Dimension">: name = "lon", size = 144
<type "netCDF4._netCDF4.Dimension"> (unlimited): name = "time", size = 0

Dimension names can be changed using the netCDF4.Datatset.renameDimension method of a Dataset or Group instance.

4) Variables in a netCDF file.

netCDF variables behave much like python multidimensional array objects supplied by the numpy module. However, unlike numpy arrays, netCDF4 variables can be appended to along one or more 'unlimited' dimensions. To create a netCDF variable, use the createVariable method of a Dataset or Group instance. The createVariable method has two mandatory arguments, the variable name (a Python string), and the variable datatype. The variable's dimensions are given by a tuple containing the dimension names (defined previously with createDimension). To create a scalar variable, simply leave out the dimensions keyword. The variable primitive datatypes correspond to the dtype attribute of a numpy array. You can specify the datatype as a numpy dtype object, or anything that can be converted to a numpy dtype object. Valid datatype specifiers include: 'f4' (32-bit floating point), 'f8' (64-bit floating point), 'i4' (32-bit signed integer), 'i2' (16-bit signed integer), 'i8' (64-bit singed integer), 'i1' (8-bit signed integer), 'u1' (8-bit unsigned integer), 'u2' (16-bit unsigned integer), 'u4' (32-bit unsigned integer), 'u8' (64-bit unsigned integer), or 'S1' (single-character string). The old Numeric single-character typecodes ('f','d','h', 's','b','B','c','i','l'), corresponding to ('f4','f8','i2','i2','i1','i1','S1','i4','i4'), will also work. The unsigned integer types and the 64-bit integer type can only be used if the file format is NETCDF4.

The dimensions themselves are usually also defined as variables, called coordinate variables. The createVariable method returns an instance of the Variable class whose methods can be used later to access and set variable data and attributes.

>>> times = rootgrp.createVariable("time","f8",("time",))
>>> levels = rootgrp.createVariable("level","i4",("level",))
>>> latitudes = rootgrp.createVariable("latitude","f4",("lat",))
>>> longitudes = rootgrp.createVariable("longitude","f4",("lon",))
>>> # two dimensions unlimited
>>> temp = rootgrp.createVariable("temp","f4",("time","level","lat","lon",))

To get summary info on a Variable instance in an interactive session, just print it.

>>> print temp
<type "netCDF4._netCDF4.Variable">
float32 temp(time, level, lat, lon)
    least_significant_digit: 3
    units: K
unlimited dimensions: time, level
current shape = (0, 0, 73, 144)

You can use a path to create a Variable inside a hierarchy of groups.

>>> ftemp = rootgrp.createVariable("/forecasts/model1/temp","f4",("time","level","lat","lon",))

If the intermediate groups do not yet exist, they will be created.

You can also query a Dataset or Group instance directly to obtain Group or Variable instances using paths.

>>> print rootgrp["/forecasts/model1"] # a Group instance
<type "netCDF4._netCDF4.Group">
group /forecasts/model1:
    dimensions(sizes):
    variables(dimensions): float32 temp(time,level,lat,lon)
    groups:
>>> print rootgrp["/forecasts/model1/temp"] # a Variable instance
<type "netCDF4._netCDF4.Variable">
float32 temp(time, level, lat, lon)
path = /forecasts/model1
unlimited dimensions: time, level
current shape = (0, 0, 73, 144)
filling on, default _FillValue of 9.96920996839e+36 used

All of the variables in the Dataset or Group are stored in a Python dictionary, in the same way as the dimensions:

>>> print rootgrp.variables
OrderedDict([("time", <netCDF4.Variable object at 0x1b4ba70>),
             ("level", <netCDF4.Variable object at 0x1b4bab0>),
             ("latitude", <netCDF4.Variable object at 0x1b4baf0>),
             ("longitude", <netCDF4.Variable object at 0x1b4bb30>),
             ("temp", <netCDF4.Variable object at 0x1b4bb70>)])

Variable names can be changed using the renameVariable method of a Dataset instance.

5) Attributes in a netCDF file.

There are two types of attributes in a netCDF file, global and variable. Global attributes provide information about a group, or the entire dataset, as a whole. Variable attributes provide information about one of the variables in a group. Global attributes are set by assigning values to Dataset or Group instance variables. Variable attributes are set by assigning values to Variable instances variables. Attributes can be strings, numbers or sequences. Returning to our example,

>>> import time
>>> rootgrp.description = "bogus example script"
>>> rootgrp.history = "Created " + time.ctime(time.time())
>>> rootgrp.source = "netCDF4 python module tutorial"
>>> latitudes.units = "degrees north"
>>> longitudes.units = "degrees east"
>>> levels.units = "hPa"
>>> temp.units = "K"
>>> times.units = "hours since 0001-01-01 00:00:00.0"
>>> times.calendar = "gregorian"

The ncattrs method of a Dataset, Group or Variable instance can be used to retrieve the names of all the netCDF attributes. This method is provided as a convenience, since using the built-in dir Python function will return a bunch of private methods and attributes that cannot (or should not) be modified by the user.

>>> for name in rootgrp.ncattrs():
>>>     print "Global attr", name, "=", getattr(rootgrp,name)
Global attr description = bogus example script
Global attr history = Created Mon Nov  7 10.30:56 2005
Global attr source = netCDF4 python module tutorial

The __dict__ attribute of a Dataset, Group or Variable instance provides all the netCDF attribute name/value pairs in a python dictionary:

>>> print rootgrp.__dict__
OrderedDict([(u"description", u"bogus example script"),
             (u"history", u"Created Thu Mar  3 19:30:33 2011"),
             (u"source", u"netCDF4 python module tutorial")])

Attributes can be deleted from a netCDF Dataset, Group or Variable using the python del statement (i.e. del grp.foo removes the attribute foo the the group grp).

6) Writing data to and retrieving data from a netCDF variable.

Now that you have a netCDF Variable instance, how do you put data into it? You can just treat it like an array and assign data to a slice.

>>> import numpy
>>> lats =  numpy.arange(-90,91,2.5)
>>> lons =  numpy.arange(-180,180,2.5)
>>> latitudes[:] = lats
>>> longitudes[:] = lons
>>> print "latitudes =\n",latitudes[:]
latitudes =
[-90.  -87.5 -85.  -82.5 -80.  -77.5 -75.  -72.5 -70.  -67.5 -65.  -62.5
 -60.  -57.5 -55.  -52.5 -50.  -47.5 -45.  -42.5 -40.  -37.5 -35.  -32.5
 -30.  -27.5 -25.  -22.5 -20.  -17.5 -15.  -12.5 -10.   -7.5  -5.   -2.5
   0.    2.5   5.    7.5  10.   12.5  15.   17.5  20.   22.5  25.   27.5
  30.   32.5  35.   37.5  40.   42.5  45.   47.5  50.   52.5  55.   57.5
  60.   62.5  65.   67.5  70.   72.5  75.   77.5  80.   82.5  85.   87.5
  90. ]

Unlike NumPy's array objects, netCDF Variable objects with unlimited dimensions will grow along those dimensions if you assign data outside the currently defined range of indices.

>>> # append along two unlimited dimensions by assigning to slice.
>>> nlats = len(rootgrp.dimensions["lat"])
>>> nlons = len(rootgrp.dimensions["lon"])
>>> print "temp shape before adding data = ",temp.shape
temp shape before adding data =  (0, 0, 73, 144)
>>>
>>> from numpy.random import uniform
>>> temp[0:5,0:10,:,:] = uniform(size=(5,10,nlats,nlons))
>>> print "temp shape after adding data = ",temp.shape
temp shape after adding data =  (6, 10, 73, 144)
>>>
>>> # levels have grown, but no values yet assigned.
>>> print "levels shape after adding pressure data = ",levels.shape
levels shape after adding pressure data =  (10,)

Note that the size of the levels variable grows when data is appended along the level dimension of the variable temp, even though no data has yet been assigned to levels.

>>> # now, assign data to levels dimension variable.
>>> levels[:] =  [1000.,850.,700.,500.,300.,250.,200.,150.,100.,50.]

However, that there are some differences between NumPy and netCDF variable slicing rules. Slices behave as usual, being specified as a start:stop:step triplet. Using a scalar integer index i takes the ith element and reduces the rank of the output array by one. Boolean array and integer sequence indexing behaves differently for netCDF variables than for numpy arrays. Only 1-d boolean arrays and integer sequences are allowed, and these indices work independently along each dimension (similar to the way vector subscripts work in fortran). This means that

>>> temp[0, 0, [0,1,2,3], [0,1,2,3]]

returns an array of shape (4,4) when slicing a netCDF variable, but for a numpy array it returns an array of shape (4,). Similarly, a netCDF variable of shape (2,3,4,5) indexed with [0, array([True, False, True]), array([False, True, True, True]), :] would return a (2, 3, 5) array. In NumPy, this would raise an error since it would be equivalent to [0, [0,1], [1,2,3], :]. When slicing with integer sequences, the indices need not be sorted and may contain duplicates (both of these are new features in version 1.2.1). While this behaviour may cause some confusion for those used to NumPy's 'fancy indexing' rules, it provides a very powerful way to extract data from multidimensional netCDF variables by using logical operations on the dimension arrays to create slices.

For example,

>>> tempdat = temp[::2, [1,3,6], lats>0, lons>0]

will extract time indices 0,2 and 4, pressure levels 850, 500 and 200 hPa, all Northern Hemisphere latitudes and Eastern Hemisphere longitudes, resulting in a numpy array of shape (3, 3, 36, 71).

>>> print "shape of fancy temp slice = ",tempdat.shape
shape of fancy temp slice =  (3, 3, 36, 71)

Special note for scalar variables: To extract data from a scalar variable v with no associated dimensions, use np.asarray(v) or v[...]. The result will be a numpy scalar array.

7) Dealing with time coordinates.

Time coordinate values pose a special challenge to netCDF users. Most metadata standards (such as CF) specify that time should be measure relative to a fixed date using a certain calendar, with units specified like hours since YY:MM:DD hh-mm-ss. These units can be awkward to deal with, without a utility to convert the values to and from calendar dates. The functione called num2date and date2num are provided with this package to do just that. Here's an example of how they can be used:

>>> # fill in times.
>>> from datetime import datetime, timedelta
>>> from netCDF4 import num2date, date2num
>>> dates = [datetime(2001,3,1)+n*timedelta(hours=12) for n in range(temp.shape[0])]
>>> times[:] = date2num(dates,units=times.units,calendar=times.calendar)
>>> print "time values (in units %s): " % times.units+"\n",times[:]
time values (in units hours since January 1, 0001):
[ 17533056.  17533068.  17533080.  17533092.  17533104.]
>>> dates = num2date(times[:],units=times.units,calendar=times.calendar)
>>> print "dates corresponding to time values:\n",dates
dates corresponding to time values:
[2001-03-01 00:00:00 2001-03-01 12:00:00 2001-03-02 00:00:00
 2001-03-02 12:00:00 2001-03-03 00:00:00]

num2date converts numeric values of time in the specified units and calendar to datetime objects, and date2num does the reverse. All the calendars currently defined in the CF metadata convention are supported. A function called date2index is also provided which returns the indices of a netCDF time variable corresponding to a sequence of datetime instances.

8) Reading data from a multi-file netCDF dataset.

If you want to read data from a variable that spans multiple netCDF files, you can use the MFDataset class to read the data as if it were contained in a single file. Instead of using a single filename to create a Dataset instance, create a MFDataset instance with either a list of filenames, or a string with a wildcard (which is then converted to a sorted list of files using the python glob module). Variables in the list of files that share the same unlimited dimension are aggregated together, and can be sliced across multiple files. To illustrate this, let's first create a bunch of netCDF files with the same variable (with the same unlimited dimension). The files must in be in NETCDF3_64BIT_OFFSET, NETCDF3_64BIT_DATA, NETCDF3_CLASSIC or NETCDF4_CLASSIC format (NETCDF4 formatted multi-file datasets are not supported).

>>> for nf in range(10):
>>>     f = Dataset("mftest%s.nc" % nf,"w")
>>>     f.createDimension("x",None)
>>>     x = f.createVariable("x","i",("x",))
>>>     x[0:10] = numpy.arange(nf*10,10*(nf+1))
>>>     f.close()

Now read all the files back in at once with MFDataset

>>> from netCDF4 import MFDataset
>>> f = MFDataset("mftest*nc")
>>> print f.variables["x"][:]
[ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]

Note that MFDataset can only be used to read, not write, multi-file datasets.

9) Efficient compression of netCDF variables.

Data stored in netCDF 4 Variable objects can be compressed and decompressed on the fly. The parameters for the compression are determined by the zlib, complevel and shuffle keyword arguments to the createVariable method. To turn on compression, set zlib=True. The complevel keyword regulates the speed and efficiency of the compression (1 being fastest, but lowest compression ratio, 9 being slowest but best compression ratio). The default value of complevel is 4. Setting shuffle=False will turn off the HDF5 shuffle filter, which de-interlaces a block of data before compression by reordering the bytes. The shuffle filter can significantly improve compression ratios, and is on by default. Setting fletcher32 keyword argument to createVariable to True (it's False by default) enables the Fletcher32 checksum algorithm for error detection. It's also possible to set the HDF5 chunking parameters and endian-ness of the binary data stored in the HDF5 file with the chunksizes and endian keyword arguments to createVariable. These keyword arguments only are relevant for NETCDF4 and NETCDF4_CLASSIC files (where the underlying file format is HDF5) and are silently ignored if the file format is NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

If your data only has a certain number of digits of precision (say for example, it is temperature data that was measured with a precision of 0.1 degrees), you can dramatically improve zlib compression by quantizing (or truncating) the data using the least_significant_digit keyword argument to createVariable. The least significant digit is the power of ten of the smallest decimal place in the data that is a reliable value. For example if the data has a precision of 0.1, then setting least_significant_digit=1 will cause data the data to be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). Effectively, this makes the compression 'lossy' instead of 'lossless', that is some precision in the data is sacrificed for the sake of disk space.

In our example, try replacing the line

>>> temp = rootgrp.createVariable("temp","f4",("time","level","lat","lon",))

with

>>> temp = dataset.createVariable("temp","f4",("time","level","lat","lon",),zlib=True)

and then

>>> temp = dataset.createVariable("temp","f4",("time","level","lat","lon",),zlib=True,least_significant_digit=3)

and see how much smaller the resulting files are.

10) Beyond homogeneous arrays of a fixed type - compound data types.

Compound data types map directly to numpy structured (a.k.a 'record' arrays). Structured arrays are akin to C structs, or derived types in Fortran. They allow for the construction of table-like structures composed of combinations of other data types, including other compound types. Compound types might be useful for representing multiple parameter values at each point on a grid, or at each time and space location for scattered (point) data. You can then access all the information for a point by reading one variable, instead of reading different parameters from different variables. Compound data types are created from the corresponding numpy data type using the createCompoundType method of a Dataset or Group instance. Since there is no native complex data type in netcdf, compound types are handy for storing numpy complex arrays. Here's an example:

>>> f = Dataset("complex.nc","w")
>>> size = 3 # length of 1-d complex array
>>> # create sample complex data.
>>> datac = numpy.exp(1j*(1.+numpy.linspace(0, numpy.pi, size)))
>>> # create complex128 compound data type.
>>> complex128 = numpy.dtype([("real",numpy.float64),("imag",numpy.float64)])
>>> complex128_t = f.createCompoundType(complex128,"complex128")
>>> # create a variable with this data type, write some data to it.
>>> f.createDimension("x_dim",None)
>>> v = f.createVariable("cmplx_var",complex128_t,"x_dim")
>>> data = numpy.empty(size,complex128) # numpy structured array
>>> data["real"] = datac.real; data["imag"] = datac.imag
>>> v[:] = data # write numpy structured array to netcdf compound var
>>> # close and reopen the file, check the contents.
>>> f.close(); f = Dataset("complex.nc")
>>> v = f.variables["cmplx_var"]
>>> datain = v[:] # read in all the data into a numpy structured array
>>> # create an empty numpy complex array
>>> datac2 = numpy.empty(datain.shape,numpy.complex128)
>>> # .. fill it with contents of structured array.
>>> datac2.real = datain["real"]; datac2.imag = datain["imag"]
>>> print datac.dtype,datac # original data
complex128 [ 0.54030231+0.84147098j -0.84147098+0.54030231j  -0.54030231-0.84147098j]
>>>
>>> print datac2.dtype,datac2 # data from file
complex128 [ 0.54030231+0.84147098j -0.84147098+0.54030231j  -0.54030231-0.84147098j]

Compound types can be nested, but you must create the 'inner' ones first. All of the compound types defined for a Dataset or Group are stored in a Python dictionary, just like variables and dimensions. As always, printing objects gives useful summary information in an interactive session:

>>> print f
<type "netCDF4._netCDF4.Dataset">
root group (NETCDF4 file format):
    dimensions: x_dim
    variables: cmplx_var
    groups:
<type "netCDF4._netCDF4.Variable">
>>> print f.variables["cmplx_var"]
compound cmplx_var(x_dim)
compound data type: [("real", "<f8"), ("imag", "<f8")]
unlimited dimensions: x_dim
current shape = (3,)
>>> print f.cmptypes
OrderedDict([("complex128", <netCDF4.CompoundType object at 0x1029eb7e8>)])
>>> print f.cmptypes["complex128"]
<type "netCDF4._netCDF4.CompoundType">: name = "complex128", numpy dtype = [(u"real","<f8"), (u"imag", "<f8")]

11) Variable-length (vlen) data types.

NetCDF 4 has support for variable-length or "ragged" arrays. These are arrays of variable length sequences having the same type. To create a variable-length data type, use the createVLType method method of a Dataset or Group instance.

>>> f = Dataset("tst_vlen.nc","w")
>>> vlen_t = f.createVLType(numpy.int32, "phony_vlen")

The numpy datatype of the variable-length sequences and the name of the new datatype must be specified. Any of the primitive datatypes can be used (signed and unsigned integers, 32 and 64 bit floats, and characters), but compound data types cannot. A new variable can then be created using this datatype.

>>> x = f.createDimension("x",3)
>>> y = f.createDimension("y",4)
>>> vlvar = f.createVariable("phony_vlen_var", vlen_t, ("y","x"))

Since there is no native vlen datatype in numpy, vlen arrays are represented in python as object arrays (arrays of dtype object). These are arrays whose elements are Python object pointers, and can contain any type of python object. For this application, they must contain 1-D numpy arrays all of the same type but of varying length. In this case, they contain 1-D numpy int32 arrays of random length betwee 1 and 10.

>>> import random
>>> data = numpy.empty(len(y)*len(x),object)
>>> for n in range(len(y)*len(x)):
>>>    data[n] = numpy.arange(random.randint(1,10),dtype="int32")+1
>>> data = numpy.reshape(data,(len(y),len(x)))
>>> vlvar[:] = data
>>> print "vlen variable =\n",vlvar[:]
vlen variable =
[[[ 1  2  3  4  5  6  7  8  9 10] [1 2 3 4 5] [1 2 3 4 5 6 7 8]]
 [[1 2 3 4 5 6 7] [1 2 3 4 5 6] [1 2 3 4 5]]
 [[1 2 3 4 5] [1 2 3 4] [1]]
 [[ 1  2  3  4  5  6  7  8  9 10] [ 1  2  3  4  5  6  7  8  9 10]
  [1 2 3 4 5 6 7 8]]]
>>> print f
<type "netCDF4._netCDF4.Dataset">
root group (NETCDF4 file format):
    dimensions: x, y
    variables: phony_vlen_var
    groups:
>>> print f.variables["phony_vlen_var"]
<type "netCDF4._netCDF4.Variable">
vlen phony_vlen_var(y, x)
vlen data type: int32
unlimited dimensions:
current shape = (4, 3)
>>> print f.VLtypes["phony_vlen"]
<type "netCDF4._netCDF4.VLType">: name = "phony_vlen", numpy dtype = int32

Numpy object arrays containing python strings can also be written as vlen variables, For vlen strings, you don't need to create a vlen data type. Instead, simply use the python str builtin (or a numpy string datatype with fixed length greater than 1) when calling the createVariable method.

>>> z = f.createDimension("z",10)
>>> strvar = rootgrp.createVariable("strvar", str, "z")

In this example, an object array is filled with random python strings with random lengths between 2 and 12 characters, and the data in the object array is assigned to the vlen string variable.

>>> chars = "1234567890aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
>>> data = numpy.empty(10,"O")
>>> for n in range(10):
>>>     stringlen = random.randint(2,12)
>>>     data[n] = "".join([random.choice(chars) for i in range(stringlen)])
>>> strvar[:] = data
>>> print "variable-length string variable:\n",strvar[:]
variable-length string variable:
[aDy29jPt 5DS9X8 jd7aplD b8t4RM jHh8hq KtaPWF9cQj Q1hHN5WoXSiT MMxsVeq tdLUzvVTzj]
>>> print f
<type "netCDF4._netCDF4.Dataset">
root group (NETCDF4 file format):
    dimensions: x, y, z
    variables: phony_vlen_var, strvar
    groups:
>>> print f.variables["strvar"]
<type "netCDF4._netCDF4.Variable">
vlen strvar(z)
vlen data type: <type "str">
unlimited dimensions:
current size = (10,)

It is also possible to set contents of vlen string variables with numpy arrays of any string or unicode data type. Note, however, that accessing the contents of such variables will always return numpy arrays with dtype object.

12) Enum data type.

netCDF4 has an enumerated data type, which is an integer datatype that is restricted to certain named values. Since Enums don't map directly to a numpy data type, they are read and written as integer arrays.

Here's an example of using an Enum type to hold cloud type data. The base integer data type and a python dictionary describing the allowed values and their names are used to define an Enum data type using createEnumType.

>>> nc = Dataset('clouds.nc','w')
>>> # python dict with allowed values and their names.
>>> enum_dict = {u'Altocumulus': 7, u'Missing': 255, 
>>> u'Stratus': 2, u'Clear': 0,
>>> u'Nimbostratus': 6, u'Cumulus': 4, u'Altostratus': 5,
>>> u'Cumulonimbus': 1, u'Stratocumulus': 3}
>>> # create the Enum type called 'cloud_t'.
>>> cloud_type = nc.createEnumType(numpy.uint8,'cloud_t',enum_dict)
>>> print cloud_type
<type 'netCDF4._netCDF4.EnumType'>: name = 'cloud_t',
numpy dtype = uint8, fields/values ={u'Cumulus': 4,
u'Altocumulus': 7, u'Missing': 255,
u'Stratus': 2, u'Clear': 0,
u'Cumulonimbus': 1, u'Stratocumulus': 3,
u'Nimbostratus': 6, u'Altostratus': 5}

A new variable can be created in the usual way using this data type. Integer data is written to the variable that represents the named cloud types in enum_dict. A ValueError will be raised if an attempt is made to write an integer value not associated with one of the specified names.

>>> time = nc.createDimension('time',None)
>>> # create a 1d variable of type 'cloud_type'.
>>> # The fill_value is set to the 'Missing' named value.
>>> cloud_var =
>>> nc.createVariable('primary_cloud',cloud_type,'time',
>>> fill_value=enum_dict['Missing'])
>>> # write some data to the variable.
>>> cloud_var[:] = [enum_dict['Clear'],enum_dict['Stratus'],
>>> enum_dict['Cumulus'],enum_dict['Missing'],
>>> enum_dict['Cumulonimbus']]
>>> nc.close()
>>> # reopen the file, read the data.
>>> nc = Dataset('clouds.nc')
>>> cloud_var = nc.variables['primary_cloud']
>>> print cloud_var
<type 'netCDF4._netCDF4.Variable'>
enum primary_cloud(time)
    _FillValue: 255
enum data type: uint8
unlimited dimensions: time
current shape = (5,)
>>> print cloud_var.datatype.enum_dict
{u'Altocumulus': 7, u'Missing': 255, u'Stratus': 2,
u'Clear': 0, u'Nimbostratus': 6, u'Cumulus': 4,
u'Altostratus': 5, u'Cumulonimbus': 1,
u'Stratocumulus': 3}
>>> print cloud_var[:]
[0 2 4 -- 1]
>>> nc.close()

All of the code in this tutorial is available in examples/tutorial.py, Unit tests are in the test directory.

contact: Jeffrey Whitaker jeffrey.s.whitaker@noaa.gov

copyright: 2008 by Jeffrey Whitaker.

license: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation. THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


Functions

def chartostring(

b)

convert a character array to a string array with one less dimension.

b: Input character array (numpy datatype 'S1' or 'U1'). Will be converted to a array of strings, where each string has a fixed length of b.shape[-1] characters.

returns a numpy string array with datatype 'SN' or 'UN' and shape b.shape[:-1] where where N=b.shape[-1].

def date2index(

dates, nctime, calendar=None, select='exact')

Return indices of a netCDF time variable corresponding to the given dates.

dates: A datetime object or a sequence of datetime objects. The datetime objects should not include a time-zone offset.

nctime: A netCDF time variable object. The nctime object must have a units attribute.

calendar: describes the calendar used in the time calculations. All the values currently defined in the CF metadata convention Valid calendars 'standard', 'gregorian', 'proleptic_gregorian' 'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'. Default is 'standard', which is a mixed Julian/Gregorian calendar. If calendar is None, its value is given by nctime.calendar or standard if no such attribute exists.

select: 'exact', 'before', 'after', 'nearest' The index selection method. exact will return the indices perfectly matching the dates given. before and after will return the indices corresponding to the dates just before or just after the given dates if an exact match cannot be found. nearest will return the indices that correspond to the closest dates.

returns an index (indices) of the netCDF time variable corresponding to the given datetime object(s).

def date2num(

dates,units,calendar='standard')

Return numeric time values given datetime objects. The units of the numeric time values are described by the netCDF4.units argument and the netCDF4.calendar keyword. The datetime objects must be in UTC with no time-zone offset. If there is a time-zone offset in units, it will be applied to the returned numeric values.

dates: A datetime object or a sequence of datetime objects. The datetime objects should not include a time-zone offset.

units: a string of the form <time units> since <reference time> describing the time units. <time units> can be days, hours, minutes, seconds, milliseconds or microseconds. <reference time> is the time origin. Accuracy is somewhere between a millisecond and a microsecond, depending on the time interval and the calendar used.

calendar: describes the calendar used in the time calculations. All the values currently defined in the CF metadata convention Valid calendars 'standard', 'gregorian', 'proleptic_gregorian' 'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'. Default is 'standard', which is a mixed Julian/Gregorian calendar.

returns a numeric time value, or an array of numeric time values.

def getlibversion(

)

returns a string describing the version of the netcdf library used to build the module, and when it was built.

def num2date(

times,units,calendar='standard')

Return datetime objects given numeric time values. The units of the numeric time values are described by the units argument and the calendar keyword. The returned datetime objects represent UTC with no time-zone offset, even if the specified units contain a time-zone offset.

times: numeric time values.

units: a string of the form <time units> since <reference time> describing the time units. <time units> can be days, hours, minutes, seconds, milliseconds or microseconds. <reference time> is the time origin. Accuracy is somewhere between a millisecond and a microsecond, depending on the time interval and the calendar used.

calendar: describes the calendar used in the time calculations. All the values currently defined in the CF metadata convention Valid calendars 'standard', 'gregorian', 'proleptic_gregorian' 'noleap', '365_day', '360_day', 'julian', 'all_leap', '366_day'. Default is 'standard', which is a mixed Julian/Gregorian calendar.

returns a datetime instance, or an array of datetime instances.

Note: The datetime instances returned are 'real' python datetime objects if calendar='proleptic_gregorian', or calendar='standard' or 'gregorian' and the date is after the breakpoint between the Julian and Gregorian calendars (1582-10-15). Otherwise, they are 'phony' datetime objects which support some but not all the methods of 'real' python datetime objects. The datetime instances do not contain a time-zone offset, even if the specified units contains one.

def stringtoarr(

a, NUMCHARS,dtype='S')

convert a string to a character array of length NUMCHARS

a: Input python string.

NUMCHARS: number of characters used to represent string (if len(a) < NUMCHARS, it will be padded on the right with blanks).

dtype: type of numpy array to return. Default is 'S', which means an array of dtype 'S1' will be returned. If dtype='U', a unicode array (dtype = 'U1') will be returned.

returns a rank 1 numpy character array of length NUMCHARS with datatype 'S1' (default) or 'U1' (if dtype='U')

def stringtochar(

a)

convert a string array to a character array with one extra dimension

a: Input numpy string array with numpy datatype 'SN' or 'UN', where N is the number of characters in each string. Will be converted to an array of characters (datatype 'S1' or 'U1') of shape a.shape + (N,).

returns a numpy character array with datatype 'S1' or 'U1' and shape a.shape + (N,), where N is the length of each string in a.

Classes

class CompoundType

A CompoundType instance is used to describe a compound data type, and can be passed to the the createVariable method of a Dataset or Group instance. Compound data types map to numpy structured arrays. See __init__ for more details.

The instance variables dtype and name should not be modified by the user.

Ancestors (in MRO)

Class variables

var dtype

A numpy dtype object describing the compound data type.

var name

String name.

Static methods

def __init__(

group, datatype, datatype_name)

CompoundType constructor.

group: Group instance to associate with the compound datatype.

datatype: A numpy dtype object describing a structured (a.k.a record) array. Can be composed of homogeneous numeric or character data types, or other structured array data types.

datatype_name: a Python string containing a description of the compound data type.

Note 1: When creating nested compound data types, the inner compound data types must already be associated with CompoundType instances (so create CompoundType instances for the innermost structures first).

Note 2: CompoundType instances should be created using the createCompoundType method of a Dataset or Group instance, not using this class directly.

class Dataset

A netCDF Dataset is a collection of dimensions, groups, variables and attributes. Together they describe the meaning of data and relations among data fields stored in a netCDF file. See __init__ for more details.

A list of attribute names corresponding to global netCDF attributes defined for the Dataset can be obtained with the ncattrs method. These attributes can be created by assigning to an attribute of the Dataset instance. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a Dataset instance.

The following class variables are read-only and should not be modified by the user.

dimensions: The dimensions dictionary maps the names of dimensions defined for the Group or Dataset to instances of the Dimension class.

variables: The variables dictionary maps the names of variables defined for this Dataset or Group to instances of the Variable class.

groups: The groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF4 file).

cmptypes: The cmptypes dictionary maps the names of compound types defined for the Group or Dataset to instances of the CompoundType class.

vltypes: The vltypes dictionary maps the names of variable-length types defined for the Group or Dataset to instances of the VLType class.

enumtypes: The enumtypes dictionary maps the names of Enum types defined for the Group or Dataset to instances of the EnumType class.

data_model: data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

file_format: same as data_model, retained for backwards compatibility.

disk_format: disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.

parent: parent is a reference to the parent Group instance. None for the root group or Dataset instance.

path: path shows the location of the Group in the Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A Dataset instance is the root group, so the path is simply '/'.

keepweakref: If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.

Ancestors (in MRO)

Class variables

var cmptypes

The cmptypes dictionary maps the names of compound types defined for the Group or Dataset to instances of the CompoundType class.

var data_model

data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

var dimensions

The dimensions dictionary maps the names of dimensions defined for the Group or Dataset to instances of the Dimension class.

var disk_format

disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.

var enumtypes

The enumtypes dictionary maps the names of Enum types defined for the Group or Dataset to instances of the EnumType class.

var file_format

same as data_model, retained for backwards compatibility.

var groups

The groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF4 file).

var keepweakref

If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.

var parent

parent is a reference to the parent Group instance. None for the root group or Dataset instance

var path

path shows the location of the Group in the Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A Dataset instance is the root group, so the path is simply '/'.

var variables

The variables dictionary maps the names of variables defined for this Dataset or Group to instances of the Variable class.

var vltypes

The vltypes dictionary maps the names of variable-length types defined for the Group or Dataset to instances of the VLType class.

Static methods

def __init__(

self, filename, mode="r", clobber=True, diskless=False, persist=False, weakref=False, format='NETCDF4')

Dataset constructor.

filename: Name of netCDF file to hold dataset. Can also be a python 3 pathlib instance or the URL of an OpenDAP dataset.

mode: access mode. r means read-only; no data can be modified. w means write; a new file is created, an existing file with the same name is deleted. a and r+ mean append (in analogy with serial files); an existing file is opened for reading and writing. Appending s to modes w, r+ or a will enable unbuffered shared access to NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA formatted files. Unbuffered acesss may be useful even if you don't need shared access, since it may be faster for programs that don't access data sequentially. This option is ignored for NETCDF4 and NETCDF4_CLASSIC formatted files.

clobber: if True (default), opening a file with mode='w' will clobber an existing file with the same name. if False, an exception will be raised if a file with the same name already exists.

format: underlying file format (one of 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_CLASSIC', 'NETCDF3_64BIT_OFFSET' or 'NETCDF3_64BIT_DATA'. Only relevant if mode = 'w' (if mode = 'r','a' or 'r+' the file format is automatically detected). Default 'NETCDF4', which means the data is stored in an HDF5 file, using netCDF 4 API features. Setting format='NETCDF4_CLASSIC' will create an HDF5 file, using only netCDF 3 compatibile API features. netCDF 3 clients must be recompiled and linked against the netCDF 4 library to read files in NETCDF4_CLASSIC format. 'NETCDF3_CLASSIC' is the classic netCDF 3 file format that does not handle 2+ Gb files. 'NETCDF3_64BIT_OFFSET' is the 64-bit offset version of the netCDF 3 file format, which fully supports 2+ GB files, but is only compatible with clients linked against netCDF version 3.6.0 or later. 'NETCDF3_64BIT_DATA' is the 64-bit data version of the netCDF 3 file format, which supports 64-bit dimension sizes plus unsigned and 64 bit integer data types, but is only compatible with clients linked against netCDF version 4.4.0 or later.

diskless: If True, create diskless (in memory) file.
This is an experimental feature added to the C library after the netcdf-4.2 release.

persist: if diskless=True, persist file to disk when closed (default False).

keepweakref: if True, child Dimension and Variable instances will keep weak references to the parent Dataset or Group object. Default is False, which means strong references will be kept. Having Dimension and Variable instances keep a strong reference to the parent Dataset instance, which in turn keeps a reference to child Dimension and Variable instances, creates circular references. Circular references complicate garbage collection, which may mean increased memory usage for programs that create may Dataset instances with lots of Variables. Setting keepweakref=True allows Dataset instances to be garbage collected as soon as they go out of scope, potential reducing memory usage. However, in most cases this is not desirable, since the associated Variable instances may still be needed, but are rendered unusable when the parent Dataset instance is garbage collected.

def close(

self)

Close the Dataset.

def createCompoundType(

self, datatype, datatype_name)

Creates a new compound data type named datatype_name from the numpy dtype object datatype.

Note: If the new compound data type contains other compound data types (i.e. it is a 'nested' compound type, where not all of the elements are homogeneous numeric data types), then the 'inner' compound types must be created first.

The return value is the CompoundType class instance describing the new datatype.

def createDimension(

self, dimname, size=None)

Creates a new dimension with the given dimname and size.

size must be a positive integer or None, which stands for "unlimited" (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the Dimension class instance describing the new dimension. To determine the current maximum size of the dimension, use the len function on the Dimension instance. To determine if a dimension is 'unlimited', use the isunlimited method of the Dimension instance.

def createEnumType(

self, datatype, datatype_name, enum_dict)

Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.

The return value is the EnumType class instance describing the new datatype.

def createGroup(

self, groupname)

Creates a new Group with the given groupname.

If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analagous to mkdir -p in unix). For example, createGroup('/GroupA/GroupB/GroupC') will create GroupA, GroupA/GroupB, and GroupA/GroupB/GroupC, if they don't already exist. If the specified path describes a group that already exists, no error is raised.

The return value is a Group class instance.

def createVLType(

self, datatype, datatype_name)

Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.

The return value is the VLType class instance describing the new datatype.

def createVariable(

self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None, fill_value=None)

Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.

If varname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary For example, createVariable('/GroupA/GroupB/VarC'),('x','y'),float) will create groups GroupA and GroupA/GroupB, plus the variable GroupA/GroupB/VarC, if the preceding groups don't already exist.

The datatype can be a numpy datatype object, or a string that describes a numpy dtype object (like the dtype.str attribue of a numpy array). Supported specifiers include: 'S1' or 'c' (NC_CHAR), 'i1' or 'b' or 'B' (NC_BYTE), 'u1' (NC_UBYTE), 'i2' or 'h' or 's' (NC_SHORT), 'u2' (NC_USHORT), 'i4' or 'i' or 'l' (NC_INT), 'u4' (NC_UINT), 'i8' (NC_INT64), 'u8' (NC_UINT64), 'f4' or 'f' (NC_FLOAT), 'f8' or 'd' (NC_DOUBLE). datatype can also be a CompoundType instance (for a structured, or compound array), a VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.

Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.

dimensions must be a tuple containing dimension names (strings) that have been defined previously using createDimension. The default value is an empty tuple, which means the variable is a scalar.

If the optional keyword zlib is True, the data will be compressed in the netCDF file using gzip compression (default False).

The optional keyword complevel is an integer between 1 and 9 describing the level of compression desired (default 4). Ignored if zlib=False.

If the optional keyword shuffle is True, the HDF5 shuffle filter will be applied before compressing the data (default True). This significantly improves compression. Default is True. Ignored if zlib=False.

If the optional keyword fletcher32 is True, the Fletcher32 HDF5 checksum algorithm is activated to detect errors. Default False.

If the optional keyword contiguous is True, the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.

The optional keyword chunksizes can be used to manually specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available here. Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.

The optional keyword endian can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness.

The zlib, complevel, shuffle, fletcher32, contiguous, chunksizes and endian keywords are silently ignored for netCDF 3 files that do not use HDF5.

The optional keyword fill_value can be used to override the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it, defaults given in netCDF4.default_fillvals). If fill_value is set to False, then the variable is not pre-filled.

If the optional keyword parameter least_significant_digit is specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces 'lossy', but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). From the PSD metadata conventions: "least_significant_digit -- power of ten of the smallest decimal place in unpacked data that is a reliable value." Default is None, or no quantization, or 'lossless' compression.

When creating variables in a NETCDF4 or NETCDF4_CLASSIC formatted file, HDF5 creates something called a 'chunk cache' for each variable. The default size of the chunk cache may be large enough to completely fill available memory when creating thousands of variables. The optional keyword chunk_cache allows you to reduce (or increase) the size of the default chunk cache when creating a variable. The setting only persists as long as the Dataset is open - you can use the set_var_chunk_cache method to change it the next time the Dataset is opened. Warning - messing with this parameter can seriously degrade performance.

The return value is the Variable class instance describing the new variable.

A list of names corresponding to netCDF variable attributes can be obtained with the Variable method ncattrs. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a Variable instance.

Variable instances behave much like array objects. Data can be assigned to or retrieved from a variable with indexing and slicing operations on the Variable instance. A Variable instance has six Dataset standard attributes: dimensions, dtype, shape, ndim, name and least_significant_digit. Application programs should never modify these attributes. The dimensions attribute is a tuple containing the names of the dimensions associated with this variable. The dtype attribute is a string describing the variable's data type (i4, f8, S1, etc). The shape attribute is a tuple describing the current sizes of all the variable's dimensions. The name attribute is a string containing the name of the Variable instance. The least_significant_digit attributes describes the power of ten of the smallest decimal place in the data the contains a reliable value. assigned to the Variable instance. If None, the data is not truncated. The ndim attribute is the number of variable dimensions.

def delncattr(

self,name,value)

delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

def filepath(

self)

Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2

def get_variables_by_attributes(

...)

Returns a list of variables that match specific conditions.

Can pass in key=value parameters and variables are returned that contain all of the matches. For example,

>>> # Get variables with x-axis attribute.
>>> vs = nc.get_variables_by_attributes(axis='X')
>>> # Get variables with matching "standard_name" attribute
>>> vs = nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')

Can pass in key=callable parameter and variables are returned if the callable returns True. The callable should accept a single parameter, the attribute value. None is given as the attribute value when the attribute does not exist on the variable. For example,

>>> # Get Axis variables
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])
>>> # Get variables that don't have an "axis" attribute
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)
>>> # Get variables that have a "grid_mapping" attribute
>>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)

def getncattr(

self,name)

retrievel a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.

def isopen(

...)

is the Dataset open or closed?

def ncattrs(

self)

return netCDF global attribute names for this Dataset or Group in a list.

def renameAttribute(

self, oldname, newname)

rename a Dataset or Group attribute named oldname to newname.

def renameDimension(

self, oldname, newname)

rename a Dimension named oldname to newname.

def renameGroup(

self, oldname, newname)

rename a Group named oldname to newname (requires netcdf >= 4.3.1).

def renameVariable(

self, oldname, newname)

rename a Variable named oldname to newname

def set_auto_mask(

self, True_or_False)

Call set_auto_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_maskandscale(

self, True_or_False)

Call set_auto_maskandscale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_scale(

self, True_or_False)

Call set_auto_scale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_fill_off(

self)

Sets the fill mode for a Dataset open for writing to off.

This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.

def set_fill_on(

self)

Sets the fill mode for a Dataset open for writing to on.

This causes data to be pre-filled with fill values. The fill values can be controlled by the variable's _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined separately for each variable type). The default behavior of the netCDF library correspongs to set_fill_on. Data which are equal to the _Fill_Value indicate that the variable was created, but never written to.

def setncattr(

self,name,value)

set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.

def setncatts(

self,attdict)

set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

def sync(

self)

Writes all buffered data in the Dataset to the disk file.

class Dimension

A netCDF Dimension is used to describe the coordinates of a Variable. See __init__ for more details.

The current maximum size of a Dimension instance can be obtained by calling the python len function on the Dimension instance. The isunlimited method of a Dimension instance can be used to determine if the dimension is unlimited.

Read-only class variables:

name: String name, used when creating a Variable with createVariable.

size: Current Dimension size (same as len(d), where d is a Dimension instance).

Ancestors (in MRO)

Class variables

var name

A string describing the name of the Dimension - used when creating a Variable instance with createVariable.

var size

Static methods

def __init__(

self, group, name, size=None)

Dimension constructor.

group: Group instance to associate with dimension.

name: Name of the dimension.

size: Size of the dimension. None or 0 means unlimited. (Default None).

Note: Dimension instances should be created using the createDimension method of a Group or Dataset instance, not using __init__ directly.

def group(

self)

return the group that this Dimension is a member of.

def isunlimited(

self)

returns True if the Dimension instance is unlimited, False otherwise.

class EnumType

A EnumType instance is used to describe an Enum data type, and can be passed to the the createVariable method of a Dataset or Group instance. See __init__ for more details.

The instance variables dtype, name and enum_dict should not be modified by the user.

Ancestors (in MRO)

Class variables

var dtype

A numpy integer dtype object describing the base type for the Enum.

var enum_dict

A python dictionary describing the enum fields and values.

var name

String name.

Static methods

def __init__(

group, datatype, datatype_name, enum_dict)

EnumType constructor.

group: Group instance to associate with the VLEN datatype.

datatype: An numpy integer dtype object describing the base type for the Enum.

datatype_name: a Python string containing a description of the Enum data type.

enum_dict: a Python dictionary containing the Enum field/value pairs.

Note: EnumType instances should be created using the createEnumType method of a Dataset or Group instance, not using this class directly.

class Group

Groups define a hierarchical namespace within a netCDF file. They are analagous to directories in a unix filesystem. Each Group behaves like a Dataset within a Dataset, and can contain it's own variables, dimensions and attributes (and other Groups). See __init__ for more details.

Group inherits from Dataset, so all the Dataset class methods and variables are available to a Group instance (except the close method).

Additional read-only class variables:

name: String describing the group name.

Ancestors (in MRO)

Class variables

var cmptypes

Inheritance: Dataset.cmptypes

The cmptypes dictionary maps the names of compound types defined for the Group or Dataset to instances of the CompoundType class.

var data_model

Inheritance: Dataset.data_model

data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

var dimensions

Inheritance: Dataset.dimensions

The dimensions dictionary maps the names of dimensions defined for the Group or Dataset to instances of the Dimension class.

var disk_format

Inheritance: Dataset.disk_format

disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.

var enumtypes

Inheritance: Dataset.enumtypes

The enumtypes dictionary maps the names of Enum types defined for the Group or Dataset to instances of the EnumType class.

var file_format

Inheritance: Dataset.file_format

same as data_model, retained for backwards compatibility.

var groups

Inheritance: Dataset.groups

The groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF4 file).

var keepweakref

Inheritance: Dataset.keepweakref

If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.

var name

A string describing the name of the Group.

var parent

Inheritance: Dataset.parent

parent is a reference to the parent Group instance. None for the root group or Dataset instance

var path

Inheritance: Dataset.path

path shows the location of the Group in the Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A Dataset instance is the root group, so the path is simply '/'.

var variables

Inheritance: Dataset.variables

The variables dictionary maps the names of variables defined for this Dataset or Group to instances of the Variable class.

var vltypes

Inheritance: Dataset.vltypes

The vltypes dictionary maps the names of variable-length types defined for the Group or Dataset to instances of the VLType class.

Static methods

def __init__(

self, parent, name)

Inheritance: Dataset.__init__

Group constructor.

parent: Group instance for the parent group. If being created in the root group, use a Dataset instance.

name: - Name of the group.

Note: Group instances should be created using the createGroup method of a Dataset instance, or another Group instance, not using this class directly.

def close(

self)

Inheritance: Dataset.close

overrides Dataset close method which does not apply to Group instances, raises IOError.

def createCompoundType(

self, datatype, datatype_name)

Inheritance: Dataset.createCompoundType

Creates a new compound data type named datatype_name from the numpy dtype object datatype.

Note: If the new compound data type contains other compound data types (i.e. it is a 'nested' compound type, where not all of the elements are homogeneous numeric data types), then the 'inner' compound types must be created first.

The return value is the CompoundType class instance describing the new datatype.

def createDimension(

self, dimname, size=None)

Inheritance: Dataset.createDimension

Creates a new dimension with the given dimname and size.

size must be a positive integer or None, which stands for "unlimited" (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the Dimension class instance describing the new dimension. To determine the current maximum size of the dimension, use the len function on the Dimension instance. To determine if a dimension is 'unlimited', use the isunlimited method of the Dimension instance.

def createEnumType(

self, datatype, datatype_name, enum_dict)

Inheritance: Dataset.createEnumType

Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.

The return value is the EnumType class instance describing the new datatype.

def createGroup(

self, groupname)

Inheritance: Dataset.createGroup

Creates a new Group with the given groupname.

If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analagous to mkdir -p in unix). For example, createGroup('/GroupA/GroupB/GroupC') will create GroupA, GroupA/GroupB, and GroupA/GroupB/GroupC, if they don't already exist. If the specified path describes a group that already exists, no error is raised.

The return value is a Group class instance.

def createVLType(

self, datatype, datatype_name)

Inheritance: Dataset.createVLType

Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.

The return value is the VLType class instance describing the new datatype.

def createVariable(

self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None, fill_value=None)

Inheritance: Dataset.createVariable

Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.

If varname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary For example, createVariable('/GroupA/GroupB/VarC'),('x','y'),float) will create groups GroupA and GroupA/GroupB, plus the variable GroupA/GroupB/VarC, if the preceding groups don't already exist.

The datatype can be a numpy datatype object, or a string that describes a numpy dtype object (like the dtype.str attribue of a numpy array). Supported specifiers include: 'S1' or 'c' (NC_CHAR), 'i1' or 'b' or 'B' (NC_BYTE), 'u1' (NC_UBYTE), 'i2' or 'h' or 's' (NC_SHORT), 'u2' (NC_USHORT), 'i4' or 'i' or 'l' (NC_INT), 'u4' (NC_UINT), 'i8' (NC_INT64), 'u8' (NC_UINT64), 'f4' or 'f' (NC_FLOAT), 'f8' or 'd' (NC_DOUBLE). datatype can also be a CompoundType instance (for a structured, or compound array), a VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.

Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.

dimensions must be a tuple containing dimension names (strings) that have been defined previously using createDimension. The default value is an empty tuple, which means the variable is a scalar.

If the optional keyword zlib is True, the data will be compressed in the netCDF file using gzip compression (default False).

The optional keyword complevel is an integer between 1 and 9 describing the level of compression desired (default 4). Ignored if zlib=False.

If the optional keyword shuffle is True, the HDF5 shuffle filter will be applied before compressing the data (default True). This significantly improves compression. Default is True. Ignored if zlib=False.

If the optional keyword fletcher32 is True, the Fletcher32 HDF5 checksum algorithm is activated to detect errors. Default False.

If the optional keyword contiguous is True, the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.

The optional keyword chunksizes can be used to manually specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available here. Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.

The optional keyword endian can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness.

The zlib, complevel, shuffle, fletcher32, contiguous, chunksizes and endian keywords are silently ignored for netCDF 3 files that do not use HDF5.

The optional keyword fill_value can be used to override the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it, defaults given in netCDF4.default_fillvals). If fill_value is set to False, then the variable is not pre-filled.

If the optional keyword parameter least_significant_digit is specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces 'lossy', but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). From the PSD metadata conventions: "least_significant_digit -- power of ten of the smallest decimal place in unpacked data that is a reliable value." Default is None, or no quantization, or 'lossless' compression.

When creating variables in a NETCDF4 or NETCDF4_CLASSIC formatted file, HDF5 creates something called a 'chunk cache' for each variable. The default size of the chunk cache may be large enough to completely fill available memory when creating thousands of variables. The optional keyword chunk_cache allows you to reduce (or increase) the size of the default chunk cache when creating a variable. The setting only persists as long as the Dataset is open - you can use the set_var_chunk_cache method to change it the next time the Dataset is opened. Warning - messing with this parameter can seriously degrade performance.

The return value is the Variable class instance describing the new variable.

A list of names corresponding to netCDF variable attributes can be obtained with the Variable method ncattrs. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a Variable instance.

Variable instances behave much like array objects. Data can be assigned to or retrieved from a variable with indexing and slicing operations on the Variable instance. A Variable instance has six Dataset standard attributes: dimensions, dtype, shape, ndim, name and least_significant_digit. Application programs should never modify these attributes. The dimensions attribute is a tuple containing the names of the dimensions associated with this variable. The dtype attribute is a string describing the variable's data type (i4, f8, S1, etc). The shape attribute is a tuple describing the current sizes of all the variable's dimensions. The name attribute is a string containing the name of the Variable instance. The least_significant_digit attributes describes the power of ten of the smallest decimal place in the data the contains a reliable value. assigned to the Variable instance. If None, the data is not truncated. The ndim attribute is the number of variable dimensions.

def delncattr(

self,name,value)

Inheritance: Dataset.delncattr

delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

def filepath(

self)

Inheritance: Dataset.filepath

Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2

def get_variables_by_attributes(

...)

Inheritance: Dataset.get_variables_by_attributes

Returns a list of variables that match specific conditions.

Can pass in key=value parameters and variables are returned that contain all of the matches. For example,

>>> # Get variables with x-axis attribute.
>>> vs = nc.get_variables_by_attributes(axis='X')
>>> # Get variables with matching "standard_name" attribute
>>> vs = nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')

Can pass in key=callable parameter and variables are returned if the callable returns True. The callable should accept a single parameter, the attribute value. None is given as the attribute value when the attribute does not exist on the variable. For example,

>>> # Get Axis variables
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])
>>> # Get variables that don't have an "axis" attribute
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)
>>> # Get variables that have a "grid_mapping" attribute
>>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)

def getncattr(

self,name)

Inheritance: Dataset.getncattr

retrievel a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.

def isopen(

...)

Inheritance: Dataset.isopen

is the Dataset open or closed?

def ncattrs(

self)

Inheritance: Dataset.ncattrs

return netCDF global attribute names for this Dataset or Group in a list.

def renameAttribute(

self, oldname, newname)

Inheritance: Dataset.renameAttribute

rename a Dataset or Group attribute named oldname to newname.

def renameDimension(

self, oldname, newname)

Inheritance: Dataset.renameDimension

rename a Dimension named oldname to newname.

def renameGroup(

self, oldname, newname)

Inheritance: Dataset.renameGroup

rename a Group named oldname to newname (requires netcdf >= 4.3.1).

def renameVariable(

self, oldname, newname)

Inheritance: Dataset.renameVariable

rename a Variable named oldname to newname

def set_auto_mask(

self, True_or_False)

Inheritance: Dataset.set_auto_mask

Call set_auto_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_maskandscale(

self, True_or_False)

Inheritance: Dataset.set_auto_maskandscale

Call set_auto_maskandscale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_scale(

self, True_or_False)

Inheritance: Dataset.set_auto_scale

Call set_auto_scale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_fill_off(

self)

Inheritance: Dataset.set_fill_off

Sets the fill mode for a Dataset open for writing to off.

This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.

def set_fill_on(

self)

Inheritance: Dataset.set_fill_on

Sets the fill mode for a Dataset open for writing to on.

This causes data to be pre-filled with fill values. The fill values can be controlled by the variable's _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined separately for each variable type). The default behavior of the netCDF library correspongs to set_fill_on. Data which are equal to the _Fill_Value indicate that the variable was created, but never written to.

def setncattr(

self,name,value)

Inheritance: Dataset.setncattr

set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.

def setncatts(

self,attdict)

Inheritance: Dataset.setncatts

set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

def sync(

self)

Inheritance: Dataset.sync

Writes all buffered data in the Dataset to the disk file.

class MFDataset

Class for reading multi-file netCDF Datasets, making variables spanning multiple files appear as if they were in one file. Datasets must be in NETCDF4_CLASSIC, NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA format (NETCDF4 Datasets won't work).

Adapted from pycdf by Andre Gosselin.

Example usage (See __init__ for more details):

>>> import numpy
>>> # create a series of netCDF files with a variable sharing
>>> # the same unlimited dimension.
>>> for nf in range(10):
>>>     f = Dataset("mftest%s.nc" % nf,"w")
>>>     f.createDimension("x",None)
>>>     x = f.createVariable("x","i",("x",))
>>>     x[0:10] = numpy.arange(nf*10,10*(nf+1))
>>>     f.close()
>>> # now read all those files in at once, in one Dataset.
>>> f = MFDataset("mftest*nc")
>>> print f.variables["x"][:]
[ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]

Ancestors (in MRO)

Class variables

var cmptypes

Inheritance: Dataset.cmptypes

The cmptypes dictionary maps the names of compound types defined for the Group or Dataset to instances of the CompoundType class.

var data_model

Inheritance: Dataset.data_model

data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

var dimensions

Inheritance: Dataset.dimensions

The dimensions dictionary maps the names of dimensions defined for the Group or Dataset to instances of the Dimension class.

var disk_format

Inheritance: Dataset.disk_format

disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.

var enumtypes

Inheritance: Dataset.enumtypes

The enumtypes dictionary maps the names of Enum types defined for the Group or Dataset to instances of the EnumType class.

var file_format

Inheritance: Dataset.file_format

same as data_model, retained for backwards compatibility.

var groups

Inheritance: Dataset.groups

The groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF4 file).

var keepweakref

Inheritance: Dataset.keepweakref

If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.

var parent

Inheritance: Dataset.parent

parent is a reference to the parent Group instance. None for the root group or Dataset instance

var path

Inheritance: Dataset.path

path shows the location of the Group in the Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A Dataset instance is the root group, so the path is simply '/'.

var variables

Inheritance: Dataset.variables

The variables dictionary maps the names of variables defined for this Dataset or Group to instances of the Variable class.

var vltypes

Inheritance: Dataset.vltypes

The vltypes dictionary maps the names of variable-length types defined for the Group or Dataset to instances of the VLType class.

Static methods

def createCompoundType(

self, datatype, datatype_name)

Inheritance: Dataset.createCompoundType

Creates a new compound data type named datatype_name from the numpy dtype object datatype.

Note: If the new compound data type contains other compound data types (i.e. it is a 'nested' compound type, where not all of the elements are homogeneous numeric data types), then the 'inner' compound types must be created first.

The return value is the CompoundType class instance describing the new datatype.

def createDimension(

self, dimname, size=None)

Inheritance: Dataset.createDimension

Creates a new dimension with the given dimname and size.

size must be a positive integer or None, which stands for "unlimited" (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the Dimension class instance describing the new dimension. To determine the current maximum size of the dimension, use the len function on the Dimension instance. To determine if a dimension is 'unlimited', use the isunlimited method of the Dimension instance.

def createEnumType(

self, datatype, datatype_name, enum_dict)

Inheritance: Dataset.createEnumType

Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.

The return value is the EnumType class instance describing the new datatype.

def createGroup(

self, groupname)

Inheritance: Dataset.createGroup

Creates a new Group with the given groupname.

If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analagous to mkdir -p in unix). For example, createGroup('/GroupA/GroupB/GroupC') will create GroupA, GroupA/GroupB, and GroupA/GroupB/GroupC, if they don't already exist. If the specified path describes a group that already exists, no error is raised.

The return value is a Group class instance.

def createVLType(

self, datatype, datatype_name)

Inheritance: Dataset.createVLType

Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.

The return value is the VLType class instance describing the new datatype.

def createVariable(

self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None, fill_value=None)

Inheritance: Dataset.createVariable

Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.

If varname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary For example, createVariable('/GroupA/GroupB/VarC'),('x','y'),float) will create groups GroupA and GroupA/GroupB, plus the variable GroupA/GroupB/VarC, if the preceding groups don't already exist.

The datatype can be a numpy datatype object, or a string that describes a numpy dtype object (like the dtype.str attribue of a numpy array). Supported specifiers include: 'S1' or 'c' (NC_CHAR), 'i1' or 'b' or 'B' (NC_BYTE), 'u1' (NC_UBYTE), 'i2' or 'h' or 's' (NC_SHORT), 'u2' (NC_USHORT), 'i4' or 'i' or 'l' (NC_INT), 'u4' (NC_UINT), 'i8' (NC_INT64), 'u8' (NC_UINT64), 'f4' or 'f' (NC_FLOAT), 'f8' or 'd' (NC_DOUBLE). datatype can also be a CompoundType instance (for a structured, or compound array), a VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.

Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.

dimensions must be a tuple containing dimension names (strings) that have been defined previously using createDimension. The default value is an empty tuple, which means the variable is a scalar.

If the optional keyword zlib is True, the data will be compressed in the netCDF file using gzip compression (default False).

The optional keyword complevel is an integer between 1 and 9 describing the level of compression desired (default 4). Ignored if zlib=False.

If the optional keyword shuffle is True, the HDF5 shuffle filter will be applied before compressing the data (default True). This significantly improves compression. Default is True. Ignored if zlib=False.

If the optional keyword fletcher32 is True, the Fletcher32 HDF5 checksum algorithm is activated to detect errors. Default False.

If the optional keyword contiguous is True, the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.

The optional keyword chunksizes can be used to manually specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available here. Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.

The optional keyword endian can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness.

The zlib, complevel, shuffle, fletcher32, contiguous, chunksizes and endian keywords are silently ignored for netCDF 3 files that do not use HDF5.

The optional keyword fill_value can be used to override the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it, defaults given in netCDF4.default_fillvals). If fill_value is set to False, then the variable is not pre-filled.

If the optional keyword parameter least_significant_digit is specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces 'lossy', but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). From the PSD metadata conventions: "least_significant_digit -- power of ten of the smallest decimal place in unpacked data that is a reliable value." Default is None, or no quantization, or 'lossless' compression.

When creating variables in a NETCDF4 or NETCDF4_CLASSIC formatted file, HDF5 creates something called a 'chunk cache' for each variable. The default size of the chunk cache may be large enough to completely fill available memory when creating thousands of variables. The optional keyword chunk_cache allows you to reduce (or increase) the size of the default chunk cache when creating a variable. The setting only persists as long as the Dataset is open - you can use the set_var_chunk_cache method to change it the next time the Dataset is opened. Warning - messing with this parameter can seriously degrade performance.

The return value is the Variable class instance describing the new variable.

A list of names corresponding to netCDF variable attributes can be obtained with the Variable method ncattrs. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a Variable instance.

Variable instances behave much like array objects. Data can be assigned to or retrieved from a variable with indexing and slicing operations on the Variable instance. A Variable instance has six Dataset standard attributes: dimensions, dtype, shape, ndim, name and least_significant_digit. Application programs should never modify these attributes. The dimensions attribute is a tuple containing the names of the dimensions associated with this variable. The dtype attribute is a string describing the variable's data type (i4, f8, S1, etc). The shape attribute is a tuple describing the current sizes of all the variable's dimensions. The name attribute is a string containing the name of the Variable instance. The least_significant_digit attributes describes the power of ten of the smallest decimal place in the data the contains a reliable value. assigned to the Variable instance. If None, the data is not truncated. The ndim attribute is the number of variable dimensions.

def delncattr(

self,name,value)

Inheritance: Dataset.delncattr

delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

def filepath(

self)

Inheritance: Dataset.filepath

Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2

def get_variables_by_attributes(

...)

Inheritance: Dataset.get_variables_by_attributes

Returns a list of variables that match specific conditions.

Can pass in key=value parameters and variables are returned that contain all of the matches. For example,

>>> # Get variables with x-axis attribute.
>>> vs = nc.get_variables_by_attributes(axis='X')
>>> # Get variables with matching "standard_name" attribute
>>> vs = nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')

Can pass in key=callable parameter and variables are returned if the callable returns True. The callable should accept a single parameter, the attribute value. None is given as the attribute value when the attribute does not exist on the variable. For example,

>>> # Get Axis variables
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])
>>> # Get variables that don't have an "axis" attribute
>>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)
>>> # Get variables that have a "grid_mapping" attribute
>>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)

def getncattr(

self,name)

Inheritance: Dataset.getncattr

retrievel a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.

def isopen(

...)

Inheritance: Dataset.isopen

is the Dataset open or closed?

def renameAttribute(

self, oldname, newname)

Inheritance: Dataset.renameAttribute

rename a Dataset or Group attribute named oldname to newname.

def renameDimension(

self, oldname, newname)

Inheritance: Dataset.renameDimension

rename a Dimension named oldname to newname.

def renameGroup(

self, oldname, newname)

Inheritance: Dataset.renameGroup

rename a Group named oldname to newname (requires netcdf >= 4.3.1).

def renameVariable(

self, oldname, newname)

Inheritance: Dataset.renameVariable

rename a Variable named oldname to newname

def set_auto_mask(

self, True_or_False)

Inheritance: Dataset.set_auto_mask

Call set_auto_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_maskandscale(

self, True_or_False)

Inheritance: Dataset.set_auto_maskandscale

Call set_auto_maskandscale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_auto_scale(

self, True_or_False)

Inheritance: Dataset.set_auto_scale

Call set_auto_scale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

True_or_False: Boolean determining if automatic variable scaling shall be applied for all variables.

Note: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.

def set_fill_off(

self)

Inheritance: Dataset.set_fill_off

Sets the fill mode for a Dataset open for writing to off.

This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.

def set_fill_on(

self)

Inheritance: Dataset.set_fill_on

Sets the fill mode for a Dataset open for writing to on.

This causes data to be pre-filled with fill values. The fill values can be controlled by the variable's _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined separately for each variable type). The default behavior of the netCDF library correspongs to set_fill_on. Data which are equal to the _Fill_Value indicate that the variable was created, but never written to.

def setncattr(

self,name,value)

Inheritance: Dataset.setncattr

set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.

def setncatts(

self,attdict)

Inheritance: Dataset.setncatts

set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

def sync(

self)

Inheritance: Dataset.sync

Writes all buffered data in the Dataset to the disk file.

Methods

def __init__(

self, files, check=False, aggdim=None, exclude=[])

Inheritance: Dataset.__init__

Open a Dataset spanning multiple files, making it look as if it was a single file. Variables in the list of files that share the same dimension (specified with the keyword aggdim) are aggregated. If aggdim is not specified, the unlimited is aggregated. Currently, aggdim must be the leftmost (slowest varying) dimension of each of the variables to be aggregated.

files: either a sequence of netCDF files or a string with a wildcard (converted to a sorted list of files using glob) The first file in the list will become the "master" file, defining all the variables with an aggregation dimension which may span subsequent files. Attribute access returns attributes only from "master" file. The files are always opened in read-only mode.

check: True if you want to do consistency checking to ensure the correct variables structure for all of the netcdf files. Checking makes the initialization of the MFDataset instance much slower. Default is False.

aggdim: The name of the dimension to aggregate over (must be the leftmost dimension of each of the variables to be aggregated). If None (default), aggregate over the unlimited dimension.

exclude: A list of variable names to exclude from aggregation. Default is an empty list.

def close(

self)

Inheritance: Dataset.close

close all the open files.

def ncattrs(

self)

Inheritance: Dataset.ncattrs

return the netcdf attribute names from the master file.

class MFTime

Class providing an interface to a MFDataset time Variable by imposing a unique common time unit to all files.

Example usage (See __init__ for more details):

>>> import numpy
>>> f1 = Dataset("mftest_1.nc","w", format="NETCDF4_CLASSIC")
>>> f2 = Dataset("mftest_2.nc","w", format="NETCDF4_CLASSIC")
>>> f1.createDimension("time",None)
>>> f2.createDimension("time",None)
>>> t1 = f1.createVariable("time","i",("time",))
>>> t2 = f2.createVariable("time","i",("time",))
>>> t1.units = "days since 2000-01-01"
>>> t2.units = "days since 2000-02-01"
>>> t1.calendar = "standard"
>>> t2.calendar = "standard"
>>> t1[:] = numpy.arange(31)
>>> t2[:] = numpy.arange(30)
>>> f1.close()
>>> f2.close()
>>> # Read the two files in at once, in one Dataset.
>>> f = MFDataset("mftest*nc")
>>> t = f.variables["time"]
>>> print t.units
days since 2000-01-01
>>> print t[32] # The value written in the file, inconsistent with the MF time units.
1
>>> T = MFTime(t)
>>> print T[32]
32

Ancestors (in MRO)

  • MFTime
  • netCDF4._netCDF4._Variable
  • __builtin__.object

Methods

def __init__(

self, time, units=None)

Create a time Variable with units consistent across a multifile dataset.

time: Time variable from a MFDataset.

units: Time units, for example, days since 1979-01-01. If None, use the units from the master variable.

def ncattrs(

...)

def set_auto_maskandscale(

...)

def typecode(

...)

class VLType

A VLType instance is used to describe a variable length (VLEN) data type, and can be passed to the the createVariable method of a Dataset or Group instance. See __init__ for more details.

The instance variables dtype and name should not be modified by the user.

Ancestors (in MRO)

Class variables

var dtype

A numpy dtype object describing the component type for the VLEN.

var name

String name.

Static methods

def __init__(

group, datatype, datatype_name)

VLType constructor.

group: Group instance to associate with the VLEN datatype.

datatype: An numpy dtype object describing the component type for the variable length array.

datatype_name: a Python string containing a description of the VLEN data type.

Note: VLType instances should be created using the createVLType method of a Dataset or Group instance, not using this class directly.

class Variable

A netCDF Variable is used to read and write netCDF data. They are analagous to numpy array objects. See __init__ for more details.

A list of attribute names corresponding to netCDF attributes defined for the variable can be obtained with the ncattrs method. These attributes can be created by assigning to an attribute of the Variable instance. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a Variable instance.

The following class variables are read-only:

dimensions: A tuple containing the names of the dimensions associated with this variable.

dtype: A numpy dtype object describing the variable's data type.

ndim: The number of variable dimensions.

shape: A tuple with the current shape (length of all dimensions).

scale: If True, scale_factor and add_offset are applied. Default is True, can be reset using set_auto_scale and set_auto_maskandscale methods.

mask: If True, data is automatically converted to/from masked arrays when missing values or fill values are present. Default is True, can be reset using set_auto_mask and set_auto_maskandscale methods.

least_significant_digit: Describes the power of ten of the smallest decimal place in the data the contains a reliable value. Data is truncated to this decimal place when it is assigned to the Variable instance. If None, the data is not truncated.

__orthogonal_indexing__: Always True. Indicates to client code that the object supports 'orthogonal indexing', which means that slices that are 1d arrays or lists slice along each dimension independently. This behavior is similar to Fortran or Matlab, but different than numpy.

datatype: numpy data type (for primitive data types) or VLType/CompoundType instance (for compound or vlen data types).

name: String name.

size: The number of stored elements.

Ancestors (in MRO)

Class variables

var datatype

numpy data type (for primitive data types) or VLType/CompoundType/EnumType instance (for compound, vlen or enum data types).

var dimensions

A tuple containing the names of the dimensions associated with this variable.

var dtype

A numpy dtype object describing the variable's data type.

var mask

If True, data is automatically converted to/from masked arrays when missing values or fill values are present. Default is True, can be reset using set_auto_mask and set_auto_maskandscale methods.

var name

String name.

var ndim

The number of variable dimensions.

var scale

if True, scale_factor and add_offset are applied. Default is True, can be reset using set_auto_scale and set_auto_maskandscale methods.

var shape

A tuple with the current shape (length of all dimensions).

var size

The number of stored elements.

Static methods

def __init__(

self, group, name, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian='native', least_significant_digit=None,fill_value=None)

Variable constructor.

group: Group or Dataset instance to associate with variable.

name: Name of the variable.

datatype: Variable data type. Can be specified by providing a numpy dtype object, or a string that describes a numpy dtype object. Supported values, corresponding to str attribute of numpy dtype objects, include 'f4' (32-bit floating point), 'f8' (64-bit floating point), 'i4' (32-bit signed integer), 'i2' (16-bit signed integer), 'i8' (64-bit singed integer), 'i4' (8-bit singed integer), 'i1' (8-bit signed integer), 'u1' (8-bit unsigned integer), 'u2' (16-bit unsigned integer), 'u4' (32-bit unsigned integer), 'u8' (64-bit unsigned integer), or 'S1' (single-character string). From compatibility with Scientific.IO.NetCDF, the old Numeric single character typecodes can also be used ('f' instead of 'f4', 'd' instead of 'f8', 'h' or 's' instead of 'i2', 'b' or 'B' instead of 'i1', 'c' instead of 'S1', and 'i' or 'l' instead of 'i4'). datatype can also be a CompoundType instance (for a structured, or compound array), a VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.

dimensions: a tuple containing the variable's dimension names (defined previously with createDimension). Default is an empty tuple which means the variable is a scalar (and therefore has no dimensions).

zlib: if True, data assigned to the Variable instance is compressed on disk. Default False.

complevel: the level of zlib compression to use (1 is the fastest, but poorest compression, 9 is the slowest but best compression). Default 4. Ignored if zlib=False.

shuffle: if True, the HDF5 shuffle filter is applied to improve compression. Default True. Ignored if zlib=False.

fletcher32: if True (default False), the Fletcher32 checksum algorithm is used for error detection.

contiguous: if True (default False), the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.

chunksizes: Can be used to specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available here. Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.

endian: Can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness. For netCDF 3 files (that don't use HDF5), only endian='native' is allowed.

The zlib, complevel, shuffle, fletcher32, contiguous and chunksizes keywords are silently ignored for netCDF 3 files that do not use HDF5.

least_significant_digit: If specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces 'lossy', but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using around(scaledata)/scale, where scale = 2*bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). Default is None, or no quantization.

fill_value: If specified, the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it) is replaced with this value. If fill_value is set to False, then the variable is not pre-filled. The default netCDF fill values can be found in netCDF4.default_fillvals.

Note: Variable instances should be created using the createVariable method of a Dataset or Group instance, not using this class directly.

def assignValue(

self, val)

assign a value to a scalar variable. Provided for compatibility with Scientific.IO.NetCDF, can also be done by assigning to an Ellipsis slice ([...]).

def chunking(

self)

return variable chunking information. If the dataset is defined to be contiguous (and hence there is no chunking) the word 'contiguous' is returned. Otherwise, a sequence with the chunksize for each dimension is returned.

def delncattr(

self,name,value)

delete a netCDF variable attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

def endian(

self)

return endian-ness (little,big,native) of variable (as stored in HDF5 file).

def filters(

self)

return dictionary containing HDF5 filter parameters.

def getValue(

self)

get the value of a scalar variable. Provided for compatibility with Scientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...]).

def get_var_chunk_cache(

self)

return variable chunk cache information in a tuple (size,nelems,preemption). See netcdf C library documentation for nc_get_var_chunk_cache for details.

def getncattr(

self,name)

retrievel a netCDF variable attribute. Use if you need to set a netCDF attribute with the same name as one of the reserved python attributes.

def group(

self)

return the group that this Variable is a member of.

def ncattrs(

self)

return netCDF attribute names for this Variable in a list.

def renameAttribute(

self, oldname, newname)

rename a Variable attribute named oldname to newname.

def set_auto_mask(

self,mask)

turn on or off automatic conversion of variable data to and from masked arrays .

If mask is set to True, when data is read from a variable it is converted to a masked array if any of the values are exactly equal to the either the netCDF _FillValue or the value specified by the missing_value variable attribute. The fill_value of the masked array is set to the missing_value attribute (if it exists), otherwise the netCDF _FillValue attribute (which has a default value for each data type). When data is written to a variable, the masked array is converted back to a regular numpy array by replacing all the masked values by the fill_value of the masked array.

The default value of mask is True (automatic conversions are performed).

def set_auto_maskandscale(

self,maskandscale)

turn on or off automatic conversion of variable data to and from masked arrays and automatic packing/unpacking of variable data using scale_factor and add_offset attributes.

If maskandscale is set to True, when data is read from a variable it is converted to a masked array if any of the values are exactly equal to the either the netCDF _FillValue or the value specified by the missing_value variable attribute. The fill_value of the masked array is set to the missing_value attribute (if it exists), otherwise the netCDF _FillValue attribute (which has a default value for each data type). When data is written to a variable, the masked array is converted back to a regular numpy array by replacing all the masked values by the fill_value of the masked array.

If maskandscale is set to True, and the variable has a scale_factor or an add_offset attribute, then data read from that variable is unpacked using::

data = self.scale_factor*data + self.add_offset

When data is written to a variable it is packed using::

data = (data - self.add_offset)/self.scale_factor

If either scale_factor is present, but add_offset is missing, add_offset is assumed zero. If add_offset is present, but scale_factor is missing, scale_factor is assumed to be one. For more information on how scale_factor and add_offset can be used to provide simple compression, see the PSD metadata conventions.

The default value of maskandscale is True (automatic conversions are performed).

def set_auto_scale(

self,scale)

turn on or off automatic packing/unpacking of variable data using scale_factor and add_offset attributes.

If scale is set to True, and the variable has a scale_factor or an add_offset attribute, then data read from that variable is unpacked using::

data = self.scale_factor*data + self.add_offset

When data is written to a variable it is packed using::

data = (data - self.add_offset)/self.scale_factor

If either scale_factor is present, but add_offset is missing, add_offset is assumed zero. If add_offset is present, but scale_factor is missing, scale_factor is assumed to be one. For more information on how scale_factor and add_offset can be used to provide simple compression, see the PSD metadata conventions.

The default value of scale is True (automatic conversions are performed).

def set_var_chunk_cache(

self,size=None,nelems=None,preemption=None)

change variable chunk cache settings. See netcdf C library documentation for nc_set_var_chunk_cache for details.

def setncattr(

self,name,value)

set a netCDF variable attribute using name,value pair. Use if you need to set a netCDF attribute with the same name as one of the reserved python attributes.

def setncatts(

self,attdict)

set a bunch of netCDF variable attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

netcdf4-python-1.2.2rel/examples/000077500000000000000000000000001264125125200167035ustar00rootroot00000000000000netcdf4-python-1.2.2rel/examples/README.md000066400000000000000000000016551264125125200201710ustar00rootroot00000000000000* `tutorial.py`: code from introduction section of documentation. * `json_att.py`: shows to to use json to serialize python objects, save them as netcdf attributes, and then convert them back to python objects. * `subset.py`: shows how to use 'orthogonal indexing' to select geographic regions. * `reading_netcdf.ipynb`: ipython notebook from Unidata python workshop. * `writing_netcdf.ipynb`: ipython notebook from Unidata python workshop. * `threaded_read.py`: test script for concurrent threaded reads. * `bench.py`: benchmarks for reading/writing using different formats. * `bench_compress*.py``: benchmarks for reading/writing with compression. * `bench_diskless.py`: benchmarks for 'diskless' IO. * `test_stringarr.py`: test utilities for converting arrays of fixed-length strings to arrays of characters (with an extra dimension), and vice-versa. Useful since netcdf does not have a datatype for fixed-length string arrays. netcdf4-python-1.2.2rel/examples/bench.py000066400000000000000000000031071264125125200203350ustar00rootroot00000000000000# benchmark reads and writes, with and without compression. # tests all four supported file formats. from numpy.random.mtrand import uniform import netCDF4 from timeit import Timer import os, sys # create an n1dim by n2dim by n3dim random array. n1dim = 30 n2dim = 15 n3dim = 73 n4dim = 144 ntrials = 10 sys.stdout.write('reading and writing a %s by %s by %s by %s random array ..\n'%(n1dim,n2dim,n3dim,n4dim)) array = uniform(size=(n1dim,n2dim,n3dim,n4dim)) def write_netcdf(filename,zlib=False,least_significant_digit=None,format='NETCDF4'): file = netCDF4.Dataset(filename,'w',format=format) file.createDimension('n1', n1dim) file.createDimension('n2', n2dim) file.createDimension('n3', n3dim) file.createDimension('n4', n4dim) foo = file.createVariable('data', 'f8',('n1','n2','n3','n4'),zlib=zlib,least_significant_digit=least_significant_digit) foo[:] = array file.close() def read_netcdf(filename): file = netCDF4.Dataset(filename) data = file.variables['data'][:] file.close() for format in ['NETCDF3_CLASSIC','NETCDF3_64BIT','NETCDF4_CLASSIC','NETCDF4']: sys.stdout.write('testing file format %s ...\n' % format) # writing, no compression. t = Timer("write_netcdf('test1.nc',format='%s')" % format,"from __main__ import write_netcdf") sys.stdout.write('writing took %s seconds\n' %\ repr(sum(t.repeat(ntrials,1))/ntrials)) # test reading. t = Timer("read_netcdf('test1.nc')","from __main__ import read_netcdf") sys.stdout.write('reading took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) netcdf4-python-1.2.2rel/examples/bench_compress.py000066400000000000000000000035421264125125200222530ustar00rootroot00000000000000# benchmark reads and writes, with and without compression. # tests all four supported file formats. from numpy.random.mtrand import uniform import netCDF4 from timeit import Timer import os, sys # create an n1dim by n2dim by n3dim random array. n1dim = 30 n2dim = 15 n3dim = 73 n4dim = 144 ntrials = 10 sys.stdout.write('reading and writing a %s by %s by %s by %s random array ..\n'%(n1dim,n2dim,n3dim,n4dim)) sys.stdout.write('(average of %s trials)\n' % ntrials) array = netCDF4._quantize(uniform(size=(n1dim,n2dim,n3dim,n4dim)),4) def write_netcdf(filename,zlib=False,shuffle=False,complevel=6): file = netCDF4.Dataset(filename,'w',format='NETCDF4') file.createDimension('n1', n1dim) file.createDimension('n2', n2dim) file.createDimension('n3', n3dim) file.createDimension('n4', n4dim) foo = file.createVariable('data',\ 'f8',('n1','n2','n3','n4'),zlib=zlib,shuffle=shuffle,complevel=complevel) foo[:] = array file.close() def read_netcdf(filename): file = netCDF4.Dataset(filename) data = file.variables['data'][:] file.close() for compress_kwargs in ["zlib=False,shuffle=False","zlib=True,shuffle=False", "zlib=True,shuffle=True","zlib=True,shuffle=True,complevel=2"]: sys.stdout.write('testing compression %s...\n' % repr(compress_kwargs)) # writing. t = Timer("write_netcdf('test.nc',%s)" % compress_kwargs,"from __main__ import write_netcdf") sys.stdout.write('writing took %s seconds\n' %\ repr(sum(t.repeat(ntrials,1))/ntrials)) # test reading. t = Timer("read_netcdf('test.nc')","from __main__ import read_netcdf") sys.stdout.write('reading took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) # print out size of resulting files. sys.stdout.write('size of test.nc = %s\n'%repr(os.stat('test.nc').st_size)) netcdf4-python-1.2.2rel/examples/bench_compress2.py000066400000000000000000000034231264125125200223330ustar00rootroot00000000000000# benchmark reads and writes, with and without compression. # tests all four supported file formats. from numpy.random.mtrand import uniform import netCDF4 from timeit import Timer import os, sys # create an n1dim by n2dim by n3dim random array. n1dim = 30 n2dim = 15 n3dim = 73 n4dim = 144 ntrials = 10 sys.stdout.write('reading and writing a %s by %s by %s by %s random array ..\n'%(n1dim,n2dim,n3dim,n4dim)) sys.stdout.write('(average of %s trials)\n' % ntrials) lsd = 4 if lsd is not None: array = netCDF4._quantize(uniform(size=(n1dim,n2dim,n3dim,n4dim)),4) else: array = uniform(size=(n1dim,n2dim,n3dim,n4dim)) def write_netcdf(filename,complevel): file = netCDF4.Dataset(filename,'w',format='NETCDF4') file.createDimension('n1', n1dim) file.createDimension('n2', n2dim) file.createDimension('n3', n3dim) file.createDimension('n4', n4dim) foo = file.createVariable('data',\ 'f8',('n1','n2','n3','n4'),zlib=True,shuffle=True,complevel=complevel) foo[:] = array file.close() def read_netcdf(filename): file = netCDF4.Dataset(filename) data = file.variables['data'][:] file.close() for complevel in range(0,10): sys.stdout.write('testing compression with complevel %s...\n' % complevel) # writing. t = Timer("write_netcdf('test.nc',%s)" % complevel,"from __main__ import write_netcdf") sys.stdout.write('writing took %s seconds\n' %\ repr(sum(t.repeat(ntrials,1))/ntrials)) # test reading. t = Timer("read_netcdf('test.nc')","from __main__ import read_netcdf") sys.stdout.write('reading took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) # print out size of resulting files. sys.stdout.write('size of test.nc = %s\n'%repr(os.stat('test.nc').st_size)) netcdf4-python-1.2.2rel/examples/bench_compress3.py000066400000000000000000000034311264125125200223330ustar00rootroot00000000000000# benchmark reads and writes, with and without compression. # tests all four supported file formats. from numpy.random.mtrand import uniform import netCDF4 from timeit import Timer import os, sys # use real data. URL="http://nomad1.ncep.noaa.gov:9090/dods/reanalyses/reanalysis-2/6hr/pgb/pgb" nc = netCDF4.Dataset(URL) # use real 500 hPa geopotential height data. n1dim = 100 n3dim = 73 n4dim = 144 ntrials = 10 sys.stdout.write('reading and writing a %s by %s by %s random array ..\n'%(n1dim,n3dim,n4dim)) sys.stdout.write('(average of %s trials)\n' % ntrials) print nc array = nc.variables['hgtprs'][0:n1dim,5,:,:] print array.min(), array.max(), array.shape, array.dtype def write_netcdf(filename,complevel): file = netCDF4.Dataset(filename,'w',format='NETCDF4') file.createDimension('n1', None) file.createDimension('n3', n3dim) file.createDimension('n4', n4dim) foo = file.createVariable('data',\ 'f4',('n1','n3','n4'),zlib=True,shuffle=True,complevel=complevel) foo[:] = array file.close() def read_netcdf(filename): file = netCDF4.Dataset(filename) data = file.variables['data'][:] file.close() for complevel in range(0,10): sys.stdout.write('testing compression with complevel %s...\n' % complevel) # writing. t = Timer("write_netcdf('test.nc',%s)" % complevel,"from __main__ import write_netcdf") sys.stdout.write('writing took %s seconds\n' %\ repr(sum(t.repeat(ntrials,1))/ntrials)) # test reading. t = Timer("read_netcdf('test.nc')","from __main__ import read_netcdf") sys.stdout.write('reading took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) # print out size of resulting files. sys.stdout.write('size of test.nc = %s\n'%repr(os.stat('test.nc').st_size)) netcdf4-python-1.2.2rel/examples/bench_diskless.py000066400000000000000000000052761264125125200222470ustar00rootroot00000000000000# benchmark reads and writes, with and without compression. # tests all four supported file formats. from numpy.random.mtrand import uniform import netCDF4 from timeit import Timer import os, sys # create an n1dim by n2dim by n3dim random array. n1dim = 30 n2dim = 15 n3dim = 73 n4dim = 144 ntrials = 10 sys.stdout.write('reading and writing a %s by %s by %s by %s random array ..\n'%(n1dim,n2dim,n3dim,n4dim)) array = uniform(size=(n1dim,n2dim,n3dim,n4dim)) def write_netcdf(filename,zlib=False,least_significant_digit=None,format='NETCDF4',closeit=False): file = netCDF4.Dataset(filename,'w',format=format,diskless=True,persist=True) file.createDimension('n1', n1dim) file.createDimension('n2', n2dim) file.createDimension('n3', n3dim) file.createDimension('n4', n4dim) foo = file.createVariable('data',\ 'f8',('n1','n2','n3','n4'),zlib=zlib,least_significant_digit=None) foo.testme="hi I am an attribute" foo.testme1="hi I am an attribute" foo.testme2="hi I am an attribute" foo.testme3="hi I am an attribute" foo.testme4="hi I am an attribute" foo.testme5="hi I am an attribute" foo[:] = array if closeit: file.close() return file def read_netcdf(ncfile): data = ncfile.variables['data'][:] for format in ['NETCDF4','NETCDF3_CLASSIC','NETCDF3_64BIT']: sys.stdout.write('testing file format %s ...\n' % format) # writing, no compression. t = Timer("write_netcdf('test1.nc',closeit=True,format='%s')" % format,"from __main__ import write_netcdf") sys.stdout.write('writing took %s seconds\n' %\ repr(sum(t.repeat(ntrials,1))/ntrials)) # test reading. ncfile = write_netcdf('test1.nc',format=format) t = Timer("read_netcdf(ncfile)","from __main__ import read_netcdf,ncfile") sys.stdout.write('reading took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) # test diskless=True in nc_open format='NETCDF3_CLASSIC' trials=50 sys.stdout.write('test caching of file in memory on open for %s\n' % format) sys.stdout.write('testing file format %s ...\n' % format) write_netcdf('test1.nc',format=format,closeit=True) ncfile = netCDF4.Dataset('test1.nc',diskless=False) t = Timer("read_netcdf(ncfile)","from __main__ import read_netcdf,ncfile") sys.stdout.write('reading (from disk) took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) ncfile.close() ncfile = netCDF4.Dataset('test1.nc',diskless=True) # setting diskless=True should cache the file in memory, # resulting in faster reads. t = Timer("read_netcdf(ncfile)","from __main__ import read_netcdf,ncfile") sys.stdout.write('reading (cached in memory) took %s seconds\n' % repr(sum(t.repeat(ntrials,1))/ntrials)) ncfile.close() netcdf4-python-1.2.2rel/examples/json_att.py000066400000000000000000000012631264125125200211000ustar00rootroot00000000000000from netCDF4 import Dataset import json # example showing how python objects (lists, dicts, None, True) # can be serialized as strings, saved as netCDF attributes, # and then converted back to python objects using json. ds = Dataset('json.nc', 'w') ds.pythonatt1 = json.dumps([u'foo', {u'bar': [u'baz', None, 1.0, 2]}]) ds.pythonatt2 = "true" # converted to bool ds.pythonatt3 = "null" # converted to None print(ds) ds.close() ds = Dataset('json.nc') def convert_json(s): try: a = json.loads(s) return a except: return s x = convert_json(ds.pythonatt1) print(type(x)) print(x) print(convert_json(ds.pythonatt2)) print(convert_json(ds.pythonatt3)) ds.close() netcdf4-python-1.2.2rel/examples/reading_netCDF.ipynb000066400000000000000000001527271264125125200225600ustar00rootroot00000000000000{ "metadata": { "name": "", "signature": "sha256:dd72246b5115e614f58e416dbaf20bdc9b9fd21cd509e3765fca519ab90d3930" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": { "internals": { "slide_helper": "subslide_end", "slide_type": "subslide" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "slide" } }, "source": [ "# Reading netCDF data\n", "- requires [numpy](http://numpy.scipy.org) and netCDF/HDF5 C libraries.\n", "- Github site: https://github.com/Unidata/netcdf4-python\n", "- Online docs: http://unidata.github.io/netcdf4-python/\n", "- Based on Konrad Hinsen's old [Scientific.IO.NetCDF](http://dirac.cnrs-orleans.fr/plone/software/scientificpython/) API, with lots of added netcdf version 4 features.\n", "- Developed by Jeff Whitaker at NOAA, with many contributions from users.\n", "\n", "**Important Note**: To run this notebook, you will need the data files from the github repository (the data is not included in the source tarball release). Please go to https://github.com/Unidata/netcdf4-python and follow the instructions for cloning the repository." ] }, { "cell_type": "markdown", "metadata": { "internals": { "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Interactively exploring a netCDF File\n", "\n", "Let's explore a netCDF file from the *Atlantic Real-Time Ocean Forecast System*\n", "\n", "first, import netcdf4-python and numpy" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import print_function # make sure print behaves the same in 2.7 and 3.x\n", "import netCDF4\n", "import numpy as np" ], "language": "python", "metadata": { "internals": { "frag_number": 2, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 2, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Create a netCDF4.Dataset object\n", "- **`f`** is a `Dataset` object, representing an open netCDF file.\n", "- printing the object gives you summary information, similar to *`ncdump -h`*." ] }, { "cell_type": "code", "collapsed": false, "input": [ "f = netCDF4.Dataset('data/rtofs_glo_3dz_f006_6hrly_reg3.nc')\n", "print(f) " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 4, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "root group (NETCDF4_CLASSIC data model, file format HDF5):\n", " Conventions: CF-1.0\n", " title: HYCOM ATLb2.00\n", " institution: National Centers for Environmental Prediction\n", " source: HYCOM archive file\n", " experiment: 90.9\n", " history: archv2ncdf3z\n", " dimensions(sizes): MT(1), Y(850), X(712), Depth(10)\n", " variables(dimensions): float64 \u001b[4mMT\u001b[0m(MT), float64 \u001b[4mDate\u001b[0m(MT), float32 \u001b[4mDepth\u001b[0m(Depth), int32 \u001b[4mY\u001b[0m(Y), int32 \u001b[4mX\u001b[0m(X), float32 \u001b[4mLatitude\u001b[0m(Y,X), float32 \u001b[4mLongitude\u001b[0m(Y,X), float32 \u001b[4mu\u001b[0m(MT,Depth,Y,X), float32 \u001b[4mv\u001b[0m(MT,Depth,Y,X), float32 \u001b[4mtemperature\u001b[0m(MT,Depth,Y,X), float32 \u001b[4msalinity\u001b[0m(MT,Depth,Y,X)\n", " groups: \n", "\n" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 4, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Access a netCDF variable\n", "- variable objects stored by name in **`variables`** dict.\n", "- print the variable yields summary info (including all the attributes).\n", "- no actual data read yet (just have a reference to the variable object with metadata)." ] }, { "cell_type": "code", "collapsed": false, "input": [ "print(f.variables.keys()) # get all variable names\n", "temp = f.variables['temperature'] # temperature variable\n", "print(temp) " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 6, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[u'MT', u'Date', u'Depth', u'Y', u'X', u'Latitude', u'Longitude', u'u', u'v', u'temperature', u'salinity']\n", "\n", "float32 temperature(MT, Depth, Y, X)\n", " coordinates: Longitude Latitude Date\n", " standard_name: sea_water_potential_temperature\n", " units: degC\n", " _FillValue: 1.26765e+30\n", " valid_range: [ -5.07860279 11.14989948]\n", " long_name: temp [90.9H]\n", "unlimited dimensions: MT\n", "current shape = (1, 10, 850, 712)\n", "filling on\n" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 6, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## List the Dimensions\n", "\n", "- All variables in a netCDF file have an associated shape, specified by a list of dimensions.\n", "- Let's list all the dimensions in this netCDF file.\n", "- Note that the **`MT`** dimension is special (*`unlimited`*), which means it can be appended to." ] }, { "cell_type": "code", "collapsed": false, "input": [ "for d in f.dimensions.items():\n", " print(d)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 8 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(u'MT', (unlimited): name = 'MT', size = 1\n", ")\n", "(u'Y', : name = 'Y', size = 850\n", ")\n", "(u'X', : name = 'X', size = 712\n", ")\n", "(u'Depth', : name = 'Depth', size = 10\n", ")\n" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 9 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "Each variable has a **`dimensions`** and a **`shape`** attribute." ] }, { "cell_type": "code", "collapsed": false, "input": [ "temp.dimensions" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 10 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 5, "text": [ "(u'MT', u'Depth', u'Y', u'X')" ] } ], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "temp.shape" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 11, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "(1, 10, 850, 712)" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 11, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "### Each dimension typically has a variable associated with it (called a *coordinate* variable).\n", "- *Coordinate variables* are 1D variables that have the same name as dimensions.\n", "- Coordinate variables and *auxiliary coordinate variables* (named by the *coordinates* attribute) locate values in time and space." ] }, { "cell_type": "code", "collapsed": false, "input": [ "mt = f.variables['MT']\n", "depth = f.variables['Depth']\n", "x,y = f.variables['X'], f.variables['Y']\n", "print(mt)\n", "print(x) " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 13, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "float64 MT(MT)\n", " long_name: time\n", " units: days since 1900-12-31 00:00:00\n", " calendar: standard\n", " axis: T\n", "unlimited dimensions: MT\n", "current shape = (1,)\n", "filling on, default _FillValue of 9.96920996839e+36 used\n", "\n", "\n", "int32 X(X)\n", " point_spacing: even\n", " axis: X\n", "unlimited dimensions: \n", "current shape = (712,)\n", "filling on, default _FillValue of -2147483647 used\n", "\n" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 13, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Accessing data from a netCDF variable object\n", "\n", "- netCDF variables objects behave much like numpy arrays.\n", "- slicing a netCDF variable object returns a numpy array with the data.\n", "- Boolean array and integer sequence indexing behaves differently for netCDF variables than for numpy arrays. Only 1-d boolean arrays and integer sequences are allowed, and these indices work independently along each dimension (similar to the way vector subscripts work in fortran)." ] }, { "cell_type": "code", "collapsed": false, "input": [ "time = mt[:] # Reads the netCDF variable MT, array of one element\n", "print(time) " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 15 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[ 41023.25]\n" ] } ], "prompt_number": 8 }, { "cell_type": "code", "collapsed": false, "input": [ "dpth = depth[:] # examine depth array\n", "print(dpth) " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 16 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[ 0. 100. 200. 400. 700. 1000. 2000. 3000. 4000. 5000.]\n" ] } ], "prompt_number": 9 }, { "cell_type": "code", "collapsed": false, "input": [ "xx,yy = x[:],y[:]\n", "print('shape of temp variable: %s' % repr(temp.shape))\n", "tempslice = temp[0, dpth > 400, yy > yy.max()/2, xx > xx.max()/2]\n", "print('shape of temp slice: %s' % repr(tempslice.shape))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 17, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "shape of temp variable: (1, 10, 850, 712)\n", "shape of temp slice: (6, 425, 356)" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n" ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 17, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## What is the sea surface temperature and salinity at 50N, 140W?\n", "### Finding the latitude and longitude indices of 50N, 140W\n", "\n", "- The `X` and `Y` dimensions don't look like longitudes and latitudes\n", "- Use the auxilary coordinate variables named in the `coordinates` variable attribute, `Latitude` and `Longitude`" ] }, { "cell_type": "code", "collapsed": false, "input": [ "lat, lon = f.variables['Latitude'], f.variables['Longitude']\n", "print(lat)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 19 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "float32 Latitude(Y, X)\n", " standard_name: latitude\n", " units: degrees_north\n", "unlimited dimensions: \n", "current shape = (850, 712)\n", "filling on, default _FillValue of 9.96920996839e+36 used\n", "\n" ] } ], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 20, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "source": [ "Aha! So we need to find array indices `iy` and `ix` such that `Latitude[iy, ix]` is close to 50.0 and `Longitude[iy, ix]` is close to -140.0 ..." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# extract lat/lon values (in degrees) to numpy arrays\n", "latvals = lat[:]; lonvals = lon[:] \n", "# a function to find the index of the point closest pt\n", "# (in squared distance) to give lat/lon value.\n", "def getclosest_ij(lats,lons,latpt,lonpt):\n", " # find squared distance of every point on grid\n", " dist_sq = (lats-latpt)**2 + (lons-lonpt)**2 \n", " # 1D index of minimum dist_sq element\n", " minindex_flattened = dist_sq.argmin() \n", " # Get 2D index for latvals and lonvals arrays from 1D index\n", " return np.unravel_index(minindex_flattened, lats.shape)\n", "iy_min, ix_min = getclosest_ij(latvals, lonvals, 50., -140)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 20, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "outputs": [], "prompt_number": 12 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 22 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "### Now we have all the information we need to find our answer.\n" ] }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 23 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "```\n", "|----------+--------|\n", "| Variable | Index |\n", "|----------+--------|\n", "| MT | 0 |\n", "| Depth | 0 |\n", "| Y | iy_min |\n", "| X | ix_min |\n", "|----------+--------|\n", "```" ] }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 24 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "### What is the sea surface temperature and salinity at the specified point?" ] }, { "cell_type": "code", "collapsed": false, "input": [ "sal = f.variables['salinity']\n", "# Read values out of the netCDF file for temperature and salinity\n", "print('%7.4f %s' % (temp[0,0,iy_min,ix_min], temp.units))\n", "print('%7.4f %s' % (sal[0,0,iy_min,ix_min], sal.units))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 25, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " 6.4631 degC\n", "32.6572 psu\n" ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 25, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Remote data access via openDAP\n", "\n", "- Remote data can be accessed seamlessly with the netcdf4-python API\n", "- Access happens via the DAP protocol and DAP servers, such as TDS.\n", "- many formats supported, like GRIB, are supported \"under the hood\"." ] }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 27 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "The following example showcases some nice netCDF features:\n", "\n", "1. We are seamlessly accessing **remote** data, from a TDS server.\n", "2. We are seamlessly accessing **GRIB2** data, as if it were netCDF data.\n", "3. We are generating **metadata** on-the-fly." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import datetime\n", "date = datetime.datetime.now()\n", "# build URL for latest synoptic analysis time\n", "URL = 'http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/GFS_Global_0p5deg_%04i%02i%02i_%02i%02i.grib2/GC' %\\\n", "(date.year,date.month,date.day,6*(date.hour//6),0)\n", "# keep moving back 6 hours until a valid URL found\n", "validURL = False; ncount = 0\n", "while (not validURL and ncount < 10):\n", " print(URL)\n", " try:\n", " gfs = netCDF4.Dataset(URL)\n", " validURL = True\n", " except RuntimeError:\n", " date -= datetime.timedelta(hours=6)\n", " ncount += 1 " ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 28, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/GFS/Global_0p5deg/GFS_Global_0p5deg_20150310_1200.grib2/GC\n" ] } ], "prompt_number": 14 }, { "cell_type": "code", "collapsed": false, "input": [ "# Look at metadata for a specific variable\n", "# gfs.variables.keys() will show all available variables.\n", "sfctmp = gfs.variables['Temperature_surface']\n", "# get info about sfctmp\n", "print(sfctmp)\n", "# print coord vars associated with this variable\n", "for dname in sfctmp.dimensions: \n", " print(gfs.variables[dname])" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 28, "slide_helper": "subslide_end", "slide_type": "subslide" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "slide" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "float32 Temperature_surface(time1, lat, lon)\n", " long_name: Temperature @ Ground or water surface\n", " units: K\n", " missing_value: nan\n", " abbreviation: TMP\n", " coordinates: time1 \n", " Grib_Variable_Id: VAR_0-0-0_L1\n", " Grib2_Parameter: [0 0 0]\n", " Grib2_Parameter_Discipline: Meteorological products\n", " Grib2_Parameter_Category: Temperature\n", " Grib2_Parameter_Name: Temperature\n", " Grib2_Level_Type: Ground or water surface\n", " Grib2_Generating_Process_Type: Forecast\n", "unlimited dimensions: \n", "current shape = (93, 361, 720)\n", "filling off\n", "\n", "\n", "float64 time1(time1)\n", " units: Hour since 2015-03-10T12:00:00Z\n", " standard_name: time\n", " long_name: GRIB forecast or observation time\n", " calendar: proleptic_gregorian\n", " _CoordinateAxisType: Time\n", "unlimited dimensions: \n", "current shape = (93,)\n", "filling off\n", "\n", "\n", "float32 lat(lat)\n", " units: degrees_north\n", " _CoordinateAxisType: Lat\n", "unlimited dimensions: \n", "current shape = (361,)\n", "filling off\n", "\n", "\n", "float32 lon(lon)\n", " units: degrees_east\n", " _CoordinateAxisType: Lon\n", "unlimited dimensions: \n", "current shape = (720,)\n", "filling off\n", "\n" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 28, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "##Missing values\n", "- when `data == var.missing_value` somewhere, a masked array is returned.\n", "- illustrate with soil moisture data (only defined over land)\n", "- white areas on plot are masked values over water." ] }, { "cell_type": "code", "collapsed": false, "input": [ "soilmvar = gfs.variables['Volumetric_Soil_Moisture_Content_depth_below_surface_layer']\n", "# flip the data in latitude so North Hemisphere is up on the plot\n", "soilm = soilmvar[0,0,::-1,:] \n", "print('shape=%s, type=%s, missing_value=%s' % \\\n", " (soilm.shape, type(soilm), soilmvar.missing_value))\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "cs = plt.contourf(soilm)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 31 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "shape=(361, 720), type=, missing_value=nan\n" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD7CAYAAAB37B+tAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+sZVd13z8L228SIGPzgNjGdjpWwSlueAFUm7Qk4iVN\njJFaTNsImFFbVNIoamJAFLczHhd7MIEyyKFRMyJqA0ROxJtCSKC4isF2wlMTVZgQsAfHuGCFkTIU\njx0PeEhRZ2y8+sc9+71999v7nH1+3XvOvesjPb17z899z9n7e9ZZe+21RVUxDMMwxssz5l0AwzAM\nox0m5IZhGCPHhNwwDGPkmJAbhmGMHBNywzCMkWNCbhiGMXLOncdJRcRiHg3DMBqgqhIuK7XIReQH\nROReEblPRB4QkUPF8kMickJEvlz8vcbb50YR+bqIPCQi15QUZnR/t9xyy9zLYGUfz99Yyz3mso+1\n3LllT1Fqkavq/xORn1bV74nIucCfisidgAIfUNUPBMJ/JfAG4ErgEuAeEblCVZ8uO49hGIbRnEof\nuap+r/i4ApzHRMQBdpj3wHXAUVV9UlWPAw8DV3dQTsMwDCNBpZCLyDNE5D7gJHCXqn6hWPUWEblf\nRD4sIhcUy14AnPB2P8HEMl8I1tfX512ExljZZ89Yyw3jLftYyw3tyi5lfpepDUXOBz4JvAV4rPgD\neDdwsar+goj8BvB5Vf1osc+HgD9U1T8IjqW55zUMwzAmiAga6ezMjlpR1SdE5HPAtar6a96BPwTc\nUXz9JnCZt9ulxbIdHDp0aOvz+vr6qJ+khmEYfbC5ucnm5mbldqUWuYg8D3hKVb8jIj8IfBZ4H/Al\nVX2k2ObtwFWquq/o7Nxg4he/BLgHeGFofptFbhjGmNh16vTW5zOru5PL+qapRX4xcLuInMPEn/4x\nVf1DEfkdEXkpk47PbwC/BKCqD4rIx4EHgaeAXzbFNgwjhi+EbehCRKuEOtzWP+f+1cPcXHw+fGr/\nzETdJ9tH3ulJzSI3jKWjK+EO8YUzdY5QXEPhzi3b/tXD3HrDe+G2bf06JtsG8lrPupayyE3IDcPo\nhFAMy8SzLVVWcw6Pnf/85Lrbzrlh6vsN379t6/Pxc89WHntNldPf3wXA7nPOTK0LLfo6mJAvEa5y\nz+MVz1hO6lrCqeWPnf98du/fFsrTh1d4/hOPbX1PHu+950fPf/rwSrLMOYLcJV1Y6wsj5OFrjP/d\nX77MxF4bTdSNvimzjs9ev7P+rRzZuf2fPXdakKva8s3cBMDPy3tzijg3utKk1uGH88IJdepCXPX4\nE4BZnz7htfBfQ+06GWWUWcypurPr1GnOXr8b3cjzNfsCvn/1MDAtxGFbl33T+5157/kcKwKgf77y\nbMvBaCzypOV9Q7H8tuW2wg2jLbLPE8saD3wntAC6Ub5tKPShBQ5xIQ+td1/Mh0zX3oHRu1ZCIV92\n90kTog3CLHSjoI4g1z1uzI0C9VwpOQ+BoXHV40902sZG61pxmHDnsf2au/0dtn2Uoa9SiDcyE/jF\nRPZNi7QvjitH8u971WCYsB7GeOz853Pc+17VxsMwwU/oQW74/m0z77TMZe0dMxwoNBaLfOjMs9M1\nNwQr1uHkmKWYm69+OJSFDIai71PlhvGte5iuXznulLbE2uM8mJVrZTQW+ZCZh9unKkIg9SqbWj5L\nTMRnjxPWUJjL7kWVe2XLMMhww7htV46cZs9TK1Mhhn0QnmNe/vRjIjPRA7PIWzLLUV0+dazwHPE2\ncV1MyizjKtdH2/N1fewmuHYyL3/62jvoNBBj9J2dg+MGmXrK9yXiXQt2F8SGRNuDYJiEQp6izIWS\n2iZ0vVRtm6LPDvh5CLk/vsWiVgbO6e/v4vi5Zxs9cWN+SV8Q+8pJ0Sfu1bmOFVb1O/uwGJeJlHjq\nRnpdaLGH+6WOX3afch8m7tz7Vw/z8/LebkZCFr78WLx6H+x5anskah/GTUrIK2cIMuKEuRhyKRPx\n2Hp/uzEQNlr/e26DdszDn7/r1OlRPkhj6MZOga367ov3ypHTW39lx3fHkH3bf2VlSuHO7ec1uZmb\ntkZvtuFW3sPhU/v5hB7kE3qw9fFirKlOpROYJQtjkc9FAG8QTh9e2ZEUJ8WiCEQOoSB0dawYXVrt\nXbqKUve7ydtL1/idnzHhDe+Zfw9i5Q6Pkdqm7G3A8c6Nm7YyDG65KN4Buw4+0egtLfa228eAIvcG\n0ae7caFdK2UCOSRLNlbOsbpSZkmVkEO+KJaF1HVFm/vphKpuOV3cdt2RmbGyuuOkrntTIU9tG8P9\nDj9DYVOXRSisfYq5c630pTsLJeRDSkgfo+ztwES7GVVinrL6Q0syzNsR0qZOdHlv/XC9soRTbeqU\n2zfnQZl6QIRhjWV++XCfcHnZ/v79anKP3NiFMFti10L+CT3Y6+QSCyHkfYpgTrrNXacmnSaHT+3v\n/Nwm8DvJERifmDj7gtjk3LlWcZllW3WOsg7GcH0fpETHH/STuh51o2LaWu5NBd2/P64ztQvW3gE3\n33aQW3lPJ8erYvRCPiuhi2UKDCuBoytBNyHfSa6Iz6JDtI2bYoyE/Rs5I4Jz3V9VQp6y8Mvuc879\n8e9N21DEeaYLGa2Qdz2rSK4/PSXeVRw+tX9r+64t97EQs0TrxLlXWaVtOlKbWug+qdwibt3YBb3u\nm1AbcizyLga0+ffksfOfXzs/y56ntieoyA1u6AMTco+yhhijjpD7+KLuvlex7A+BMdDnFGZ9kTOv\nJfQv4itH8vPslGVN3NFxWUPIoZ5VvqbaKD+QO2dMP5r60Rc610qfDauJiLcRYRPwtPXehTUdw/V7\nuP9lb2a5vtA++lLakNsmyq57W3QDdp1Ki2+YiKvL1BLhm9JVjz9RKuah+6SJ6DrtuPWGiT/edaxO\nBhHCzdCZb33QA4LqCLIbyJGzj79d7j65jTLcbkiNeUyk3Ct9+cSdSMdmV6pqxG4b/88/bo4x0PSt\nbxb4A4Nyr3/OtqmO0pwHRxcDt/oaGORwIn3s1+LRMV12kJYKuYj8gIjcKyL3icgDInKoWL4qIneL\nyNdE5C4RucDb50YR+bqIPCQi19QtUJ0b5BpN0xvqv/qEDS72PSXKZWLdVwMdcsPPJdVg+xTsppxZ\n3V274YX1p4xZP/D7qD+h2J9Z3b1j9KfDrfPRjenlOQ/ROsxjTMmtvGdigTPxs6+pwm3aeZRLpY9c\nRJ6pqt8TkXOBPwXeBvwz4K9V9f0ish94jqoeEJErmSS1vAq4BLgHuEJVnw6OucNHXkeMYxMntCGs\n1KFvO1wX2ye2Tdnx27IsvvS6vzPXpRG7f20aV9Uw8lSZ2tzHoblvQtoO3Imta3sO/1ixMMSusxV2\nTWMfuap+r/i4ApwHKPBa4FXF8tuBTeAAcB1wVFWfBI6LyMPA1cDny87RVMSbcvb63bxzI93wykQ6\n9zW5TgOremiUbbfogt5ElKs6mP31XVhGOblAwvuUuudlZe9LuGNhtl0dswmxfERdW+ap33r68ArD\nGQueT45F/gzgS8DfBo6o6o0i8m1VfU6xXoBTqvocEfkN4POq+tFi3YeAO1X194NjTlnkdWe4CYU8\nN6eFa3BVFndXr505Qpxzvtxtlg2/cd/MTVuinGMdd/2anZvYKRTyW3nPVkREWD+7vKept8I+wiWb\nXtuqcnR9z9z5/HDEPU/l506aB42zH6rq06r6UuBS4BUi8mPBemVipScPUbewMXx/as5osjDyYNep\n01lukS59h6HvvU7DrNr28Kn9U9vE/PyxsgydVDnDZWGjvpX3JDPlucx3qX37ouweunW+ePnl7ErE\nq+rEUER8HjhLf/c5Z7ayIg5ZxMuoFUcuIu8Evgf8IrCuqo+IyMXA51T174jIAQBVfV+x/WeAW1T1\n3uA4esstt2x9X19f59VrL4+eMxz8UTdeNGSeYtaltd+2HFXMy/8aPvRir/2xOuAL+KyGS6fwLWvY\nvpbO+m3j13Wk7k9O/cq5r00t9T5z1eSk0Vg0Njc32dzc3Pr+rne9q/6AIBF5HvCUqn5HRH4Q+Czw\nPmAdeFxVDxfifUHQ2Xk1252dLwx7Nqs6O50fPEzoU5XZLafi5foqc6z3ugxFyKG6Mc/K914nNjtF\naIUPTcgdsTj1OsRGG+fexxh93tsuHlZlxy6bNHpRiD2oGo3sFJGXMOnMPIeJG+ZjqvqrIrIKfBz4\nEeA48HpV/U6xz0HgzcBTwNtU9bOR49Ya2Vk1U0mY2ayKsEOpju96Vv71vklZc2GKgb4t8zYNMOWX\nnreQh1S9TbQ5Xgr/vtXtgym737ntrC8/eR/nHCruWvgBHqMaou8nzgmFPLejs4zcjsOmozqHKuZV\nwtx0XRO6aHRjEPK+X/9v5qbGLpYqYsdt4nJpmqWwLosk5Kk3jtEIeWi9VGVLa3rjY9anvy61rEtm\nLfpVscxl23RN20YXCljXIYVdMCsfbllOD2hez/pI11yFCfk2sTe50Qh5mG+hqjHUufEpge5bsGOk\nzhlzbXR5znkPIumqsTkhD3/PojXmKppm6cyhr3pSdo/aRtEs0v2PWeWjEXLYmZM4tg7qJ0+q8o3P\n0kKuM1JxFuedVfrVLoXcEUa4LCtdTFKcom9Rn1WW06ETWuHhdTn73POHn/1wu9Dpm7tyJP94YRa9\nNj38dehjCH5V9EHbss8qFWsf0QZdRL4sAn1HYvWRaqJPmoZ6zos2c/oOJvuhX9g6lvbZ63dv/aXW\nxxhqhyR011HVpKHNclIBR2ogTxXu95mI16NpXpfYsq6EckyCO0tyDaxBCLns2ykgsRlmckWmzrZD\nxIlwrgUVWu9+Q617rD4oO2fTNwEn3ibi2zgxnGWn9s3cxJnV3Y3rVZ9vgkM21rpmrj7yMCKlyhJP\niX3ujOM+fUWhtKWOS6Wrc6amZoPZTPzrrPG6ojy2V+dZEBsBGpIaqJTbJurEnVfR98CzRagfU5Ng\nJ3zkcxPylcefyNo2FWVRZsHnzg/ZV6xtF5QN6Gh6zqq5NHNmfW8q7OHv8Tsomwq5EadKzMtCbeuO\nsSiLviqjT3+7E28/kdqisHBTvZUJSq7YtB34k0vsYVQnXWmZtZRrObvtQuH2ybluTS31ebp2lhV3\nr8P6UxaCmmuZx/ZvKsZN9quytPuM4Bkig/CRl+EqVp8CkNMxWLeyhdkI/f9N3CV1zu93AMf6C5r0\nIXQVXZL6vmiW0zxxWf10Y3Kvz6zu3mEYhIT1tGy73D6bMpqO3XC/LbeDvGlH+hAp608YvGsF6vvR\nYom2+qTtQ6aqc6rKYod6bo8yq7qJ+yRnn5Svtk1GQKOacMBQmYiXta9cV0jqQZCKF2/jjkk9/FOp\njMfI6OLI6yT5qcJ1es5z3semvyUV5uUfN3z9ffe+92T7uSHfhVLlL2+La9wm4rOhKlFamag2HasQ\nxkGH39uMgUj5wP1lY7fGcwdMDdIir8q+V2Zxu+1DX7BuTI8KbTLnZzhZRaoCullfYr8nXBbbx+8A\nDKnKCVOHssmPm+yb2i92ncZqIY2NWP3220ZstHNOfcqp01UJ2MreOGPERH+Z6tGuU6eTFvlcfeQ5\nvtpYZXCVMCYc/vbu+E60m8716fyMTYn54MNlLsvj2evTI7ncA8pdM3eM8DqGn7vwkYf7Vy0vO/4y\nNb4h0sQNFuK/cab85mWCnGpPda1z5wOf1cjkeVKmQXN1rfgVyn86h2Ls0tmm9i07djoyI39wkf8A\niL0Wtsn1kWP9+Nv4sfIxgfa3CUMy+8Y/X+r+xER8EcPEFoWqCBe3jb8s1qnt94eAGwNQDOparTcp\nDJA9P+siUTbF5WB85CkmgrC7cVKn0Arv2h8bq+RNrYNs18TG9v+Y2ykl9E3IfSCk4vjDRn7ravw8\nJubDIhVhVGZ4pEQctn3j4XGcEO8P6kVoJPn7+X5j/2Gw6KwcOc3Zo/F1c/WRhxZkyvKFaad/rh/P\n36+K8MkeeyuA6VFWMcpGmbZ5pS0biFFWjrbUFfEyqubaBHO7dE0XswnVHTORIhR6N2F2atvwuMtQ\nN6ru1yBHdobiHVI2RVYf002lEvTHfHruNaeO+yJ0JaU6b2KVO2d0qzvHLPPMlIl43YfoMjTUWRPO\nhds0TNSnzEApE/KwbudGl5T51BeNpkI+t87OHLEJo0TKhL2qk8Tt7/5S/qaYrz517BxLtEzoY8eN\nTdzrd2hWdVSWXtejxyrLG7Jy5HTyd3Yh4jBp0Cbi/dMmvQK07ySPiXXVgJ2+UmAMnVgAQ9m1H+zE\nEmVTuuXGVub41ctyTYSVaGo268gEF3VC8srK4MhqNE6c967lbZuxXdnvCbdJUWdar2WxtuZBKvwQ\n4v0aYeivwxkTKfpITLdMlrjDn3AZIm/YR0eSa2XyQ3bevCpRjrleUtuHlRb6m7ey7HW2Kn/KFKE1\n7QQ5IcxtXCxVr+CTKKLpZX5kQh0m18Cs8XmT+3ZZp061GewD9oCH/L6uwQl5U3KGeTcRthy/Yu5x\nczozp5++CVdIhVUdi7M/e/3uPKvd3z6Ce1Py+zfaxPCWRbIY7akb7VU1iCdFqp3ELPsy/DeCZasX\nk7f8Zg+vUiEXkcuA3wF+GFDgv6rqfxaRQ8C/Bh4rNj2oqncW+9wIvBn4PvBWVb2rToHOrO7eDq+L\nrQu+1xWR2NRvfiU8s7obVrdnaH/nxk3RyuePFG1j/YbHrjzW3rW0371wncQaVY67pArf3RW6vtzv\nsLwpw8fVsXCEtBNRP+VDV1TlcXHr24zJGD2Zrs8YpT5yEbkIuEhV7xORZwN/DrwOeD3wXVX9QLD9\nlUxk+CrgEuAe4ApVfTrYrtRHHiMlEKkO0KZWYll4X27kTI6vvMpK2TpG4AOvyieeOl9V+XKJRRk1\nmYfT/OOzZUfypUjkSVVu8jI/eZfCv8x1omzQD5D0kZdGrajqI6p6X/H5b4CvMhFogB0HA64Djqrq\nk6p6HHgYuDp27DCKJPaXQyrxUpPKcPb63VPRKmGlDcuX8rHXtYZjLpetaJG9a6w8vicZPZIaTZkT\nClkWkZJC9u2sbC61qL9Nijr31ugO3wLfv3o46QapSncbY57J6RYN3UinEikL1c72kYvIHuBlwOeB\nVwJvEZF/CXwReIeqfgd4QbHecYJt4W9FmTCn1pXt4wb25OQN8UmlEijLCRN+r9MBVGaB52wf0kWM\neVXOmtR6E/D54btTDh8pj0CJkbLGTcT7oW5eqKzww8Ktsgn8qqp+SkR+mG3/+LuBi1X1F0TkN4DP\nq+pHi/0+BPyhqv5BcDxl7/R5Y4LVNMlVDpWvMAG5YYS5mdzKqDP4pwltxTx2X/wRr1UuMMcyv0LP\ng6o6H6ZCrkrP0JeIW70oMTQTrpVKIReR84D/Adypqr8eWb8HuENVXyIiBwBU9X3Fus8At6jqvcE+\nyo/dsr3gh9fhwvUd5+5TyF22wa6oG0dbJfhhigD/PCmrvMsImzJy70vYr2EdofMlV8gdbcYRNMXq\nx4Ste3VyEx7d3F7xwLvq+8hFRIAPAw/6Ii4iF3ub/RPgK8XnTwNvFJEVEbkceBHwhejBX3IIHvin\nk/8REZ/6MR0zxFd8v9fe99HndmD666veApr4xn1y70sX/RZGd5T5X6F+fTP6YWqw4e+9fKKR7i+1\nT0XUyk8C/xM4xiT8EOAgsBd4abHsG8AvqerJYp+DTMIPnwLepqqfjRxX4f7tUBs/XjoRfpOqgLHJ\nIqoIR09V0SQdbK5lnJoYI3W+No2rzGLP+V3hRB3GuMl5INeNiKqLf9xlr1MiGeGHTV0rfVAq5JAt\n5jsq4tFjqFbHYTa19H23hv+/bHvIT6YVE9pUeGHqGFA9eCNGnYRfZlkvBrlC3mfIoRkF22Sl/Rj8\nEP2UqHtUWt9719JPtTo5STIIR0/GKnuu9Z6yzsNlqTeD0KXSJMVt2GDLGqn5upeHsrTMTY/XxeC0\nRSYt4mltnOtUbxw9Fi9cRpa+Umsitn9uUqkS3IVtmwWu6vg+MX93leDGpt7yy5wKi2waW26Mk7KR\nuiFdGCpGHjv0JaWTHsOxyB1NLOaqh0HZMcNhsYlhsv7EEo6+xLyukLp9yibCNYwY4aTkbYlGKW3A\nVg6R4nNfgQxjJXk9MlNPz9dHnksH1nRjinPHZgjKyv2dKrt7YFTkV6jTOemGWYeC/u595dkFm1jg\n5lpZHOqIapULrk69cOdddh95tojvXRugj7zMj12XGvupFn50V4ZUR2uwXGS7I7UzSzyj3KlGkxLf\n0D+e8peb+8QICRPBQXqC7xB7sDcjFrCRZLA+8hxyrPGK3Nw+viA3KUdVLO4Owosf+rv8B0eGjz72\nF9vOMLIp6p0/oUtZB3zXLLWbxbX5jPZfxvxcK26Ifk7hQ4Euc0dkHG/KKvfPUbZv4GIJiVbGo4Hl\nX/YGMGPaNFCzvhYTX8hzXIhtQ1KbjAFZJLZ+fy0B//FhzdlZ6wnkto35ncN1meywyssENiM0svOK\n2PIJXUVfkTfGeAmjWPquH8so3o6u30KGF7WSQ0rgcnt4m7pXIvs6y151bWfF3Fib+rzj5pVZ41Vv\nCHPCTeZhVvliEpsvt8sOzpBlFvMuGUfUSg84MU52fIZWf+bx6jAU32COmyWc2s2EfDkI62isrlhd\nqMcOt24t4q6VcVrkHRL1lzfAt8yztp2Tbzykrogby40l1eqQDJdtLktrkUNglde0wHOOW0ZOStEd\n071BcrBSH/nVwawtI123yvLPG3GmjMZGmjO0zs4FpZaLJXLz3BD5qo4mFwa5ZSn7x6rZURpLNxtO\n32YsL6m3sdzO0Nj0gEZAyzf0pRbyqEtlVh2MifNEE+Vk3OToA6SBmJt4GyG7TpXPF1uW37+ugDvR\nX0rhbyHmSy3kDtW1TsL96ljjqmvJ7afEPBJDn+WvzqwUvnCbiBsxZjk4aNGZavO+5rTUHxPygqbh\niK3PmyPK3g0uK+fWscIcLkEFiTXIpbWCjEpSMeX+6OJY3WlSn0KXoauXu06dtvpZwnIL+d5IbHdD\nen0Q1H3lCv3lOa6ZGqkHTPSXj6oBQitHTrPr1PSfbzC0jXpa6MFrHbhzlz780Ed1rdGw2VlZ8znn\n0Q2Qo8UX77Vt5fE9wM685LEBIIYRw68ns3qQW93MY7kt8oKpStl2qH9LUhM75J4nmkMmEea00FaO\n0SuhwKZSPphffTYst5C3eKUp66xsgp+gKGwQTaySZPk8UXcPjTrWleWQNhw73HFHj3FmNS7ovstl\nmd1yXQw+jLHcQu6RW7m6FnAoF8W6gpkqX+wB0SRxlgm4EbLVQenVO39axFTnutEdy+0jDzoBZV/5\nkP15Rba0wR9cVDbQyHzlRle4kca+mIdMxN1ce11RapGLyGUi8jkR+QsReUBE3losXxWRu0XkayJy\nl4hc4O1zo4h8XUQeEpFruijkvAW0Dys8pC9/tX/cuhO6pjDBN6rYcrv4cdJkTpNo1KbKtfIk8HZV\n/bvATwC/IiIvBg4Ad6vqFcAfFd8RkSuBNwBXAtcCHxSR1u6bvvxK0XP5ye5nIOA+fXQMxVKSAjs7\nQQ2jB1x6ZzfozgS8H0pFVlUfUdX7is9/A3wVuAR4LXB7sdntwOuKz9cBR1X1SVU9DjwMXN1DuesT\nTgdXImIpARc51ttDJRan26Xl6yyklM/SMGbFypHT+WMWZmjEzYIdulLHmCrZNttaFpE9wMuAe4EL\nVfVkseokcGHx+QXACW+3E0yEfxhkzu0ZVp5ZDoBJhR92RWpgh7lLjL6p+3Yr+9gatLdIOVgai3mJ\nKzSrs1NEng38PvA2Vf2uyHYWRVXVSVraJP3kyc1NAVnnieeNgmwTW94U3YBdp7r3H4YiHaa9NRE3\nZsnZ63ez60h6cpIqsXZJuvx2Mro63HIim5BKIReR85iI+O+q6qeKxSdF5CJVfURELgYeLZZ/E7jM\n2/3SYlmE3/Q+/z3gqnold1Tk6q5FxsWcVadnVxVT9jFJtBWU24n56BqAMWqmIloa1r1UnDqMJ/Gb\nboCQ0BJf5H/mFPzxxyqPVxW1IsCHgQdV9de9VZ8G3lR8fhPwKW/5G0VkRUQuB14EfCF+9H+z/bf3\nF/JFOLXdAnbcdfYqmbg2XYj4Ir3yGrMhlhDLfQ9ztNR1M46pHma1vwvXYe9vsq2Xcap85K8E/jnw\n0yLy5eLvWuB9wM+JyNeAnym+o6oPAh8HHgTuBH5Zq6Ygis1WX7VtnX0iNPVDzyKCpU7yqtzj9Yl1\nnBpN8Ov52eceB2gs4GFI45jEPGRLm2pGlc1vqre9sz+vo3IGnjm5VULG8LpoQ/aNriiboKIqj0sY\njTXkNhNS68FzVAY41dusZuMJGFMsa1dldXkumu47ZivHGAc54uss1iqLvWldnweduDjnZZH75w17\noWOjv6qGmucORU9S8VCZ9+jStvjXuE7F8RtE3X0Noy4xAQ51IEbOLEZDt9Jj0TgQ6OEgLfIC/wKX\nJbBPCbz/ubHPdsE6S8NMc02m6xqTVWMsLjlWeM6k5UOvz6EOuj83EXqZETWYpFlnVqfDkXyfV5V/\nrJcOt8Q0aWNjkqa2/mjOsNKbNW4MmTCnUKq+7zqVjl8fAqEO5jII10qMslessJMjXBbbJ4tYTHok\nBnss+NfwzOpudp06nSXIsWs/5MpvLAZtLebct84x12WRAbtWmpIj0lmWaEkmwLGKOExXWCfiVRNJ\npBrT0F9LDWOZGY1FXiXaZYJdKfiRGefHLOAhOR2WOULtHgxlYZFDf3U1hkmq/u1fPQzA4VP7Oz3f\nWOvoqCzy2E11Qu13evifuwwpXCQRD7EBPMaYOHxqv4l4BoMU8ipinRk5PvKkb3jBIlb6wK/8rhe9\najswl4xRzazrSJsxFUNldEJe1/KuG5K4iNZ4jrjmWin+JLpVOF/8ojUaYzFYJEEfjZDnRKdUiXzl\n6MSRhxrWYV6jNes8CAxjFixCfRxMHLmPC5WLUTahaytGHGaYQ9k19Yk9MMNOTn9ZGS6/erivYwy5\nZIz+ya2bfROWYUz1crAWeXgRe+mk8yzwRRbxFOE1daPH3GiyFF1X8EWwiIzmDDWPz5jq5GCFHLqz\nupPHWbIixqpeAAARF0lEQVROzroCHHZqlnVy5h6jjDE1HKMbZF/D3Eg94pdlLHVy0EKeijKJhR+W\nYSF327S1pptaT7mCnnLBjKVBGc0Ychsd6huDz6CFHNKZwEKaVAS3z7LlEHGC2kTU216rJmI+Jl+l\nUY+yJHmzJhVQsXLk9NyCA3IZvJD7hBc4vPBNZhWBcTxxu8bvwPQzJc7C+m0izCbmC8xAosWG/FZQ\nxSCjVqpo8gQf802aFbO6RuYmMXxU16ZyAbWlq+OMicFb5HVe5esK/FBe6eaJ813P0uJNXfcwyZex\nPHTZFnNEPGfcidtuDAxeyGO0mkAiOI6xTRNRbyK4frL8WBnaHNsYJ7Pup0q5aVPfh84oXSs+vp/c\nhHl8pMTcRNzom5iY+6GQ4f8hB0WM0iKH7p6Y7mYuY4dnF/Tlkpm1u8cYBvO2hJtMiTgEKoVcRD4i\nIidF5CveskMickJEvlz8vcZbd6OIfF1EHhKRa/oqeJeYNW8Y88dZvLMW85wQ5yFb45Bnkf82cG2w\nTIEPqOrLir87AUTkSuANwJXFPh8UkZlY/X3ffHvVr4cfylgV1mgDfoyQ3M7ILqgy4oYu4pAh5Kr6\nJ8C3I6t2zFIBXAccVdUnVfU48DBwdZsCDsnlYWJTj3BC3Hm/NhvDJxTNWdeZcFL3MYg4tPORv0VE\n7heRD4vIBcWyFwAnvG1OAJe0OEeU1M3t66abgNfDf/hO3ZOSgR8m8sasidW5sRocTYX8N4HLgZcC\n3wJ+rWTb1pOC1rmwY7wJY8e5TmRf8zeoqkmhDaPrtt1qnt+B0Sj8UFUfdZ9F5EPAHcXXbwKXeZte\nWizbwaFDh7Y+r6+vs76+XnrOJhc2to91avZD1gTXhpGBbqSzIvY1ajN1LubsWtnc3GRzc7NyO6ma\nzR5ARPYAd6jqS4rvF6vqt4rPbweuUtV9RWfnBhO/+CXAPcALNTiJiISL0uduYeH5VIUVxaZDCyuN\nhcPtxF2nLAox93O/h/d3LD5Jo398MZ+XATa0Ni8iqOqO/smc8MOjwP8CflRE/kpE3gwcFpFjInI/\n8Crg7QCq+iDwceBB4E7gl7MVO0FWaODRYzssvtDX5Y4Re+qmbpZZ72l8N0r2dSryv4scQyRuoVt/\nhOFITXAyVj92n2RZ5J2ftIZF7hr2jhsXe1XPnCjCCU/Z07bNBMXLQEzEa1nmiXu1cuS0XWdjB357\nDC30PgbxDHU0Z2OLfCh0dZOGNhvJWHFvSslr6d6Saj5w7d4YMXITXHU54ntoIl7G4IXc3ZwdfrKY\nGGR0qLkbbVZfc2TfdKOpbEApQS85vmGU0Xem07EZFIMX8uRTsUUUxJietEOiVnjh3rVWc6K2CWU0\nFpvYDD6pdVXLc88xdAYv5D5TT8mUSGQIfKqjbWt9RECW1YJ3gtqoEzL0hVsIotEhqQE9dfeJMbb2\nPgohdxb0jqdkC4uvjLE9jfuitUW8d83E2+iM3Pl7y8R6Udv2KITckbxBPQm6MaFW5a8S7kxht/TC\nxhRFP8ss0syOzRqHMQl5TADcsnBdzc61kLF1dPRBmC+l9jUpuwc1742JuQHUMtjq1td5THnYJeMR\n8hixG+uWdWilj/Xmzo0e3Ckm5oYjV6RzthuzePuMW8jL8K31QFj8IeIxdGM67HEZCSN7sl5l6wh4\nxbax625ibsRGeqdyKi2qPzzGuIW8zN3iPgdhcLmhh7qx/Wf05G6KucQMowNyrfFFYTRCrhqJgChz\nn8TimE0o+qVO7Hhq28Q9WibryuiGZXqbHo2QV+ILQyAQJgIDJGaNu/sWEfNlapRGnFTiO2NkQh61\nykNKLMIq37gxY/z+i/AhbG9PRoHI5CEf9lnl9GEtSz/X4LMf7tzXa/gZrhY/sZP5u+sxda1zqSvA\n4cjPkqyIsFh+TSMPJ+R1KXsTH2s9Gn32Q0fUqk74W/0baSJen61rXScu392LqoYXWt7B8Zct6sCo\nSWaCvGWxyEcn5MD0a3iFYCzDTZwZdQda5VpRYaRRap2xnJSNF6nJosSNh4zOtbJ1jBoxxWaNN6cq\nwVhlg0rlI/eXV7jJzK2y3Mg+St1uuSzCpCUp10qjyZfHhIn4bEhe5421nQ+DHCvb2+YsRQO2e7m8\n7F1rHbUydhEvY5yulUxMxHumsKSrrnNltFBk4NbUObB7aUxoKuKLXn8WziJf9Bs2BKaEeSPvdVd1\nYpm7/1lYVkvDcfTY9puZsYPRCrkJ9mzwhbdtHH6t/RukVTAWmNQo4LJxI0tUbxbatWJ0g+pap4Op\ndhwrbIxmiRsFlW9vFtUEZAi5iHxERE6KyFe8ZasicreIfE1E7hKRC7x1N4rI10XkIRG5pq+CG+Nm\nS8z9ePIOIhOMJSQh5suULTPHIv9t4Npg2QHgblW9Avij4jsiciXwBuDKYp8PiohZ/UacWBjiDLEJ\nnkdAVWK8Esy14qGqfwJ8O1j8WuD24vPtwOuKz9cBR1X1SVU9DjwMXN1NUY2FxIl5KOpFNMwsGqMJ\n+oixNziguY/8QlU9WXw+CVxYfH4BcMLb7gRwScNzGAvOVs53XZv+vzGbBGdTKQDM17oQLOs8Aq2j\nVlRVRaRsmObsh44aRiYuqZplxhweu06dZuXI5PPZ5x6PjvZ1y5dNuEOaCvlJEblIVR8RkYuBR4vl\n3wQu87a7tFi2g0OHDm19Xl9fZ319vWFRDKMZZ1Z3m0tlLPid4kVK26nlC8rm5iabm5uV22XlWhGR\nPcAdqvqS4vv7gcdV9bCIHAAuUNUDRWfnBhO/+CXAPcALw8QqXeRaMRaPXaemh2D3ZWW58zghX3Zr\nbqiE9QHYmb++YFnuYSrXSqWQi8hR4FXA85j4w28G/jvwceBHgOPA61X1O8X2B4E3A08Bb1PVz0aO\naUJuRPEbbx+N01ngi5BAaRmIvjF5YarLIuCOxkLeU2FMyI0oruH2JeJbPvElE4CxUuX6Wrb7uDAT\nSxhGXfzwQstPPz5sgpFqTMiNQdFX6JjNFrUAWIhoEnOtGAuP87vDYuekXjSinZ0Fy/owNteKYRij\nwX/47sAs8x2YRW4YxiDxxTy0ys0in8YscsMwBklZx7QN5JpmtBNLGIaxuPjD82Msq0WewixywzAG\njblVqjEhNwxj0FgceTUm5IZhjAazxuNY1IphGIMlDEOsGgew6EnQLNeKYRijIxZPvsyDulJCblEr\nhmEMFj+lcekgoSXHfOSGYQwef7i+xZDvxCxywzAGi/N3y77ldafkYD5ywzCMkWBD9A3DMBYUE3LD\nMIyRY0JuGIYxckzIDcMwRo4JuWEYxsgxITcMwxg5reLIReQ4cBr4PvCkql4tIqvAx4C/BRwHXq+q\n32lZTsMwDCNBW4tcgXVVfZmqXl0sOwDcrapXAH9UfDcMwzB6ogvXShic/lrg9uLz7cDrOjiHYRiG\nkaDVyE4R+UvgCSaulf+iqr8lIt9W1ecU6wU45b57+9nITsMwOuWYTNuUawuoMX1lP3ylqn5LRJ4P\n3C0iD/krVVVFZPGupmEYgyEUcFhMES+jlZCr6reK/4+JyCeBq4GTInKRqj4iIhcDj8b2PXTo0Nbn\n9fV11tfX2xTF8PArtqvQx0RYU42uM4yxsugivrm5yebmZuV2jV0rIvJM4BxV/a6IPAu4C3gX8LPA\n46p6WEQOABeo6oFg31G6VmKVxtFn5al73rLty46R2q/OOcKHRdU5DaMpiy7iMTqfIUhELgc+WXw9\nF/ioqv7HIvzw48CPkAg/HJOQ1xVFHydqbSpXm/OPlUVvjEZzqtrDotcdm+qtBrMQz5wKt4wiHrLo\nDdOoz7zejIeACTnbFaALd0TX+GWad1nGwKI3WGObsN0us1U+aiEvE+DcfWOYeC4Oi9x4l5mwc36Z\nRRwGKOT3z/ysxrKw6I15WWhiXC3CvS/73T8OvcSRG8bgqBN9YwyTZXlD7up3mpAbS0PbCCJjgj0o\nu6HLh5UJuWEY2ZSJzxCs6CE+rGdxXUzIjYVnaA27b7ryLcdEMXfA17wY2r2e1bUyITcWlqE16j7o\nSihSCacspUN95vGgs6gVYyEZq+gM2dodG7OuA7O4dxa1YiwNYxRxE/DuWaa3CRNyw+iZ2IA2E+7Z\n0nWu8qHdP3OtGEYES3Rm+B27Q+nkTblWTMgNwzBGQkrIu5iz0zAMw5gjJuSGYRgjx4TcMAxj5JiQ\nG4ZhjBwTcsMwjJFjQm4YhjFyTMgNwzBGjgm5YRjGyDEhNwzDGDm9CLmIXCsiD4nI10Vkfx/nMAzD\nMCZ0LuQicg5wBLgWuBLYKyIv7vo88+DP5l2AFljZZ89Yyw3jLftYyw3tyt6HRX418LCqHlfVJ4H/\nBlzXw3lmzhfnXYAWWNlnz1jLDeMt+1jLDe3K3oeQXwL8lff9RLHMMAzD6IE+hHyxM7gbhmEMjM7T\n2IrITwCHVPXa4vuNwNOqetjbxsTeMAyjATPJRy4i5wL/G/iHwP8BvgDsVdWvdnoiwzAMA+hhqjdV\nfUpErgc+C5wDfNhE3DAMoz/mMkOQYRiG0R0zHdk59IFCIvIRETkpIl/xlq2KyN0i8jURuUtELvDW\n3Vj8lodE5Jr5lBpE5DIR+ZyI/IWIPCAibx1R2X9ARO4VkfuKsh8aS9mLspwjIl8WkTuK72Mp93ER\nOVaU/QvFssGXXUQuEJFPiMhXReRBEXnFSMr9o8W1dn9PiMhbOyu7qs7kj4mb5WFgD3AecB/w4lmd\nP7OMPwW8DPiKt+z9wL8vPu8H3ld8vrL4DecVv+lh4BlzKvdFwEuLz89m0kfx4jGUvSjPM4v/5wKf\nB14xorL/W+CjwKfHUl+K8nwDWA2WDb7swO3Am736cv4Yyh38hmcA3wIu66rssyz83wc+430/AByY\n90WNlHMP00L+EHBh8fki4KHi843Afm+7zwA/Me/yF2X5FPCzYys78Ezgz5kMKht82YFLgXuAnwbu\nGFN9KYT8ucGyQZe9EO2/jCwfdLkj5b0G+JMuyz5L18pYBwpdqKoni88ngQuLzy9g8hscg/g9IrKH\nyVvFvYyk7CLyDBG5j0kZ71LVLzCOsv8n4N8BT3vLxlBumIz3uEdEvigiv1gsG3rZLwceE5HfFpEv\nichvicizGH65Q94IHC0+d1L2WQr56HtVdfJoLPsdc/2NIvJs4PeBt6nqd/11Qy67qj6tqi9lYuG+\nQkR+LFg/uLKLyD8CHlXVLwM74nphmOX2eKWqvgx4DfArIvJT/sqBlv1c4OXAB1X15cD/ZfJmv12o\nYZZ7CxFZAf4x8HvhujZln6WQf5OJT8hxGdNPnKFyUkQuAhCRi4FHi+Xh77m0WDYXROQ8JiL+u6r6\nqWLxKMruUNUngM8Br2b4Zf8HwGtF5BtMrKufEZHfZfjlBkBVv1X8fwz4JBN31tDLfgI4oaouv9Qn\nmAj7IwMvt89rgD8vrjt0dM1nKeRfBF4kInuKp9IbgE/P8PxN+TTwpuLzm5j4n93yN4rIiohcDryI\nyeCnmSMiAnwYeFBVf91bNYayP8/11IvIDwI/B3yVgZddVQ+q6mWqejmTV+U/VtV/MfRyA4jIM0Xk\nh4rPz2Lis/0KAy+7qj4C/JWIXFEs+lngL4A7GHC5A/ay7VaBrq75jJ38r2ESUfEwcOO8Ox0i5TvK\nZDTqWSb+/H8FrDLp0PoacBdwgbf9weK3PAS8eo7l/kkmftr7gC8Xf9eOpOwvAb4E3M9ETP5DsXzw\nZffK8yq2o1YGX24mvub7ir8HXFscSdl/nEnG1/uBP2DSATr4chdleRbw18APecs6KbsNCDIMwxg5\nNtWbYRjGyDEhNwzDGDkm5IZhGCPHhNwwDGPkmJAbhmGMHBNywzCMkWNCbhiGMXJMyA3DMEbO/wfA\n2s/4AWDW9AAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 16 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 32, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "source": [ "##Packed integer data\n", "There is a similar feature for variables with `scale_factor` and `add_offset` attributes.\n", "\n", "- short integer data will automatically be returned as float data, with the scale and offset applied. " ] }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 32, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Dealing with dates and times\n", "- time variables usually measure relative to a fixed date using a certain calendar, with units specified like ***`hours since YY:MM:DD hh-mm-ss`***.\n", "- **`num2date`** and **`date2num`** convenience functions provided to convert between these numeric time coordinates and handy python datetime instances. \n", "- **`date2index`** finds the time index corresponding to a datetime instance." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from netCDF4 import num2date, date2num, date2index\n", "timedim = sfctmp.dimensions[0] # time dim name\n", "print('name of time dimension = %s' % timedim)\n", "times = gfs.variables[timedim] # time coord var\n", "print('units = %s, values = %s' % (times.units, times[:]))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 34 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "name of time dimension = time1\n", "units = Hour since 2015-03-10T12:00:00Z, values = [ 0. 3. 6. 9. 12. 15. 18. 21. 24. 27. 30. 33.\n", " 36. 39. 42. 45. 48. 51. 54. 57. 60. 63. 66. 69.\n", " 72. 75. 78. 81. 84. 87. 90. 93. 96. 99. 102. 105.\n", " 108. 111. 114. 117. 120. 123. 126. 129. 132. 135. 138. 141.\n", " 144. 147. 150. 153. 156. 159. 162. 165. 168. 171. 174. 177.\n", " 180. 183. 186. 189. 192. 195. 198. 201. 204. 207. 210. 213.\n", " 216. 219. 222. 225. 228. 231. 234. 237. 240. 252. 264. 276.\n", " 288. 300. 312. 324. 336. 348. 360. 372. 384.]\n" ] } ], "prompt_number": 17 }, { "cell_type": "code", "collapsed": false, "input": [ "dates = num2date(times[:], times.units)\n", "print([date.strftime('%Y-%m-%d %H:%M:%S') for date in dates[:10]]) # print only first ten..." ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 35, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "['2015-03-10 12:00:00', '2015-03-10 15:00:00', '2015-03-10 18:00:00', '2015-03-10 21:00:00', '2015-03-11 00:00:00', '2015-03-11 03:00:00', '2015-03-11 06:00:00', '2015-03-11 09:00:00', '2015-03-11 12:00:00', '2015-03-11 15:00:00']\n" ] } ], "prompt_number": 18 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 35, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "###Get index associated with a specified date, extract forecast data for that date." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from datetime import datetime, timedelta\n", "date = datetime.now() + timedelta(days=3)\n", "print(date)\n", "ntime = date2index(date,times,select='nearest')\n", "print('index = %s, date = %s' % (ntime, dates[ntime]))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 37 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "2015-03-13 14:47:13.043237\n", "index = 25, date = 2015-03-13 15:00:00\n" ] } ], "prompt_number": 19 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 38 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "###Get temp forecast for Boulder (near 40N, -105W)\n", "- use function **`getcloses_ij`** we created before..." ] }, { "cell_type": "code", "collapsed": false, "input": [ "lats, lons = gfs.variables['lat'][:], gfs.variables['lon'][:]\n", "# lats, lons are 1-d. Make them 2-d using numpy.meshgrid.\n", "lons, lats = np.meshgrid(lons,lats)\n", "j, i = getclosest_ij(lats,lons,40,-105)\n", "fcst_temp = sfctmp[ntime,j,i]\n", "print('Boulder forecast valid at %s UTC = %5.1f %s' % \\\n", " (dates[ntime],fcst_temp,sfctmp.units))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 39, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Boulder forecast valid at 2015-03-13 15:00:00 UTC = 292.7 K\n" ] } ], "prompt_number": 20 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 39, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "##Simple multi-file aggregation\n", "\n", "What if you have a bunch of netcdf files, each with data for a different year, and you want to access all the data as if it were in one file?" ] }, { "cell_type": "code", "collapsed": false, "input": [ "!ls -l data/prmsl*nc" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 41 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-rw-r--r-- 1 jwhitaker climate 8985332 Mar 10 09:57 data/prmsl.2000.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8968789 Mar 10 09:57 data/prmsl.2001.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8972796 Mar 10 09:57 data/prmsl.2002.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8974435 Mar 10 09:57 data/prmsl.2003.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8997438 Mar 10 09:57 data/prmsl.2004.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8976678 Mar 10 09:57 data/prmsl.2005.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8969714 Mar 10 09:57 data/prmsl.2006.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8974360 Mar 10 09:57 data/prmsl.2007.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8994260 Mar 10 09:57 data/prmsl.2008.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8974678 Mar 10 09:57 data/prmsl.2009.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8970732 Mar 10 09:57 data/prmsl.2010.nc\r\n", "-rw-r--r-- 1 jwhitaker climate 8976285 Mar 10 09:57 data/prmsl.2011.nc\r\n" ] } ], "prompt_number": 21 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 42 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "**`MFDataset`** uses file globbing to patch together all the files into one big Dataset.\n", "You can also pass it a list of specific files.\n", "\n", "Limitations:\n", "\n", "- It can only aggregate the data along the leftmost dimension of each variable.\n", "- only works with `NETCDF3`, or `NETCDF4_CLASSIC` formatted files.\n", "- kind of slow." ] }, { "cell_type": "code", "collapsed": false, "input": [ "mf = netCDF4.MFDataset('data/prmsl*nc')\n", "times = mf.variables['time']\n", "dates = num2date(times[:],times.units)\n", "print('starting date = %s' % dates[0])\n", "print('ending date = %s'% dates[-1])\n", "prmsl = mf.variables['prmsl']\n", "print('times shape = %s' % times.shape)\n", "print('prmsl dimensions = %s, prmsl shape = %s' %\\\n", " (prmsl.dimensions, prmsl.shape))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 43, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "starting date = 2000-01-01 00:00:00\n", "ending date = 2011-12-31 00:00:00\n", "times shape = 4383\n", "prmsl dimensions = (u'time', u'lat', u'lon'), prmsl shape = (4383, 91, 180)\n" ] } ], "prompt_number": 22 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 43, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Closing your netCDF file\n", "\n", "It's good to close netCDF files, but not actually necessary when Dataset is open for read access only.\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "f.close()\n", "gfs.close()" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 45 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [], "prompt_number": 23 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 45, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "-" } }, "source": [ "##That's it!\n", "\n", "Now you're ready to start exploring your data interactively.\n", "\n", "To be continued with **Writing netCDF data** ...." ] } ], "metadata": {} } ] }netcdf4-python-1.2.2rel/examples/subset.py000066400000000000000000000012061264125125200205610ustar00rootroot00000000000000# use 'orthogonal indexing' feature to subselect data over CONUS. import netCDF4 import numpy as np import matplotlib.pyplot as plt # use real data from CFS reanlysis. # note: we're reading GRIB2 data! URL="http://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cmd_flxf/2010/201007/20100701/flxf00.gdas.2010070100.grb2" nc = netCDF4.Dataset(URL) lats = nc.variables['lat'][:]; lons = nc.variables['lon'][:] latselect = np.logical_and(lats>25,lats<50) lonselect = np.logical_and(lons>230,lons<305) data = nc.variables['Soil_moisture_content'][0,0,latselect,lonselect] plt.contourf(data[::-1]) # flip latitudes so they go south -> north plt.show() netcdf4-python-1.2.2rel/examples/test_stringarr.py000066400000000000000000000035331264125125200223330ustar00rootroot00000000000000from netCDF4 import Dataset, stringtochar, chartostring import random, numpy # test utilities for converting arrays of fixed-length strings # to arrays of characters (with an extra dimension), and vice-versa. # netCDF does not have a fixed-length string data-type (only characters # and variable length strings). The convenience function chartostring # converts an array of characters to an array of fixed-length strings. # The array of fixed length strings has one less dimension, and the # length of the strings is equal to the rightmost dimension of the # array of characters. The convenience function stringtochar goes # the other way, converting an array of fixed-length strings to an # array of characters with an extra dimension (the number of characters # per string) appended on the right. FILE_NAME = 'tst_stringarr.nc' FILE_FORMAT = 'NETCDF4_CLASSIC' chars = '1234567890aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' nc = Dataset(FILE_NAME,'w',format=FILE_FORMAT) n2 = 10; nchar = 12; nrecs = 4 nc.createDimension('n1',None) nc.createDimension('n2',n2) nc.createDimension('nchar',nchar) v = nc.createVariable('strings','S1',('n1','n2','nchar')) for nrec in range(nrecs): data = [] data = numpy.empty((n2,),'S'+repr(nchar)) # fill data with random nchar character strings for n in range(n2): data[n] = ''.join([random.choice(chars) for i in range(nchar)]) print(nrec,data) # convert data to array of characters with an extra dimension # (the number of characters per string) added to the right. datac = stringtochar(data) v[nrec] = datac nc.close() nc = Dataset(FILE_NAME) v = nc.variables['strings'] print(v.shape, v.dtype) for nrec in range(nrecs): # read character array back, convert to an array of strings # of length equal to the rightmost dimension. print(nrec, chartostring(v[nrec])) nc.close() netcdf4-python-1.2.2rel/examples/threaded_read.py000066400000000000000000000032301264125125200220260ustar00rootroot00000000000000from netCDF4 import Dataset from numpy.testing import assert_array_equal, assert_array_almost_equal import numpy as np import threading import Queue import time # demonstrate reading of different files from different threads. # Releasing the Global Interpreter Lock (GIL) when calling the # netcdf C library for read operations speeds up the reads # when threads are used (issue 369). # Test script contributed by Ryan May of Unidata. # Make some files nfiles = 4 fnames = []; datal = [] for i in range(nfiles): fname = 'test%d.nc' % i fnames.append(fname) nc = Dataset(fname, 'w') data = np.random.randn(500, 500, 500) datal.append(data) nc.createDimension('x', 500) nc.createDimension('y', 500) nc.createDimension('z', 500) var = nc.createVariable('grid', 'f', ('x', 'y', 'z')) var[:] = data nc.close() # Queue them up items = Queue.Queue() for data,fname in zip(datal,fnames): items.put(fname) # Function for threads to use def get_data(serial=None): if serial is None: # if not called from a thread fname = items.get() else: fname = fnames[serial] nc = Dataset(fname, 'r') data2 = nc.variables['grid'][:] # make sure the data is correct #assert_array_almost_equal(data2,datal[int(fname[4])]) nc.close() if serial is None: items.task_done() # Time it (no threading). start = time.time() for i in range(nfiles): get_data(serial=i) end = time.time() print 'no threads, time = ',end - start # with threading. start = time.time() for i in range(nfiles): threading.Thread(target=get_data).start() items.join() end = time.time() print 'with threading, time = ',end - start netcdf4-python-1.2.2rel/examples/tutorial.py000066400000000000000000000277661264125125200211420ustar00rootroot00000000000000from netCDF4 import Dataset # code from tutorial. # create a file (Dataset object, also the root group). rootgrp = Dataset('test.nc', 'w', format='NETCDF4') print(rootgrp.file_format) rootgrp.close() # create some groups. rootgrp = Dataset('test.nc', 'a') fcstgrp = rootgrp.createGroup('forecasts') analgrp = rootgrp.createGroup('analyses') fcstgrp1 = rootgrp.createGroup('/forecasts/model1') fcstgrp2 = rootgrp.createGroup('/forecasts/model2') # walk the group tree using a Python generator. def walktree(top): values = top.groups.values() yield values for value in top.groups.values(): for children in walktree(value): yield children print(rootgrp) for children in walktree(rootgrp): for child in children: print(child) # dimensions. level = rootgrp.createDimension('level', None) time = rootgrp.createDimension('time', None) lat = rootgrp.createDimension('lat', 73) lon = rootgrp.createDimension('lon', 144) print(rootgrp.dimensions) print(len(lon)) print(lon.isunlimited()) print(time.isunlimited()) for dimobj in rootgrp.dimensions.values(): print(dimobj) print(time) # variables. times = rootgrp.createVariable('time','f8',('time',)) levels = rootgrp.createVariable('level','i4',('level',)) latitudes = rootgrp.createVariable('latitude','f4',('lat',)) longitudes = rootgrp.createVariable('longitude','f4',('lon',)) # 2 unlimited dimensions. #temp = rootgrp.createVariable('temp','f4',('time','level','lat','lon',)) # this makes the compression 'lossy' (preserving a precision of 1/1000) # try it and see how much smaller the file gets. temp = rootgrp.createVariable('temp','f4',('time','level','lat','lon',),least_significant_digit=3) print(temp) # create variable in a group using a path. temp = rootgrp.createVariable('/forecasts/model1/temp','f4',('time','level','lat','lon',)) print(rootgrp['/forecasts/model1']) # print the Group instance print(rootgrp['/forecasts/model1/temp']) # print the Variable instance # attributes. import time rootgrp.description = 'bogus example script' rootgrp.history = 'Created ' + time.ctime(time.time()) rootgrp.source = 'netCDF4 python module tutorial' latitudes.units = 'degrees north' longitudes.units = 'degrees east' levels.units = 'hPa' temp.units = 'K' times.units = 'hours since 0001-01-01 00:00:00.0' times.calendar = 'gregorian' for name in rootgrp.ncattrs(): print('Global attr', name, '=', getattr(rootgrp,name)) print(rootgrp) print(rootgrp.__dict__) print(rootgrp.variables) import numpy # no unlimited dimension, just assign to slice. lats = numpy.arange(-90,91,2.5) lons = numpy.arange(-180,180,2.5) latitudes[:] = lats longitudes[:] = lons print('latitudes =\n',latitudes[:]) print('longitudes =\n',longitudes[:]) # append along two unlimited dimensions by assigning to slice. nlats = len(rootgrp.dimensions['lat']) nlons = len(rootgrp.dimensions['lon']) print('temp shape before adding data = ',temp.shape) from numpy.random.mtrand import uniform # random number generator. temp[0:5,0:10,:,:] = uniform(size=(5,10,nlats,nlons)) print('temp shape after adding data = ',temp.shape) # levels have grown, but no values yet assigned. print('levels shape after adding pressure data = ',levels.shape) # assign values to levels dimension variable. levels[:] = [1000.,850.,700.,500.,300.,250.,200.,150.,100.,50.] # fancy slicing tempdat = temp[::2, [1,3,6], lats>0, lons>0] print('shape of fancy temp slice = ',tempdat.shape) print(temp[0, 0, [0,1,2,3], [0,1,2,3]].shape) # fill in times. from datetime import datetime, timedelta from netCDF4 import num2date, date2num, date2index dates = [datetime(2001,3,1)+n*timedelta(hours=12) for n in range(temp.shape[0])] times[:] = date2num(dates,units=times.units,calendar=times.calendar) print('time values (in units %s): ' % times.units+'\\n',times[:]) dates = num2date(times[:],units=times.units,calendar=times.calendar) print('dates corresponding to time values:\\n',dates) rootgrp.close() # create a series of netCDF files with a variable sharing # the same unlimited dimension. for nfile in range(10): f = Dataset('mftest'+repr(nfile)+'.nc','w',format='NETCDF4_CLASSIC') f.createDimension('x',None) x = f.createVariable('x','i',('x',)) x[0:10] = numpy.arange(nfile*10,10*(nfile+1)) f.close() # now read all those files in at once, in one Dataset. from netCDF4 import MFDataset f = MFDataset('mftest*nc') print(f.variables['x'][:]) # example showing how to save numpy complex arrays using compound types. f = Dataset('complex.nc','w') size = 3 # length of 1-d complex array # create sample complex data. datac = numpy.exp(1j*(1.+numpy.linspace(0, numpy.pi, size))) print(datac.dtype) # create complex128 compound data type. complex128 = numpy.dtype([('real',numpy.float64),('imag',numpy.float64)]) complex128_t = f.createCompoundType(complex128,'complex128') # create a variable with this data type, write some data to it. f.createDimension('x_dim',None) v = f.createVariable('cmplx_var',complex128_t,'x_dim') data = numpy.empty(size,complex128) # numpy structured array data['real'] = datac.real; data['imag'] = datac.imag v[:] = data # close and reopen the file, check the contents. f.close() f = Dataset('complex.nc') print(f) print(f.variables['cmplx_var']) print(f.cmptypes) print(f.cmptypes['complex128']) v = f.variables['cmplx_var'] print(v.shape) datain = v[:] # read in all the data into a numpy structured array # create an empty numpy complex array datac2 = numpy.empty(datain.shape,numpy.complex128) # .. fill it with contents of structured array. datac2.real = datain['real'] datac2.imag = datain['imag'] print(datac.dtype,datac) print(datac2.dtype,datac2) # more complex compound type example. from netCDF4 import chartostring, stringtoarr f = Dataset('compound_example.nc','w') # create a new dataset. # create an unlimited dimension call 'station' f.createDimension('station',None) # define a compound data type (can contain arrays, or nested compound types). NUMCHARS = 80 # number of characters to use in fixed-length strings. winddtype = numpy.dtype([('speed','f4'),('direction','i4')]) statdtype = numpy.dtype([('latitude', 'f4'), ('longitude', 'f4'), ('surface_wind',winddtype), ('temp_sounding','f4',10),('press_sounding','i4',10), ('location_name','S1',NUMCHARS)]) # use this data type definitions to create a compound data types # called using the createCompoundType Dataset method. # create a compound type for vector wind which will be nested inside # the station data type. This must be done first! wind_data_t = f.createCompoundType(winddtype,'wind_data') # now that wind_data_t is defined, create the station data type. station_data_t = f.createCompoundType(statdtype,'station_data') # create nested compound data types to hold the units variable attribute. winddtype_units = numpy.dtype([('speed','S1',NUMCHARS),('direction','S1',NUMCHARS)]) statdtype_units = numpy.dtype([('latitude', 'S1',NUMCHARS), ('longitude', 'S1',NUMCHARS), ('surface_wind',winddtype_units), ('temp_sounding','S1',NUMCHARS), ('location_name','S1',NUMCHARS), ('press_sounding','S1',NUMCHARS)]) # create the wind_data_units type first, since it will nested inside # the station_data_units data type. wind_data_units_t = f.createCompoundType(winddtype_units,'wind_data_units') station_data_units_t =\ f.createCompoundType(statdtype_units,'station_data_units') # create a variable of of type 'station_data_t' statdat = f.createVariable('station_obs', station_data_t, ('station',)) # create a numpy structured array, assign data to it. data = numpy.empty(1,station_data_t) data['latitude'] = 40. data['longitude'] = -105. data['surface_wind']['speed'] = 12.5 data['surface_wind']['direction'] = 270 data['temp_sounding'] = (280.3,272.,270.,269.,266.,258.,254.1,250.,245.5,240.) data['press_sounding'] = range(800,300,-50) # variable-length string datatypes are not supported inside compound types, so # to store strings in a compound data type, each string must be # stored as fixed-size (in this case 80) array of characters. data['location_name'] = stringtoarr('Boulder, Colorado, USA',NUMCHARS) # assign structured array to variable slice. statdat[0] = data # or just assign a tuple of values to variable slice # (will automatically be converted to a structured array). statdat[1] = (40.78,-73.99,(-12.5,90), (290.2,282.5,279.,277.9,276.,266.,264.1,260.,255.5,243.), range(900,400,-50),stringtoarr('New York, New York, USA',NUMCHARS)) print(f.cmptypes) windunits = numpy.empty(1,winddtype_units) stationobs_units = numpy.empty(1,statdtype_units) windunits['speed'] = stringtoarr('m/s',NUMCHARS) windunits['direction'] = stringtoarr('degrees',NUMCHARS) stationobs_units['latitude'] = stringtoarr('degrees north',NUMCHARS) stationobs_units['longitude'] = stringtoarr('degrees west',NUMCHARS) stationobs_units['surface_wind'] = windunits stationobs_units['location_name'] = stringtoarr('None', NUMCHARS) stationobs_units['temp_sounding'] = stringtoarr('Kelvin',NUMCHARS) stationobs_units['press_sounding'] = stringtoarr('hPa',NUMCHARS) statdat.units = stationobs_units # close and reopen the file. f.close() f = Dataset('compound_example.nc') print(f) statdat = f.variables['station_obs'] print(statdat) # print out data in variable. print('data in a variable of compound type:') print('----') for data in statdat[:]: for name in statdat.dtype.names: if data[name].dtype.kind == 'S': # a string # convert array of characters back to a string for display. units = chartostring(statdat.units[name]) print(name,': value =',chartostring(data[name]),\ ': units=',units) elif data[name].dtype.kind == 'V': # a nested compound type units_list = [chartostring(s) for s in tuple(statdat.units[name])] print(name,data[name].dtype.names,': value=',data[name],': units=',\ units_list) else: # a numeric type. units = chartostring(statdat.units[name]) print(name,': value=',data[name],': units=',units) print('----') f.close() f = Dataset('tst_vlen.nc','w') vlen_t = f.createVLType(numpy.int32, 'phony_vlen') x = f.createDimension('x',3) y = f.createDimension('y',4) vlvar = f.createVariable('phony_vlen_var', vlen_t, ('y','x')) import random data = numpy.empty(len(y)*len(x),object) for n in range(len(y)*len(x)): data[n] = numpy.arange(random.randint(1,10),dtype='int32')+1 data = numpy.reshape(data,(len(y),len(x))) vlvar[:] = data print(vlvar) print('vlen variable =\n',vlvar[:]) print(f) print(f.variables['phony_vlen_var']) print(f.vltypes['phony_vlen']) z = f.createDimension('z', 10) strvar = f.createVariable('strvar',str,'z') chars = '1234567890aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' data = numpy.empty(10,object) for n in range(10): stringlen = random.randint(2,12) data[n] = ''.join([random.choice(chars) for i in range(stringlen)]) strvar[:] = data print('variable-length string variable:\n',strvar[:]) print(f) print(f.variables['strvar']) f.close() # Enum type example. f = Dataset('clouds.nc','w') # python dict describing the allowed values and their names. enum_dict = {u'Altocumulus': 7, u'Missing': 255, u'Stratus': 2, u'Clear': 0, u'Nimbostratus': 6, u'Cumulus': 4, u'Altostratus': 5, u'Cumulonimbus': 1, u'Stratocumulus': 3} # create the Enum type called 'cloud_t'. cloud_type = f.createEnumType(numpy.uint8,'cloud_t',enum_dict) print(cloud_type) time = f.createDimension('time',None) # create a 1d variable of type 'cloud_type' called 'primary_clouds'. # The fill_value is set to the 'Missing' named value. cloud_var = f.createVariable('primary_cloud',cloud_type,'time',\ fill_value=enum_dict['Missing']) # write some data to the variable. cloud_var[:] = [enum_dict['Clear'],enum_dict['Stratus'],enum_dict['Cumulus'],\ enum_dict['Missing'],enum_dict['Cumulonimbus']] # close file, reopen it. f.close() f = Dataset('clouds.nc') cloud_var = f.variables['primary_cloud'] print(cloud_var) print(cloud_var.datatype.enum_dict) print(cloud_var[:]) f.close() netcdf4-python-1.2.2rel/examples/writing_netCDF.ipynb000066400000000000000000001136301264125125200226200ustar00rootroot00000000000000{ "metadata": { "name": "", "signature": "sha256:2d5756ffde5fe7c0ab2e065fbc148e5808a947da2a26573885526ea00f45b576" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": { "internals": { "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "# Writing netCDF data\n", "\n", "**Important Note**: when running this notebook interactively in a browser, you probably will not be able to execute individual cells out of order without getting an error. Instead, choose \"Run All\" from the Cell menu after you modify a cell." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import print_function # make sure print behaves the same in 2.7 and 3.x\n", "import netCDF4 # Note: python is case-sensitive!\n", "import numpy as np" ], "language": "python", "metadata": { "internals": { "frag_number": 1, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 1, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Opening a file, creating a new Dataset\n", "\n", "Let's create a new, empty netCDF file named 'data/new.nc', opened for writing.\n", "\n", "Be careful, opening a file with 'w' will clobber any existing data (unless `clobber=False` is used, in which case an exception is raised if the file already exists).\n", "\n", "- `mode='r'` is the default.\n", "- `mode='a'` opens an existing file and allows for appending (does not clobber existing data)\n", "- `format` can be one of `NETCDF3_CLASSIC`, `NETCDF3_64BIT`, `NETCDF4_CLASSIC` or `NETCDF4` (default). `NETCDF4_CLASSIC` uses HDF5 for the underlying storage layer (as does `NETCDF4`) but enforces the classic netCDF 3 data model so data can be read with older clients. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "try: ncfile.close() # just to be safe, make sure dataset is not already open.\n", "except: pass\n", "ncfile = netCDF4.Dataset('data/new.nc',mode='w',format='NETCDF4_CLASSIC') \n", "print(ncfile)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 3, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "root group (NETCDF4_CLASSIC data model, file format HDF5):\n", " dimensions(sizes): \n", " variables(dimensions): \n", " groups: \n", "\n" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 3, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Creating dimensions\n", "\n", "The **ncfile** object we created is a container for _dimensions_, _variables_, and _attributes_. First, let's create some dimensions using the [`createDimension`](http://unidata.github.io/netcdf4-python/netCDF4.Dataset-class.html#createDimension) method. \n", "\n", "- Every dimension has a name and a length. \n", "- The name is a string that is used to specify the dimension to be used when creating a variable, and as a key to access the dimension object in the `ncfile.dimensions` dictionary.\n", "\n", "Setting the dimension length to `0` or `None` makes it unlimited, so it can grow. \n", "\n", "- For `NETCDF4` files, any variable's dimension can be unlimited. \n", "- For `NETCDF4_CLASSIC` and `NETCDF3*` files, only one per variable can be unlimited, and it must be the leftmost (fastest varying) dimension." ] }, { "cell_type": "code", "collapsed": false, "input": [ "lat_dim = ncfile.createDimension('lat', 73) # latitude axis\n", "lon_dim = ncfile.createDimension('lon', 144) # longitude axis\n", "time_dim = ncfile.createDimension('time', None) # unlimited axis (can be appended to).\n", "for dim in ncfile.dimensions.items():\n", " print(dim)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 5, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "('lat', : name = 'lat', size = 73\n", ")\n", "('lon', : name = 'lon', size = 144\n", ")\n", "('time', (unlimited): name = 'time', size = 0\n", ")\n" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 5, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Creating attributes\n", "\n", "netCDF attributes can be created just like you would for any python object. \n", "\n", "- Best to adhere to established conventions (like the [CF](http://cfconventions.org/) conventions)\n", "- We won't try to adhere to any specific convention here though." ] }, { "cell_type": "code", "collapsed": false, "input": [ "ncfile.title='My model data'\n", "print(ncfile.title)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 7 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "My model data\n" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 8, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "source": [ "Try adding some more attributes..." ] }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 8, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Creating variables\n", "\n", "Now let's add some variables and store some data in them. \n", "\n", "- A variable has a name, a type, a shape, and some data values. \n", "- The shape of a variable is specified by a tuple of dimension names. \n", "- A variable should also have some named attributes, such as 'units', that describe the data.\n", "\n", "The [`createVariable`](http://unidata.github.io/netcdf4-python/netCDF4.Dataset-class.html#createVariable) method takes 3 mandatory args.\n", "\n", "- the 1st argument is the variable name (a string). This is used as the key to access the variable object from the `variables` dictionary.\n", "- the 2nd argument is the datatype (most numpy datatypes supported). \n", "- the third argument is a tuple containing the dimension names (the dimensions must be created first). Unless this is a `NETCDF4` file, any unlimited dimension must be the leftmost one.\n", "- there are lots of optional arguments (many of which are only relevant when `format='NETCDF'`) to control compression, chunking, fill_value, etc.\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Define two variables with the same names as dimensions,\n", "# a conventional way to define \"coordinate variables\".\n", "lat = ncfile.createVariable('lat', np.float32, ('lat',))\n", "lat.units = 'degrees_north'\n", "lat.long_name = 'latitude'\n", "lon = ncfile.createVariable('lon', np.float32, ('lon',))\n", "lon.units = 'degrees_east'\n", "lon.long_name = 'longitude'\n", "time = ncfile.createVariable('time', np.float64, ('time',))\n", "time.units = 'hours since 1800-01-01'\n", "time.long_name = 'time'\n", "# Define a 3D variable to hold the data\n", "temp = ncfile.createVariable('temp',np.float64,('time','lat','lon')) # note: unlimited dimension is leftmost\n", "temp.units = 'K' # degrees Kelvin\n", "temp.standard_name = 'air_temperature' # this is a CF standard name\n", "print(temp)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 10, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "float64 temp(time, lat, lon)\n", " units: K\n", " standard_name: air_temperature\n", "unlimited dimensions: time\n", "current shape = (0, 73, 144)\n", "filling on, default _FillValue of 9.96920996839e+36 used\n", "\n" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 10, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Pre-defined variable attributes (read only)\n", "\n", "The netCDF4 module provides some useful pre-defined Python attributes for netCDF variables, such as dimensions, shape, dtype, ndim. \n", "\n", "Note: since no data has been written yet, the length of the 'time' dimension is 0." ] }, { "cell_type": "code", "collapsed": false, "input": [ "print(\"-- Some pre-defined attributes for variable temp:\")\n", "print(\"temp.dimensions:\", temp.dimensions)\n", "print(\"temp.shape:\", temp.shape)\n", "print(\"temp.dtype:\", temp.dtype)\n", "print(\"temp.ndim:\", temp.ndim)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 12, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-- Some pre-defined attributes for variable temp:\n", "temp.dimensions: (u'time', u'lat', u'lon')\n", "temp.shape: (0, 73, 144)\n", "temp.dtype: float64\n", "temp.ndim: 3\n" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 12, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Writing data\n", "\n", "To write data a netCDF variable object, just treat it like a numpy array and assign values to a slice." ] }, { "cell_type": "code", "collapsed": false, "input": [ "nlats = len(lat_dim); nlons = len(lon_dim); ntimes = 3\n", "# Write latitudes, longitudes.\n", "# Note: the \":\" is necessary in these \"write\" statements\n", "lat[:] = -90. + (180./nlats)*np.arange(nlats) # south pole to north pole\n", "lon[:] = (180./nlats)*np.arange(nlons) # Greenwich meridian eastward\n", "# create a 3D array of random numbers\n", "data_arr = np.random.uniform(low=280,high=330,size=(ntimes,nlats,nlons))\n", "# Write the data. This writes the whole 3D netCDF variable all at once.\n", "temp[:,:,:] = data_arr # Appends data along unlimited dimension\n", "print(\"-- Wrote data, temp.shape is now \", temp.shape)\n", "# read data back from variable (by slicing it), print min and max\n", "print(\"-- Min/Max values:\", temp[:,:,:].min(), temp[:,:,:].max())" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 14 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-- Wrote data, temp.shape is now (3, 73, 144)\n", "-- Min/Max values: 280.00201974 329.999706175\n" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 15, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "source": [ "- You can just treat a netCDF Variable object like a numpy array and assign values to it.\n", "- Variables automatically grow along unlimited dimensions (unlike numpy arrays)\n", "- The above writes the whole 3D variable all at once, but you can write it a slice at a time instead.\n", "\n", "Let's add another time slice....\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# create a 2D array of random numbers\n", "data_slice = np.random.uniform(low=280,high=330,size=(nlats,nlons))\n", "temp[3,:,:] = data_slice # Appends the 4th time slice\n", "print(\"-- Wrote more data, temp.shape is now \", temp.shape)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 15, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-- Wrote more data, temp.shape is now (4, 73, 144)\n" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 17 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "Note that we have not yet written any data to the time variable. It automatically grew as we appended data along the time dimension to the variable `temp`, but the data is missing." ] }, { "cell_type": "code", "collapsed": false, "input": [ "print(time)\n", "times_arr = time[:]\n", "print(type(times_arr),times_arr) # dashes indicate masked values (where data has not yet been written)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 18, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "float64 time(time)\n", " units: hours since 1800-01-01\n", " long_name: time\n", "unlimited dimensions: time\n", "current shape = (4,)\n", "filling on, default _FillValue of 9.96920996839e+36 used\n", "\n", " [-- -- -- --]\n" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 18, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "Let's add write some data into the time variable. \n", "\n", "- Given a set of datetime instances, use date2num to convert to numeric time values and then write that data to the variable." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from datetime import datetime\n", "from netCDF4 import date2num,num2date\n", "# 1st 4 days of October.\n", "dates = [datetime(2014,10,1,0),datetime(2014,10,2,0),datetime(2014,10,3,0),datetime(2014,10,4,0)]\n", "print(dates)\n", "times = date2num(dates, time.units)\n", "print(times, time.units) # numeric values\n", "time[:] = times\n", "# read time data back, convert to datetime instances, check values.\n", "print(num2date(time[:],time.units))" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 20, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[datetime.datetime(2014, 10, 1, 0, 0), datetime.datetime(2014, 10, 2, 0, 0), datetime.datetime(2014, 10, 3, 0, 0), datetime.datetime(2014, 10, 4, 0, 0)]\n", "[ 1882440. 1882464. 1882488. 1882512.] hours since 1800-01-01\n", "[datetime.datetime(2014, 10, 1, 0, 0) datetime.datetime(2014, 10, 2, 0, 0)\n", " datetime.datetime(2014, 10, 3, 0, 0) datetime.datetime(2014, 10, 4, 0, 0)]\n" ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 20, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Closing a netCDF file\n", "\n", "It's **important** to close a netCDF file you opened for writing:\n", "\n", "- flushes buffers to make sure all data gets written\n", "- releases memory resources used by open netCDF files" ] }, { "cell_type": "code", "collapsed": true, "input": [ "# first print the Dataset object to see what we've got\n", "print(ncfile)\n", "# close the Dataset.\n", "ncfile.close(); print('Dataset is closed!')" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 22, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "root group (NETCDF4_CLASSIC data model, file format HDF5):\n", " title: My model data\n", " dimensions(sizes): lat(73), lon(144), time(4)\n", " variables(dimensions): float32 \u001b[4mlat\u001b[0m(lat), float32 \u001b[4mlon\u001b[0m(lon), float64 \u001b[4mtime\u001b[0m(time), float64 \u001b[4mtemp\u001b[0m(time,lat,lon)\n", " groups: \n", "\n", "Dataset is closed!\n" ] } ], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 22, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "# Advanced features\n", "\n", "So far we've only exercised features associated with the old netCDF version 3 data model. netCDF version 4 adds a lot of new functionality that comes with the more flexible HDF5 storage layer. \n", "\n", "Let's create a new file with `format='NETCDF4'` so we can try out some of these features." ] }, { "cell_type": "code", "collapsed": false, "input": [ "ncfile = netCDF4.Dataset('data/new2.nc','w',format='NETCDF4')\n", "print(ncfile)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 25, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "root group (NETCDF4 data model, file format HDF5):\n", " dimensions(sizes): \n", " variables(dimensions): \n", " groups: \n", "\n" ] } ], "prompt_number": 12 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 25, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "## Creating Groups\n", "\n", "netCDF version 4 added support for organizing data in hierarchical groups.\n", "\n", "- analagous to directories in a filesystem. \n", "- Groups serve as containers for variables, dimensions and attributes, as well as other groups. \n", "- A `netCDF4.Dataset` creates a special group, called the 'root group', which is similar to the root directory in a unix filesystem. \n", "\n", "- groups are created using the [`createGroup`](http://unidata.github.io/netcdf4-python/netCDF4.Dataset-class.html#createGroup) method.\n", "- takes a single argument (a string, which is the name of the Group instance). This string is used as a key to access the group instances in the `groups` dictionary.\n", "\n", "Here we create two groups to hold data for two different model runs." ] }, { "cell_type": "code", "collapsed": false, "input": [ "grp1 = ncfile.createGroup('model_run1')\n", "grp2 = ncfile.createGroup('model_run2')\n", "for grp in ncfile.groups.items():\n", " print(grp)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 27, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "('model_run1', \n", "group /model_run1:\n", " dimensions(sizes): \n", " variables(dimensions): \n", " groups: \n", ")\n", "('model_run2', \n", "group /model_run2:\n", " dimensions(sizes): \n", " variables(dimensions): \n", " groups: \n", ")\n" ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 27, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "Create some dimensions in the root group." ] }, { "cell_type": "code", "collapsed": false, "input": [ "lat_dim = ncfile.createDimension('lat', 73) # latitude axis\n", "lon_dim = ncfile.createDimension('lon', 144) # longitude axis\n", "time_dim = ncfile.createDimension('time', None) # unlimited axis (can be appended to)." ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 29 }, "slideshow": { "slide_type": "fragment" } }, "outputs": [], "prompt_number": 14 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 30 }, "slideshow": { "slide_type": "fragment" } }, "source": [ "Now create a variable in grp1 and grp2. The library will search recursively upwards in the group tree to find the dimensions (which in this case are defined one level up).\n", "\n", "- These variables are create with **zlib compression**, another nifty feature of netCDF 4. \n", "- The data are automatically compressed when data is written to the file, and uncompressed when the data is read. \n", "- This can really save disk space, especially when used in conjunction with the [**least_significant_digit**](http://unidata.github.io/netcdf4-python/netCDF4.Dataset-class.html#createVariable) keyword argument, which causes the data to be quantized (truncated) before compression. This makes the compression lossy, but more efficient." ] }, { "cell_type": "code", "collapsed": false, "input": [ "temp1 = grp1.createVariable('temp',np.float64,('time','lat','lon'),zlib=True)\n", "temp2 = grp2.createVariable('temp',np.float64,('time','lat','lon'),zlib=True)\n", "for grp in ncfile.groups.items(): # shows that each group now contains 1 variable\n", " print(grp)" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 31, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "('model_run1', \n", "group /model_run1:\n", " dimensions(sizes): \n", " variables(dimensions): float64 \u001b[4mtemp\u001b[0m(time,lat,lon)\n", " groups: \n", ")\n", "('model_run2', \n", "group /model_run2:\n", " dimensions(sizes): \n", " variables(dimensions): float64 \u001b[4mtemp\u001b[0m(time,lat,lon)\n", " groups: \n", ")\n" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 31, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "##Creating a variable with a compound data type\n", "\n", "- Compound data types map directly to numpy structured (a.k.a 'record' arrays). \n", "- Structured arrays are akin to C structs, or derived types in Fortran. \n", "- They allow for the construction of table-like structures composed of combinations of other data types, including other compound types. \n", "- Might be useful for representing multiple parameter values at each point on a grid, or at each time and space location for scattered (point) data. \n", "\n", "Here we create a variable with a compound data type to represent complex data (there is no native complex data type in netCDF). \n", "\n", "- The compound data type is created with the [`createCompoundType`](http://unidata.github.io/netcdf4-python/netCDF4.Dataset-class.html#createCompoundType) method." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# create complex128 numpy structured data type\n", "complex128 = np.dtype([('real',np.float64),('imag',np.float64)])\n", "# using this numpy dtype, create a netCDF compound data type object\n", "# the string name can be used as a key to access the datatype from the cmptypes dictionary.\n", "complex128_t = ncfile.createCompoundType(complex128,'complex128')\n", "# create a variable with this data type, write some data to it.\n", "cmplxvar = grp1.createVariable('cmplx_var',complex128_t,('time','lat','lon'))\n", "# write some data to this variable\n", "# first create some complex random data\n", "nlats = len(lat_dim); nlons = len(lon_dim)\n", "data_arr_cmplx = np.random.uniform(size=(nlats,nlons))+1.j*np.random.uniform(size=(nlats,nlons))\n", "# write this complex data to a numpy complex128 structured array\n", "data_arr = np.empty((nlats,nlons),complex128)\n", "data_arr['real'] = data_arr_cmplx.real; data_arr['imag'] = data_arr_cmplx.imag\n", "cmplxvar[0] = data_arr # write the data to the variable (appending to time dimension)\n", "print(cmplxvar)\n", "data_out = cmplxvar[0] # read one value of data back from variable\n", "print(data_out.dtype, data_out.shape, data_out[0,0])" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 33, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "compound cmplx_var(time, lat, lon)\n", "compound data type: [('real', '\n", "vlen phony_vlen_var(time, lat, lon)\n", "vlen data type: int64\n", "path = /model_run2\n", "unlimited dimensions: time\n", "current shape = (1, 73, 144)\n", "\n", "data =\n", " [[[array([6, 4, 3, 7, 8, 2, 9, 5]) array([9, 9, 2, 2, 9, 9, 6, 4])\n", " array([8, 3, 6]) ..., array([3, 0, 7, 2, 5]) array([7, 7, 9, 7, 3])\n", " array([5, 1])]\n", " [array([2, 5, 0, 6, 9]) array([3, 6, 4, 0, 5, 0, 7, 5])\n", " array([5, 5, 7, 6, 3, 1]) ..., array([2]) array([2, 6]) array([9, 4])]\n", " [array([3, 7, 0, 4, 7, 3, 1, 8, 1]) array([3, 4, 8])\n", " array([8, 8, 3, 9, 8, 7, 5, 3, 6]) ..., array([3, 1, 5, 3, 6, 6, 4])\n", " array([7, 3, 9, 1, 8, 6, 3]) array([1, 0, 0, 2])]\n", " ..., \n", " [array([7, 0, 3, 9]) array([1, 8, 4, 7, 5, 5, 2])\n", " array([8, 1, 1, 6, 5, 4, 7]) ..., array([4]) array([7, 5]) array([1, 6])]\n", " [array([8, 8, 5, 4, 3, 3, 5, 5, 9]) array([0, 6, 8, 5, 5, 9, 8, 6])\n", " array([6, 1, 0, 0, 5, 5]) ..., array([8, 4, 4, 5])\n", " array([1, 6, 3, 2, 3, 3, 2, 3]) array([6, 0, 9, 3, 2, 8, 6, 9])]\n", " [array([8, 7, 4]) array([4, 3, 3, 6, 3, 4]) array([1, 7, 6, 8, 3, 1])\n", " ..., array([6, 2, 5, 6, 3, 9]) array([2, 4, 3]) array([3, 4])]]]\n" ] } ], "prompt_number": 19 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 39, "slide_type": "subslide" }, "slideshow": { "slide_type": "slide" } }, "source": [ "Close the Dataset and examine the contents with ncdump." ] }, { "cell_type": "code", "collapsed": false, "input": [ "ncfile.close()\n", "!ncdump -h data/new2.nc" ], "language": "python", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 41, "slide_helper": "subslide_end" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "fragment" } }, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "netcdf new2 {\r\n", "types:\r\n", " compound complex128 {\r\n", " double real ;\r\n", " double imag ;\r\n", " }; // complex128\r\n", " int64(*) phony_vlen ;\r\n", "dimensions:\r\n", "\tlat = 73 ;\r\n", "\tlon = 144 ;\r\n", "\ttime = UNLIMITED ; // (1 currently)\r\n", "\r\n", "group: model_run1 {\r\n", " variables:\r\n", " \tdouble temp(time, lat, lon) ;\r\n", " \tcomplex128 cmplx_var(time, lat, lon) ;\r\n", " } // group model_run1\r\n", "\r\n", "group: model_run2 {\r\n", " variables:\r\n", " \tdouble temp(time, lat, lon) ;\r\n", " \tphony_vlen phony_vlen_var(time, lat, lon) ;\r\n", " } // group model_run2\r\n", "}\r\n" ] } ], "prompt_number": 20 }, { "cell_type": "markdown", "metadata": { "internals": { "frag_helper": "fragment_end", "frag_number": 41, "slide_helper": "subslide_end", "slide_type": "subslide" }, "slide_helper": "slide_end", "slideshow": { "slide_type": "slide" } }, "source": [ "##Other interesting and useful projects using netcdf4-python\n", "\n", "- [Xray](http://xray.readthedocs.org/en/stable/): N-dimensional variant of the core [pandas](http://pandas.pydata.org) data structure that can operate on netcdf variables.\n", "- [Iris](http://scitools.org.uk/iris/): a data model to create a data abstraction layer which isolates analysis and visualisation code from data format specifics. Uses netcdf4-python to access netcdf data (can also handle GRIB).\n", "- [Biggus](https://github.com/SciTools/biggus): Virtual large arrays (from netcdf variables) with lazy evaluation.\n", "- [cf-python](http://cfpython.bitbucket.org/): Implements the [CF](http://cfconventions.org) data model for the reading, writing and processing of data and metadata. " ] } ], "metadata": {} } ] }netcdf4-python-1.2.2rel/include/000077500000000000000000000000001264125125200165105ustar00rootroot00000000000000netcdf4-python-1.2.2rel/include/constants.pyx000066400000000000000000000001521264125125200212640ustar00rootroot00000000000000DEF HAS_RENAME_GRP = 0 DEF HAS_NC_INQ_PATH = 0 DEF HAS_NC_INQ_FORMAT_EXTENDED = 0 DEF HAS_CDF5_FORMAT = 0 netcdf4-python-1.2.2rel/include/netCDF4.pxi000066400000000000000000001075511264125125200204320ustar00rootroot00000000000000# size_t, ptrdiff_t are defined in stdlib.h cdef extern from "stdlib.h": ctypedef long size_t ctypedef long ptrdiff_t void *malloc(size_t size) void free(void *ptr) # hdf5 version info. cdef extern from "H5public.h": cdef char *H5_VERS_INFO cdef char *H5_VERS_SUBRELEASE cdef enum: H5_VERS_MAJOR H5_VERS_MINOR H5_VERS_RELEASE # netcdf version info. #cdef extern from "netcdf_meta.h": # cdef char *NC_VERSION_NOTE # cdef enum: # NC_VERSION_MAJOR # NC_VERSION_MINOR # NC_VERSION_PATCH cdef extern from *: ctypedef char* const_char_ptr "const char*" # netcdf functions. cdef extern from "netcdf.h": ctypedef int nclong ctypedef int nc_type ctypedef struct nc_vlen_t: size_t len # Length of VL data (in base type units) void *p # Pointer to VL data # default fill values. # could define these in the anonymous enum, but then they # would be assumed to be integers. #define NC_FILL_BYTE ((signed char)-127) #define NC_FILL_CHAR ((char)0) #define NC_FILL_SHORT ((short)-32767) #define NC_FILL_INT (-2147483647L) #define NC_FILL_FLOAT (9.9692099683868690e+36f) /* near 15 * 2^119 */ #define NC_FILL_DOUBLE (9.9692099683868690e+36) #define NC_FILL_UBYTE (255) #define NC_FILL_USHORT (65535) #define NC_FILL_UINT (4294967295U) #define NC_FILL_INT64 ((long long)-9223372036854775806) #define NC_FILL_UINT64 ((unsigned long long)18446744073709551614) float NC_FILL_FLOAT long NC_FILL_INT double NC_FILL_DOUBLE char NC_FILL_CHAR long long NC_FILL_INT64 unsigned long NC_FILL_UINT unsigned long long NC_FILL_UINT64 cdef enum: NC_NAT # NAT = 'Not A Type' (c.f. NaN) NC_BYTE # signed 1 byte integer NC_CHAR # ISO/ASCII character NC_SHORT # signed 2 byte integer NC_INT # signed 4 byte integer NC_LONG # deprecated, but required for backward compatibility. NC_FLOAT # single precision floating point number NC_DOUBLE # double precision floating point number NC_UBYTE # unsigned 1 byte int NC_USHORT # unsigned 2-byte int NC_UINT # unsigned 4-byte int NC_INT64 # signed 8-byte int NC_UINT64 # unsigned 8-byte int NC_STRING # string NC_VLEN # used internally for vlen types NC_OPAQUE # used internally for opaque types NC_COMPOUND # used internally for compound types NC_ENUM # used internally for enum types. # Use these 'mode' flags for nc_open. NC_NOWRITE # default is read only NC_WRITE # read & write # Use these 'mode' flags for nc_create. NC_CLOBBER NC_NOCLOBBER # Don't destroy existing file on create NC_64BIT_OFFSET # Use large (64-bit) file offsets NC_NETCDF4 # Use netCDF-4/HDF5 format NC_CLASSIC_MODEL # Enforce strict netcdf-3 rules. # Use these 'mode' flags for both nc_create and nc_open. NC_SHARE # Share updates, limit cacheing NC_MPIIO NC_MPIPOSIX # The following flag currently is ignored, but use in # nc_open() or nc_create() may someday support use of advisory # locking to prevent multiple writers from clobbering a file NC_LOCK # Use locking if available # Default fill values, used unless _FillValue attribute is set. # These values are stuffed into newly allocated space as appropriate. # The hope is that one might use these to notice that a particular datum # has not been set. NC_FILL_BYTE #NC_FILL_CHAR NC_FILL_SHORT #NC_FILL_INT #NC_FILL_FLOAT #NC_FILL_DOUBLE NC_FILL_UBYTE NC_FILL_USHORT #NC_FILL_UINT #NC_FILL_INT64 #NC_FILL_UINT64 # These represent the max and min values that can be stored in a # netCDF file for their associated types. Recall that a C compiler # may define int to be any length it wants, but a NC_INT is *always* # a 4 byte signed int. On a platform with has 64 bit ints, there will # be many ints which are outside the range supported by NC_INT. But # since NC_INT is an external format, it has to mean the same thing # everywhere. NC_MAX_BYTE NC_MIN_BYTE NC_MAX_CHAR NC_MAX_SHORT NC_MIN_SHORT NC_MAX_INT NC_MIN_INT NC_MAX_FLOAT NC_MIN_FLOAT NC_MAX_DOUBLE8 NC_MIN_DOUBLE NC_MAX_UBYTE NC_MAX_USHORT NC_MAX_UINT NC_MAX_INT64 NC_MIN_INT64 NC_MAX_UINT64 X_INT64_MAX X_INT64_MIN X_UINT64_MAX # The above values are defaults. # If you wish a variable to use a different value than the above # defaults, create an attribute with the same type as the variable # and the following reserved name. The value you give the attribute # will be used as the fill value for that variable. _FillValue NC_FILL NC_NOFILL # Starting with version 3.6, there are different format netCDF # files. 4.0 instroduces the third one. These defines are only for # the nc_set_default_format function. NC_FORMAT_CLASSIC NC_FORMAT_64BIT NC_FORMAT_64BIT_OFFSET NC_FORMAT_64BIT_DATA NC_FORMAT_NETCDF4 NC_FORMAT_NETCDF4_CLASSIC NC_FORMAT_NC3 NC_FORMAT_NC_HDF4 NC_FORMAT_NC_HDF5 NC_FORMAT_DAP2 NC_FORMAT_DAP4 NC_FORMAT_PNETCDF NC_FORMAT_UNDEFINED # Let nc__create() or nc__open() figure out # as suitable chunk size. NC_SIZEHINT_DEFAULT # In nc__enddef(), align to the chunk size. NC_ALIGN_CHUNK # 'size' argument to ncdimdef for an unlimited dimension NC_UNLIMITED # attribute id to put/get a global attribute NC_GLOBAL # These maximums are enforced by the interface, to facilitate writing # applications and utilities. However, nothing is statically allocated to # these sizes internally. NC_MAX_DIMS NC_MAX_ATTRS NC_MAX_VARS NC_MAX_NAME NC_MAX_VAR_DIMS # Algorithms for netcdf-4 chunking. NC_CHUNK_SEQ NC_CHUNK_SUB NC_CHUNK_SIZES NC_CHUNKED NC_CONTIGUOUS # The netcdf version 3 functions all return integer error status. # These are the possible values, in addition to certain # values from the system errno.h. NC_ISSYSERR NC_NOERR NC2_ERR NC_EBADID NC_ENFILE NC_EEXIST NC_EINVAL NC_EPERM NC_ENOTINDEFINE NC_EINDEFINE NC_EINVALCOORDS NC_EMAXDIMS NC_ENAMEINUSE NC_ENOTATT NC_EMAXATTS NC_EBADTYPE NC_EBADDIM NC_EUNLIMPOS NC_EMAXVARS NC_ENOTVAR NC_EGLOBAL NC_ENOTNC NC_ESTS NC_EMAXNAME NC_EUNLIMIT NC_ENORECVARS NC_ECHAR NC_EEDGE NC_ESTRIDE NC_EBADNAME # N.B. following must match value in ncx.h NC_ERANGE # Math result not representable NC_ENOMEM # Memory allocation (malloc) failure NC_EVARSIZE # One or more variable sizes violate format constraints NC_EDIMSIZE # Invalid dimension size NC_ETRUNC # NetCDFFile likely truncated or possibly corrupted # The following was added in support of netcdf-4. Make all netcdf-4 # error codes < -100 so that errors can be added to netcdf-3 if # needed. NC4_FIRST_ERROR NC_EHDFERR NC_ECANTREAD NC_ECANTWRITE NC_ECANTCREATE NC_EFILEMETA NC_EDIMMETA NC_EATTMETA NC_EVARMETA NC_ENOCOMPOUND NC_EATTEXISTS NC_ENOTNC4 NC_ESTRICTNC3 NC_ENOTNC3 NC_ENOPAR NC_EPARINIT NC_EBADGRPID NC_EBADTYPID NC_ETYPDEFINED NC_EBADFIELD NC_EBADCLASS NC4_LAST_ERROR NC_ENDIAN_NATIVE NC_ENDIAN_LITTLE NC_ENDIAN_BIG NC_SZIP_EC_OPTION_MASK # entropy encoding NC_SZIP_NN_OPTION_MASK # nearest neighbor encoding const_char_ptr *nc_inq_libvers() nogil const_char_ptr *nc_strerror(int ncerr) int nc_create(char *path, int cmode, int *ncidp) int nc__create(char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp) int nc_open(char *path, int mode, int *ncidp) int nc__open(char *path, int mode, size_t *chunksizehintp, int *ncidp) int nc_inq_path(int ncid, size_t *pathlen, char *path) nogil int nc_inq_format_extended(int ncid, int *formatp, int* modep) nogil int nc_inq_ncid(int ncid, char *name, int *grp_ncid) nogil int nc_inq_grps(int ncid, int *numgrps, int *ncids) nogil int nc_inq_grpname(int ncid, char *name) nogil int nc_inq_grp_parent(int ncid, int *parent_ncid) nogil int nc_inq_varids(int ncid, int *nvars, int *varids) nogil int nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents) nogil int nc_def_grp(int parent_ncid, char *name, int *new_ncid) int nc_def_compound(int ncid, size_t size, char *name, nc_type *typeidp) int nc_insert_compound(int ncid, nc_type xtype, char *name, size_t offset, nc_type field_typeid) int nc_insert_array_compound(int ncid, nc_type xtype, char *name, size_t offset, nc_type field_typeid, int ndims, int *dim_sizes) int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size) nogil int nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *size, size_t *nfieldsp) nogil int nc_inq_compound_name(int ncid, nc_type xtype, char *name) nogil int nc_inq_compound_size(int ncid, nc_type xtype, size_t *size) nogil int nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp) nogil int nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type *field_typeidp, int *ndimsp, int *dim_sizesp) nogil int nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, char *name) nogil int nc_inq_compound_fieldindex(int ncid, nc_type xtype, char *name, int *fieldidp) nogil int nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, size_t *offsetp) nogil int nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, nc_type *field_typeidp) nogil int nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, int *ndimsp) nogil int nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, int *dim_sizes) nogil int nc_def_vlen(int ncid, char *name, nc_type base_typeid, nc_type *xtypep) int nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type *base_nc_typep) nogil int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type *base_nc_typep, size_t *nfieldsp, int *classp) nogil int nc_inq_typeids(int ncid, int *ntypes, int *typeids) nogil int nc_put_att(int ncid, int varid, char *name, nc_type xtype, size_t len, void *op) int nc_get_att(int ncid, int varid, char *name, void *ip) nogil int nc_get_att_string(int ncid, int varid, char *name, char **ip) nogil int nc_put_att_string(int ncid, int varid, char *name, size_t len, char **op) nogil int nc_def_opaque(int ncid, size_t size, char *name, nc_type *xtypep) int nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep) int nc_put_att_opaque(int ncid, int varid, char *name, size_t len, void *op) int nc_get_att_opaque(int ncid, int varid, char *name, void *ip) int nc_put_cmp_att_opaque(int ncid, nc_type xtype, int fieldid, char *name, size_t len, void *op) int nc_get_cmp_att_opaque(int ncid, nc_type xtype, int fieldid, char *name, void *ip) int nc_put_var1(int ncid, int varid, size_t *indexp, void *op) int nc_get_var1(int ncid, int varid, size_t *indexp, void *ip) int nc_put_vara(int ncid, int varid, size_t *startp, size_t *countp, void *op) int nc_get_vara(int ncid, int varid, size_t *startp, size_t *countp, void *ip) nogil int nc_put_vars(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, void *op) int nc_get_vars(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, void *ip) nogil int nc_put_varm(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, void *op) int nc_get_varm(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, void *ip) int nc_put_var(int ncid, int varid, void *op) int nc_get_var(int ncid, int varid, void *ip) int nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, int deflate_level) int nc_def_var_fletcher32(int ncid, int varid, int fletcher32) int nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p) nogil int nc_def_var_chunking(int ncid, int varid, int contiguous, size_t *chunksizesp) int nc_def_var_fill(int ncid, int varid, int no_fill, void *fill_value) int nc_def_var_endian(int ncid, int varid, int endian) int nc_inq_var_chunking(int ncid, int varid, int *contiguousp, size_t *chunksizesp) nogil int nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp) nogil int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_value) nogil int nc_inq_var_endian(int ncid, int varid, int *endianp) nogil int nc_set_fill(int ncid, int fillmode, int *old_modep) int nc_set_default_format(int format, int *old_formatp) int nc_redef(int ncid) int nc__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align) int nc_enddef(int ncid) int nc_sync(int ncid) int nc_abort(int ncid) int nc_close(int ncid) int nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp) nogil int nc_inq_ndims(int ncid, int *ndimsp) nogil int nc_inq_nvars(int ncid, int *nvarsp) nogil int nc_inq_natts(int ncid, int *nattsp) nogil int nc_inq_unlimdim(int ncid, int *unlimdimidp) nogil int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp) nogil int nc_inq_format(int ncid, int *formatp) nogil int nc_def_dim(int ncid, char *name, size_t len, int *idp) int nc_inq_dimid(int ncid, char *name, int *idp) nogil int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp) nogil int nc_inq_dimname(int ncid, int dimid, char *name) nogil int nc_inq_dimlen(int ncid, int dimid, size_t *lenp) nogil int nc_rename_dim(int ncid, int dimid, char *name) int nc_inq_att(int ncid, int varid, char *name, nc_type *xtypep, size_t *lenp) nogil int nc_inq_attid(int ncid, int varid, char *name, int *idp) nogil int nc_inq_atttype(int ncid, int varid, char *name, nc_type *xtypep) nogil int nc_inq_attlen(int ncid, int varid, char *name, size_t *lenp) nogil int nc_inq_attname(int ncid, int varid, int attnum, char *name) nogil int nc_copy_att(int ncid_in, int varid_in, char *name, int ncid_out, int varid_out) int nc_rename_att(int ncid, int varid, char *name, char *newname) int nc_del_att(int ncid, int varid, char *name) int nc_put_att_text(int ncid, int varid, char *name, size_t len, char *op) int nc_get_att_text(int ncid, int varid, char *name, char *ip) nogil int nc_put_att_uchar(int ncid, int varid, char *name, nc_type xtype, size_t len, unsigned char *op) int nc_get_att_uchar(int ncid, int varid, char *name, unsigned char *ip) int nc_put_att_schar(int ncid, int varid, char *name, nc_type xtype, size_t len, signed char *op) int nc_get_att_schar(int ncid, int varid, char *name, signed char *ip) int nc_put_att_short(int ncid, int varid, char *name, nc_type xtype, size_t len, short *op) int nc_get_att_short(int ncid, int varid, char *name, short *ip) int nc_put_att_int(int ncid, int varid, char *name, nc_type xtype, size_t len, int *op) int nc_get_att_int(int ncid, int varid, char *name, int *ip) int nc_put_att_long(int ncid, int varid, char *name, nc_type xtype, size_t len, long *op) int nc_get_att_long(int ncid, int varid, char *name, long *ip) int nc_put_att_float(int ncid, int varid, char *name, nc_type xtype, size_t len, float *op) int nc_get_att_float(int ncid, int varid, char *name, float *ip) int nc_put_att_double(int ncid, int varid, char *name, nc_type xtype, size_t len, double *op) int nc_get_att_double(int ncid, int varid, char *name, double *ip) int nc_put_att_ushort(int ncid, int varid, char *name, nc_type xtype, size_t len, unsigned short *op) int nc_get_att_ushort(int ncid, int varid, char *name, unsigned short *ip) int nc_put_att_uint(int ncid, int varid, char *name, nc_type xtype, size_t len, unsigned int *op) int nc_get_att_uint(int ncid, int varid, char *name, unsigned int *ip) int nc_put_att_longlong(int ncid, int varid, char *name, nc_type xtype, size_t len, long long *op) int nc_get_att_longlong(int ncid, int varid, char *name, long long *ip) int nc_put_att_ulonglong(int ncid, int varid, char *name, nc_type xtype, size_t len, unsigned long long *op) int nc_get_att_ulonglong(int ncid, int varid, char *name, unsigned long long *ip) int nc_def_var(int ncid, char *name, nc_type xtype, int ndims, int *dimidsp, int *varidp) int nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp) nogil int nc_inq_varid(int ncid, char *name, int *varidp) nogil int nc_inq_varname(int ncid, int varid, char *name) nogil int nc_inq_vartype(int ncid, int varid, nc_type *xtypep) nogil int nc_inq_varndims(int ncid, int varid, int *ndimsp) nogil int nc_inq_vardimid(int ncid, int varid, int *dimidsp) nogil int nc_inq_varnatts(int ncid, int varid, int *nattsp) nogil int nc_rename_var(int ncid, int varid, char *name) int nc_copy_var(int ncid_in, int varid, int ncid_out) int nc_put_var1_text(int ncid, int varid, size_t *indexp, char *op) int nc_get_var1_text(int ncid, int varid, size_t *indexp, char *ip) int nc_put_var1_uchar(int ncid, int varid, size_t *indexp, unsigned char *op) int nc_get_var1_uchar(int ncid, int varid, size_t *indexp, unsigned char *ip) int nc_put_var1_schar(int ncid, int varid, size_t *indexp, signed char *op) int nc_get_var1_schar(int ncid, int varid, size_t *indexp, signed char *ip) int nc_put_var1_short(int ncid, int varid, size_t *indexp, short *op) int nc_get_var1_short(int ncid, int varid, size_t *indexp, short *ip) int nc_put_var1_int(int ncid, int varid, size_t *indexp, int *op) int nc_get_var1_int(int ncid, int varid, size_t *indexp, int *ip) int nc_put_var1_long(int ncid, int varid, size_t *indexp, long *op) int nc_get_var1_long(int ncid, int varid, size_t *indexp, long *ip) int nc_put_var1_float(int ncid, int varid, size_t *indexp, float *op) int nc_get_var1_float(int ncid, int varid, size_t *indexp, float *ip) int nc_put_var1_double(int ncid, int varid, size_t *indexp, double *op) int nc_get_var1_double(int ncid, int varid, size_t *indexp, double *ip) int nc_put_var1_ubyte(int ncid, int varid, size_t *indexp, unsigned char *op) int nc_get_var1_ubyte(int ncid, int varid, size_t *indexp, unsigned char *ip) int nc_put_var1_ushort(int ncid, int varid, size_t *indexp, unsigned short *op) int nc_get_var1_ushort(int ncid, int varid, size_t *indexp, unsigned short *ip) int nc_put_var1_uint(int ncid, int varid, size_t *indexp, unsigned int *op) int nc_get_var1_uint(int ncid, int varid, size_t *indexp, unsigned int *ip) int nc_put_var1_longlong(int ncid, int varid, size_t *indexp, long long *op) int nc_get_var1_longlong(int ncid, int varid, size_t *indexp, long long *ip) int nc_put_var1_ulonglong(int ncid, int varid, size_t *indexp, unsigned long long *op) int nc_get_var1_ulonglong(int ncid, int varid, size_t *indexp, unsigned long long *ip) int nc_put_vara_text(int ncid, int varid, size_t *startp, size_t *countp, char *op) int nc_get_vara_text(int ncid, int varid, size_t *startp, size_t *countp, char *ip) int nc_put_vara_uchar(int ncid, int varid, size_t *startp, size_t *countp, unsigned char *op) int nc_get_vara_uchar(int ncid, int varid, size_t *startp, size_t *countp, unsigned char *ip) int nc_put_vara_schar(int ncid, int varid, size_t *startp, size_t *countp, signed char *op) int nc_get_vara_schar(int ncid, int varid, size_t *startp, size_t *countp, signed char *ip) int nc_put_vara_short(int ncid, int varid, size_t *startp, size_t *countp, short *op) int nc_get_vara_short(int ncid, int varid, size_t *startp, size_t *countp, short *ip) int nc_put_vara_int(int ncid, int varid, size_t *startp, size_t *countp, int *op) int nc_get_vara_int(int ncid, int varid, size_t *startp, size_t *countp, int *ip) int nc_put_vara_long(int ncid, int varid, size_t *startp, size_t *countp, long *op) int nc_get_vara_long(int ncid, int varid, size_t *startp, size_t *countp, long *ip) int nc_put_vara_float(int ncid, int varid, size_t *startp, size_t *countp, float *op) int nc_get_vara_float(int ncid, int varid, size_t *startp, size_t *countp, float *ip) int nc_put_vara_double(int ncid, int varid, size_t *startp, size_t *countp, double *op) int nc_get_vara_double(int ncid, int varid, size_t *startp, size_t *countp, double *ip) int nc_put_vara_ubyte(int ncid, int varid, size_t *startp, size_t *countp, unsigned char *op) int nc_get_vara_ubyte(int ncid, int varid, size_t *startp, size_t *countp, unsigned char *ip) int nc_put_vara_ushort(int ncid, int varid, size_t *startp, size_t *countp, unsigned short *op) int nc_get_vara_ushort(int ncid, int varid, size_t *startp, size_t *countp, unsigned short *ip) int nc_put_vara_uint(int ncid, int varid, size_t *startp, size_t *countp, unsigned int *op) int nc_get_vara_uint(int ncid, int varid, size_t *startp, size_t *countp, unsigned int *ip) int nc_put_vara_longlong(int ncid, int varid, size_t *startp, size_t *countp, long long *op) int nc_get_vara_longlong(int ncid, int varid, size_t *startp, size_t *countp, long long *ip) int nc_put_vara_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, unsigned long long *op) int nc_get_vara_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, unsigned long long *ip) int nc_put_vars_text(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, char *op) int nc_get_vars_text(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, char *ip) int nc_put_vars_uchar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned char *op) int nc_get_vars_uchar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned char *ip) int nc_put_vars_schar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, signed char *op) int nc_get_vars_schar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, signed char *ip) int nc_put_vars_short(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, short *op) int nc_get_vars_short(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, short *ip) int nc_put_vars_int(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, int *op) int nc_get_vars_int(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, int *ip) int nc_put_vars_long(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, long *op) int nc_get_vars_long(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, long *ip) int nc_put_vars_float(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, float *op) int nc_get_vars_float(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, float *ip) int nc_put_vars_double(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, double *op) int nc_get_vars_double(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, double *ip) int nc_put_vars_ubyte(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned char *op) int nc_get_vars_ubyte(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned char *ip) int nc_put_vars_ushort(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned short *op) int nc_get_vars_ushort(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned short *ip) int nc_put_vars_uint(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned int *op) int nc_get_vars_uint(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned int *ip) int nc_put_vars_longlong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, long long *op) int nc_get_vars_longlong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, long long *ip) int nc_put_vars_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned long long *op) int nc_get_vars_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, unsigned long long *ip) int nc_put_varm_text(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, char *op) int nc_get_varm_text(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, char *ip) int nc_put_varm_uchar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, unsigned char *op) int nc_get_varm_uchar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, unsigned char *ip) int nc_put_varm_schar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, signed char *op) int nc_get_varm_schar(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, signed char *ip) int nc_put_varm_short(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, short *op) int nc_get_varm_short(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, short *ip) int nc_put_varm_int(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, int *op) int nc_get_varm_int(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, int *ip) int nc_put_varm_long(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, long *op) int nc_get_varm_long(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, long *ip) int nc_put_varm_float(int ncid, int varid,size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, float *op) int nc_get_varm_float(int ncid, int varid,size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, float *ip) int nc_put_varm_double(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t *imapp, double *op) int nc_get_varm_double(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, double *ip) int nc_put_varm_ubyte(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned char *op) int nc_get_varm_ubyte(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned char *ip) int nc_put_varm_ushort(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned short *op) int nc_get_varm_ushort(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned short *ip) int nc_put_varm_uint(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned int *op) int nc_get_varm_uint(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned int *ip) int nc_put_varm_longlong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, long long *op) int nc_get_varm_longlong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, long long *ip) int nc_put_varm_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned long long *op) int nc_get_varm_ulonglong(int ncid, int varid, size_t *startp, size_t *countp, ptrdiff_t *stridep, ptrdiff_t * imapp, unsigned long long *ip) int nc_put_var_text(int ncid, int varid, char *op) int nc_get_var_text(int ncid, int varid, char *ip) int nc_put_var_uchar(int ncid, int varid, unsigned char *op) int nc_get_var_uchar(int ncid, int varid, unsigned char *ip) int nc_put_var_schar(int ncid, int varid, signed char *op) int nc_get_var_schar(int ncid, int varid, signed char *ip) int nc_put_var_short(int ncid, int varid, short *op) int nc_get_var_short(int ncid, int varid, short *ip) int nc_put_var_int(int ncid, int varid, int *op) int nc_get_var_int(int ncid, int varid, int *ip) int nc_put_var_long(int ncid, int varid, long *op) int nc_get_var_long(int ncid, int varid, long *ip) int nc_put_var_float(int ncid, int varid, float *op) int nc_get_var_float(int ncid, int varid, float *ip) int nc_put_var_double(int ncid, int varid, double *op) int nc_get_var_double(int ncid, int varid, double *ip) int nc_put_var_ubyte(int ncid, int varid, unsigned char *op) int nc_get_var_ubyte(int ncid, int varid, unsigned char *ip) int nc_put_var_ushort(int ncid, int varid, unsigned short *op) int nc_get_var_ushort(int ncid, int varid, unsigned short *ip) int nc_put_var_uint(int ncid, int varid, unsigned int *op) int nc_get_var_uint(int ncid, int varid, unsigned int *ip) int nc_put_var_longlong(int ncid, int varid, long long *op) int nc_get_var_longlong(int ncid, int varid, long long *ip) int nc_put_var_ulonglong(int ncid, int varid, unsigned long long *op) int nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip) # set logging verbosity level. void nc_set_log_level(int new_level) int nc_show_metadata(int ncid) int nc_free_vlen(nc_vlen_t *vl) int nc_free_vlens(size_t len, nc_vlen_t *vl) int nc_free_string(size_t len, char **data) int nc_set_chunk_cache(size_t size, size_t nelems, float preemption) int nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp) int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption) int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp) nogil int nc_rename_grp(int grpid, char *name) int nc_def_enum(int ncid, nc_type base_typeid, char *name, nc_type *typeidp) int nc_insert_enum(int ncid, nc_type xtype, char *name, void *value) int nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep,\ size_t *base_sizep, size_t *num_membersp) nogil int nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, void *value) nogil int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier) nogil # taken from numpy.pxi in numpy 1.0rc2. cdef extern from "numpy/arrayobject.h": ctypedef int npy_intp ctypedef extern class numpy.ndarray [object PyArrayObject]: cdef char *data cdef int nd cdef npy_intp *dimensions cdef npy_intp *strides cdef object base # cdef dtype descr cdef int flags npy_intp PyArray_SIZE(ndarray arr) npy_intp PyArray_ISCONTIGUOUS(ndarray arr) npy_intp PyArray_ISALIGNED(ndarray arr) void import_array() netcdf4-python-1.2.2rel/man/000077500000000000000000000000001264125125200156405ustar00rootroot00000000000000netcdf4-python-1.2.2rel/man/nc3tonc4.1000066400000000000000000000061631264125125200173630ustar00rootroot00000000000000.\" (C) Copyright 2015, Ross Gammon , .\" .TH NC3TONC4 1 "22 Mar 2015" .\" .SH NAME nc3tonc4 \- a program to convert netCDF 3 files to netCDF 4 format files .SH SYNOPSIS .B nc3tonc4 .RB [ \-h ] .RB [ \-o ] .RB [ \-\-vars=\fIvar1,var2,..\fR ] .RB [ \-\-zlib=\fI(0|1)\fR ] .RB [ \-\-complevel=\fI(1\-9)\fR ] .RB [ \-\-shuffle=\fI(0|1)\fR ] .RB [ \-\-fletcher32=\fI(0|1)\fR ] .RB [ \-\-unpackshort=\fI(0|1)\fR ] .RB [ \-\-quantize=\fIvar1=n1,var2=n2,..\fR ] .I netcdf3filename .I netcdf4filename .br .SH DESCRIPTION This manual page documents briefly the .B nc3tonc4 command. .PP \fBnc3tonc4\fP is a program that converts a netCDF 3 file into netCDF 4 format, optionally unpacking variables packed as short integers (with scale_factor and add_offset) to floats, and adding zlib compression (with the HDF5 shuffle filter and fletcher32 checksum). Data may also be quantized (truncated) to a specified precision to improve compression. .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP .B \-h Shows a summary of the available options. .TP .B \-o Overwite destination file (default is to raise an error if output file already exists). .TP .B \-\-vars A comma separated list of variable names to copy (default is to copy all variables). .TP .B \-\-classic=(0|1) Use NETCDF4_CLASSIC format instead of NETCDF4 (default = 1). .TP .B \-\-zlib=(0|1) Activate (or disable) zlib compression (the default is to activate). .TP .B \-\-complevel=(1-9) Set the zlib compression level (6 is default). .TP .B \-\-shuffle=(0|1) Activate (or disable) the shuffle filter (it is active by default). .TP .B \-\-fletcher32=(0|1) Activate (or disable) the fletcher32 checksum (it is not active by default). .TP .B \-\-unpackshort=(0|1) Unpack short integer variables to float variables using scale_factor and add_offset netCDF variable attributes (it is active by default). .TP .B \-\-quantize=(comma separated list of "variable name=integer" pairs) Truncate the data in the specified variables to a given decimal precision. For example, 'speed=2, height=-2, temp=0' will cause the variable 'speed' to be truncated to a precision of 0.01, 'height' to a precision of 100 and 'temp' to 1. This can significantly improve compression. The default is not to quantize any of the variables. .TP .B \-\-quiet=(0|1) If set to 1, don't print any diagnostic information. .TP .B \-\-chunk=(integer) The number of records along unlimited dimension to write at once. The default is 10. It is ignored if there is no unlimited dimension. If chunk=0, it means write all the data at once. .TP .B \-\-istart=(integer) The number of the record to start at along unlimited dimension. The default is 0. This option is ignored if there is no unlimited dimension. .TP .B \-\-istop=(integer) The number of the record to stop at along unlimited dimension. The default is 1. This option is ignored if there is no unlimited dimension. .SH SEE ALSO .BR ncinfo (1), .BR nc4tonc3 (1). .br .SH AUTHOR This manual page was written by Ross Gammon based on the options displayed by nc3tonc4 \-h. netcdf4-python-1.2.2rel/man/nc4tonc3.1000066400000000000000000000025351264125125200173620ustar00rootroot00000000000000.\" (C) Copyright 2015, Ross Gammon , .\" .TH NC4TONC3 1 "22 Mar 2015" .\" .SH NAME nc4tonc3 \- a program to convert a classic netCDF 4 file to netCDF 3 format .SH SYNOPSIS .B nc4tonc3 .RB [ \-h ] .RB [ \-o ] .RB [ \-\-chunk ] .I netcdf4filename .I netcdf3filename .br .SH DESCRIPTION This manual page documents briefly the .B nc4tonc3 command. .PP \fBnc4tonc3\fP is a program that converts a netCDF 4 file (in NETCDF4_CLASSIC format) to netCDF 3 format. .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP .B \-h Shows a summary of the available options. .TP .B \-o Overwite destination file (default is to raise an error if output file already exists). .TP .B \-\-quiet=(0|1) If set to 1, don't print any diagnostic information. .TP .B \-\-format Choose the netcdf3 format to use. NETCDF3_64BIT is used by default, or it can be set to NETCDF3_CLASSIC. .TP .B \-\-chunk=(integer) The number of records along unlimited dimension to write at once. The default is 10. It is ignored if there is no unlimited dimension. If chunk=0, this means write all the data at once. .SH SEE ALSO .BR ncinfo (1), .BR nc3tonc4 (1). .br .SH AUTHOR This manual page was written by Ross Gammon based on the options displayed by nc3tonc4 \-h. netcdf4-python-1.2.2rel/man/ncinfo.1000066400000000000000000000024401264125125200171760ustar00rootroot00000000000000.\" (C) Copyright 2015, Ross Gammon , .\" .TH NCINFO 1 "22 Mar 2015" .\" .SH NAME ncinfo \- a program to print summary information about a netCDF file .SH SYNOPSIS .B ncinfo .RB [ \-h ] .RB [ \-g|\-\-group=\fIgrp\fR ] .RB [ \-v|\-\-variable=\fIvar\fR ] .RB [ \-d|\-\-dimension=\fIdim\fR ] .I filename .br .SH DESCRIPTION This manual page documents briefly the .B ncinfo command. .PP \fBncinfo\fP is a program that prints summary information about a netCDF file .SH OPTIONS These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP .B \-h Shows a summary of the available options. .TP .B \-g grp, \-\-group=grp Prints information for this group. The default group is the root group. Nested groups are specified using posix paths e.g. group1/group2/group3. .TP .B \-v , \-\-variable= Prints information for this variable. .TP .B \-d , \-\-dimension= Prints information for this dimension. .TP The filename of the netCDF file must be supplied as the last argument. .SH SEE ALSO .BR nc3tonc4 (1), .BR nc4tonc3 (1). .br .SH AUTHOR This manual page was written by Ross Gammon based on the options displayed by ncinfo \-h. netcdf4-python-1.2.2rel/netCDF4/000077500000000000000000000000001264125125200162545ustar00rootroot00000000000000netcdf4-python-1.2.2rel/netCDF4/__init__.py000066400000000000000000000011361264125125200203660ustar00rootroot00000000000000# init for netCDF4. package # Docstring comes from extension module _netCDF4. from ._netCDF4 import * # Need explicit imports for names beginning with underscores from ._netCDF4 import __doc__, __pdoc__ from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__, __has_rename_grp__, __has_nc_inq_path__, __has_nc_inq_format_extended__) __all__ =\ ['Dataset','Variable','Dimension','Group','MFDataset','MFTime','CompoundType','VLType','date2num','num2date','date2index','stringtochar','chartostring','stringtoarr','getlibversion','EnumType'] netcdf4-python-1.2.2rel/netCDF4/_netCDF4.c000066400000000000000000175330551264125125200177710ustar00rootroot00000000000000/* Generated by Cython 0.23.4 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else #define CYTHON_ABI "0_23_4" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #else #define CYTHON_PEP393_ENABLED 0 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__netCDF4___netCDF4 #define __PYX_HAVE_API__netCDF4___netCDF4 #include "string.h" #include "stdlib.h" #include "H5public.h" #include "netcdf.h" #include "numpy/arrayobject.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) && defined (_M_X64) #define __Pyx_sst_abs(value) _abs64(value) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen #endif #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_COMPILING_IN_CPYTHON #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "netCDF4/_netCDF4.pyx", "include/netCDF4.pxi", }; /*--- Type declarations ---*/ struct __pyx_obj_7netCDF4_8_netCDF4_Dataset; struct __pyx_obj_7netCDF4_8_netCDF4_Group; struct __pyx_obj_7netCDF4_8_netCDF4_Dimension; struct __pyx_obj_7netCDF4_8_netCDF4_Variable; struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType; struct __pyx_obj_7netCDF4_8_netCDF4_VLType; struct __pyx_obj_7netCDF4_8_netCDF4_EnumType; struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr; struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_vlen; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_enum; struct __pyx_opt_args_7netCDF4_8_netCDF4__strencode; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; /* "netCDF4/_netCDF4.pyx":1200 * return 'UNDEFINED' * * cdef _set_att(grp, int varid, name, value, nc_type xtype=-99): # <<<<<<<<<<<<<< * # Private function to set an attribute name/value pair * cdef int i, ierr, lenarr, n */ struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att { int __pyx_n; nc_type xtype; }; /* "netCDF4/_netCDF4.pyx":4568 * return xtype * * cdef _read_compound(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a compound data type id from an existing file, * # construct a corresponding numpy dtype instance, */ struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound { int __pyx_n; PyObject *endian; }; /* "netCDF4/_netCDF4.pyx":4737 * return xtype, dt * * cdef _read_vlen(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a VLEN data type id from an existing file, * # construct a corresponding numpy dtype instance, */ struct __pyx_opt_args_7netCDF4_8_netCDF4__read_vlen { int __pyx_n; PyObject *endian; }; /* "netCDF4/_netCDF4.pyx":4856 * return xtype, dt * * cdef _read_enum(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a Enum data type id from an existing file, * # construct a corresponding numpy dtype instance, */ struct __pyx_opt_args_7netCDF4_8_netCDF4__read_enum { int __pyx_n; PyObject *endian; }; /* "netCDF4/_netCDF4.pyx":4892 * return EnumType(group, dt, name, enum_dict, typeid=xtype) * * cdef _strencode(pystr,encoding=None): # <<<<<<<<<<<<<< * # encode a string into bytes. If already bytes, do nothing. * # uses default_encoding module variable for default encoding. */ struct __pyx_opt_args_7netCDF4_8_netCDF4__strencode { int __pyx_n; PyObject *encoding; }; struct __pyx_defaults { PyObject *__pyx_arg_exclude; }; /* "netCDF4/_netCDF4.pyx":1539 * __pdoc__ = {} * * cdef class Dataset: # <<<<<<<<<<<<<< * """ * A netCDF `netCDF4.Dataset` is a collection of dimensions, groups, variables and */ struct __pyx_obj_7netCDF4_8_netCDF4_Dataset { PyObject_HEAD PyObject *__weakref__; int _grpid; int _isopen; PyObject *groups; PyObject *dimensions; PyObject *variables; PyObject *disk_format; PyObject *path; PyObject *parent; PyObject *file_format; PyObject *data_model; PyObject *cmptypes; PyObject *vltypes; PyObject *enumtypes; PyObject *__orthogonal_indexing__; PyObject *keepweakref; }; /* "netCDF4/_netCDF4.pyx":2510 * * * cdef class Group(Dataset): # <<<<<<<<<<<<<< * """ * Groups define a hierarchical namespace within a netCDF file. They are */ struct __pyx_obj_7netCDF4_8_netCDF4_Group { struct __pyx_obj_7netCDF4_8_netCDF4_Dataset __pyx_base; }; /* "netCDF4/_netCDF4.pyx":2605 * * * cdef class Dimension: # <<<<<<<<<<<<<< * """ * A netCDF `netCDF4.Dimension` is used to describe the coordinates of a `netCDF4.Variable`. */ struct __pyx_obj_7netCDF4_8_netCDF4_Dimension { PyObject_HEAD int _dimid; int _grpid; PyObject *_data_model; PyObject *_name; PyObject *_grp; }; /* "netCDF4/_netCDF4.pyx":2766 * return False * * cdef class Variable: # <<<<<<<<<<<<<< * """ * A netCDF `netCDF4.Variable` is used to read and write netCDF data. They are */ struct __pyx_obj_7netCDF4_8_netCDF4_Variable { PyObject_HEAD int _varid; int _grpid; int _nunlimdim; PyObject *_name; PyObject *ndim; PyObject *dtype; PyObject *mask; PyObject *scale; PyObject *_isprimitive; PyObject *_iscompound; PyObject *_isvlen; PyObject *_isenum; PyObject *_grp; PyObject *_cmptype; PyObject *_vltype; PyObject *_enumtype; PyObject *__orthogonal_indexing__; }; /* "netCDF4/_netCDF4.pyx":4407 * # Compound datatype support. * * cdef class CompoundType: # <<<<<<<<<<<<<< * """ * A `netCDF4.CompoundType` instance is used to describe a compound data */ struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType { PyObject_HEAD nc_type _nc_type; PyObject *dtype; PyObject *name; }; /* "netCDF4/_netCDF4.pyx":4652 * # VLEN datatype support. * * cdef class VLType: # <<<<<<<<<<<<<< * """ * A `netCDF4.VLType` instance is used to describe a variable length (VLEN) data */ struct __pyx_obj_7netCDF4_8_netCDF4_VLType { PyObject_HEAD nc_type _nc_type; PyObject *dtype; PyObject *name; }; /* "netCDF4/_netCDF4.pyx":4766 * # Enum datatype support. * * cdef class EnumType: # <<<<<<<<<<<<<< * """ * A `netCDF4.EnumType` instance is used to describe an Enum data */ struct __pyx_obj_7netCDF4_8_netCDF4_EnumType { PyObject_HEAD nc_type _nc_type; PyObject *dtype; PyObject *name; PyObject *enum_dict; }; /* "netCDF4/_netCDF4.pyx":1020 * _format_dict['NETCDF3_64BIT'] = NC_FORMAT_64BIT * # invert dictionary mapping * _reverse_format_dict = dict((v, k) for k, v in _format_dict.iteritems()) # <<<<<<<<<<<<<< * # add duplicate entry (NETCDF3_64BIT == NETCDF3_64BIT_OFFSET) * IF HAS_CDF5_FORMAT: */ struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_v_k; PyObject *__pyx_v_v; }; /* --- Runtime support code (head) --- */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif static PyObject *__Pyx_GetBuiltinName(PyObject *name); static CYTHON_INLINE int __Pyx_IterFinish(void); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name, Py_ssize_t* p_orig_length, int* p_is_dict); static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); #include static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION < 3 #define __Pyx_PyBytes_Join _PyString_Join #else #define __Pyx_PyBytes_Join _PyBytes_Join #endif #else static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ ((likely((cfunc)->func)) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) PyErr_SetObject(PyExc_KeyError, args); Py_XDECREF(args); } return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #endif static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\ PyObject_RichCompare(op1, op2, Py_EQ) #endif #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); static double __Pyx__PyObject_AsDouble(PyObject* obj); #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_AsDouble(obj)\ (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ likely(PyInt_CheckExact(obj)) ?\ PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) #else #define __Pyx_PyObject_AsDouble(obj)\ ((likely(PyFloat_CheckExact(obj))) ?\ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) #endif #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace); #else #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\ ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2))) #endif static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #if CYTHON_COMPILING_IN_CPYTHON PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; Py_DECREF(none); return 0; #else return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); #endif } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #define __Pyx_CyFunction_USED 1 #include #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); typedef struct { int code_line; PyCodeObject* code_object; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_nc_type(nc_type value); static CYTHON_INLINE nc_type __Pyx_PyInt_As_nc_type(PyObject *); static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); static CYTHON_INLINE ptrdiff_t __Pyx_PyInt_As_ptrdiff_t(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value); static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *); typedef struct { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure, PyObject *name, PyObject *qualname); static int __Pyx_Coroutine_clear(PyObject *self); #if 1 || PY_VERSION_HEX < 0x030300B0 static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue); #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue) #endif static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); static int __Pyx_patch_abc(void); #define __Pyx_Generator_USED static PyTypeObject *__pyx_GeneratorType = 0; #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) #define __Pyx_Generator_New(body, closure, name, qualname)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(void); static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif static PyObject *__Pyx_ImportModule(const char *name); static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.string' */ /* Module declarations from 'numpy' */ /* Module declarations from 'netCDF4._netCDF4' */ static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_ndarray = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_Dataset = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_Group = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_Dimension = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_Variable = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_CompoundType = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_VLType = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4_EnumType = 0; static PyTypeObject *__pyx_ptype_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr = 0; static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_att_names(int, int); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_att(PyObject *, int, PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_format(int); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_full_format(int); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__set_att(PyObject *, int, PyObject *, PyObject *, struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_types(PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_dims(PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_grps(PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_vars(PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_compound(PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__find_cmptype(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_compound(PyObject *, nc_type, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_vlen(PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_vlen(PyObject *, nc_type, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_vlen *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_enum(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_enum(PyObject *, nc_type, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_enum *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7netCDF4_8_netCDF4__strencode(PyObject *, struct __pyx_opt_args_7netCDF4_8_netCDF4__strencode *__pyx_optional_args); /*proto*/ #define __Pyx_MODULE_NAME "netCDF4._netCDF4" int __pyx_module_is_main_netCDF4___netCDF4 = 0; /* Implementation of 'netCDF4._netCDF4' */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_sum; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_UnicodeDecodeError; static char __pyx_k_[] = "\000"; static char __pyx_k_1[] = "1"; static char __pyx_k_O[] = "O"; static char __pyx_k_S[] = "S"; static char __pyx_k_U[] = "U"; static char __pyx_k_V[] = "V"; static char __pyx_k_a[] = "a"; static char __pyx_k_b[] = "b"; static char __pyx_k_d[] = "d"; static char __pyx_k_f[] = "f"; static char __pyx_k_i[] = "i"; static char __pyx_k_k[] = "k"; static char __pyx_k_n[] = "n"; static char __pyx_k_r[] = "r"; static char __pyx_k_s[] = "(%s)"; static char __pyx_k_t[] = "t"; static char __pyx_k_u[] = "u'"; static char __pyx_k_v[] = "v"; static char __pyx_k_w[] = "w"; static char __pyx_k_0m[] = "\033[0m"; static char __pyx_k_4m[] = " \033[4m"; static char __pyx_k_S1[] = "S1"; static char __pyx_k__2[] = ""; static char __pyx_k_as[] = "as"; static char __pyx_k_bs[] = "bs"; static char __pyx_k_dt[] = "dt"; static char __pyx_k_f4[] = "f4"; static char __pyx_k_f8[] = "f8"; static char __pyx_k_i0[] = "i0"; static char __pyx_k_i1[] = "i1"; static char __pyx_k_i2[] = "i2"; static char __pyx_k_i4[] = "i4"; static char __pyx_k_i8[] = "i8"; static char __pyx_k_id[] = "id"; static char __pyx_k_iu[] = "iu"; static char __pyx_k_ma[] = "ma"; static char __pyx_k_n1[] = "n1"; static char __pyx_k_nv[] = "nv"; static char __pyx_k_td[] = "td"; static char __pyx_k_u1[] = "u1"; static char __pyx_k_u2[] = "u2"; static char __pyx_k_u4[] = "u4"; static char __pyx_k_u8[] = "u8"; static char __pyx_k_ws[] = "ws"; static char __pyx_k__14[] = "<"; static char __pyx_k__15[] = ">"; static char __pyx_k__16[] = "/"; static char __pyx_k__19[] = "'"; static char __pyx_k__21[] = ", "; static char __pyx_k__22[] = ","; static char __pyx_k__24[] = ",)"; static char __pyx_k__25[] = ")"; static char __pyx_k__28[] = "__"; static char __pyx_k__36[] = "="; static char __pyx_k__37[] = "|"; static char __pyx_k_all[] = "all"; static char __pyx_k_any[] = "any"; static char __pyx_k_arr[] = "arr"; static char __pyx_k_big[] = "big"; static char __pyx_k_cdf[] = "_cdf"; static char __pyx_k_cnt[] = "cnt"; static char __pyx_k_dat[] = "dat"; static char __pyx_k_day[] = "day"; static char __pyx_k_dim[] = "dim"; static char __pyx_k_doc[] = "__doc__"; static char __pyx_k_get[] = "_get"; static char __pyx_k_grp[] = "grp"; static char __pyx_k_idx[] = "idx"; static char __pyx_k_ind[] = "ind"; static char __pyx_k_key[] = "_key"; static char __pyx_k_len[] = "__len__"; static char __pyx_k_lst[] = "lst"; static char __pyx_k_msg[] = "msg"; static char __pyx_k_num[] = "num"; static char __pyx_k_pop[] = "pop"; static char __pyx_k_put[] = "put"; static char __pyx_k_r_2[] = "r+"; static char __pyx_k_r_3[] = "%r\n"; static char __pyx_k_r_s[] = "r+s"; static char __pyx_k_s_2[] = "s"; static char __pyx_k_s_s[] = " %s: %s\n"; static char __pyx_k_sta[] = "sta"; static char __pyx_k_str[] = "str"; static char __pyx_k_sum[] = "sum"; static char __pyx_k_sys[] = "sys"; static char __pyx_k_val[] = "val"; static char __pyx_k_var[] = "var"; static char __pyx_k_vid[] = "vid"; static char __pyx_k_zip[] = "zip"; static char __pyx_k_HDF4[] = "HDF4"; static char __pyx_k__128[] = "."; static char __pyx_k_args[] = "args"; static char __pyx_k_bool[] = "bool"; static char __pyx_k_cdfm[] = "cdfm"; static char __pyx_k_char[] = "char"; static char __pyx_k_copy[] = "copy"; static char __pyx_k_data[] = "data"; static char __pyx_k_date[] = "date"; static char __pyx_k_days[] = "days"; static char __pyx_k_dict[] = "__dict__"; static char __pyx_k_dims[] = "_dims"; static char __pyx_k_dset[] = "dset"; static char __pyx_k_elem[] = "elem"; static char __pyx_k_enum[] = "enum"; static char __pyx_k_f4_2[] = ">> f.createDimension(\"x\",None)\n >>> x = f.createVariable(\"x\",\"i\",(\"x\",))\n >>> x[0:10] = numpy.arange(nf*10,10*(nf+1))\n >>> f.close()\n >>> # now read all those files in at once, in one Dataset.\n >>> f = MFDataset(\"mftest*nc\")\n >>> print f.variables[\"x\"][:]\n [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24\n 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\n 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74\n 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]\n "; static char __pyx_k_Class_providing_an_interface_to[] = "\nClass providing an interface to a MFDataset time Variable by imposing a unique common\ntime unit to all files. \n\nExample usage (See `netCDF4.MFTime.__init__` for more details):\n\n :::python\n >>> import numpy\n >>> f1 = Dataset(\"mftest_1.nc\",\"w\", format=\"NETCDF4_CLASSIC\")\n >>> f2 = Dataset(\"mftest_2.nc\",\"w\", format=\"NETCDF4_CLASSIC\")\n >>> f1.createDimension(\"time\",None)\n >>> f2.createDimension(\"time\",None)\n >>> t1 = f1.createVariable(\"time\",\"i\",(\"time\",))\n >>> t2 = f2.createVariable(\"time\",\"i\",(\"time\",))\n >>> t1.units = \"days since 2000-01-01\"\n >>> t2.units = \"days since 2000-02-01\"\n >>> t1.calendar = \"standard\"\n >>> t2.calendar = \"standard\"\n >>> t1[:] = numpy.arange(31)\n >>> t2[:] = numpy.arange(30)\n >>> f1.close()\n >>> f2.close()\n >>> # Read the two files in at once, in one Dataset.\n >>> f = MFDataset(\"mftest*nc\")\n >>> t = f.variables[\"time\"]\n >>> print t.units\n days since 2000-01-01\n >>> print t[32] # The value written in the file, inconsistent with the MF time units.\n 1\n >>> T = MFTime(t)\n >>> print T[32]\n 32\n "; static char __pyx_k_FillValue_attribute_must_be_set[] = "_FillValue attribute must be set when variable is "; static char __pyx_k_The_vltypes_dictionary_maps_the[] = "The `vltypes` dictionary maps the names of\n variable-length types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the\n `netCDF4.VLType` class."; static char __pyx_k_Users_jsw_python_netcdf4_python[] = "/Users/jsw/python/netcdf4-python.git/netCDF4/_netCDF4.pyx"; static char __pyx_k_Variable_object_no_longer_valid[] = "Variable object no longer valid"; static char __pyx_k_Version_1_2_2_Introduction_netc[] = "\nVersion 1.2.2\n-------------\n- - - \n\nIntroduction\n============\n\nnetcdf4-python is a Python interface to the netCDF C library. \n\n[netCDF](http://www.unidata.ucar.edu/software/netcdf/) version 4 has many features\nnot found in earlier versions of the library and is implemented on top of\n[HDF5](http://www.hdfgroup.org/HDF5). This module can read and write\nfiles in both the new netCDF 4 and the old netCDF 3 format, and can create\nfiles that are readable by HDF5 clients. The API modelled after\n[Scientific.IO.NetCDF](http://dirac.cnrs-orleans.fr/ScientificPython/),\nand should be familiar to users of that module.\n\nMost new features of netCDF 4 are implemented, such as multiple\nunlimited dimensions, groups and zlib data compression. All the new\nnumeric data types (such as 64 bit and unsigned integer types) are\nimplemented. Compound (struct), variable length (vlen) and\nenumerated (enum) data types are supported, but not the opaque data type.\nMixtures of compound, vlen and enum data types (such as\ncompound types containing enums, or vlens containing compound\ntypes) are not supported.\n\nDownload\n========\n\n - Latest bleeding-edge code from the \n [github repository](http://github.com/Unidata/netcdf4-python).\n - Latest [releases](https://pypi.python.org/pypi/netCDF4)\n (source code and windows installers).\n\nRequires\n========\n\n - Python 2.6 or later (python 3 works too).\n - [numpy array module](http://numpy.scipy.org), version 1.7.0 or later.\n - [Cython](http://cython.org), version 0.19 or later, is optional - if it is installed setup.py will\n use it to recompile the Cython source code into C, using conditional compilation\n to enable features in the netCDF API that have been added since version 4.1.1. If\n Cython is not installed, these features (such as the ability to rename Group objects)\n will be disabled to preserve backward compatibility with older versions of the netCDF\n library.\n - For python < 2.7, the [ordereddict"" module](http://python.org/pypi/ordereddict).\n - The HDF5 C library version 1.8.4-patch1 or higher (1.8.8 or higher\n recommended) from [](ftp://ftp.hdfgroup.org/HDF5/current/src).\n Be sure to build with `--enable-hl --enable-shared`.\n - [Libcurl](http://curl.haxx.se/libcurl), if you want\n [OPeNDAP](http://opendap.org) support.\n - [HDF4](http://www.hdfgroup.org/products/hdf4), if you want\n to be able to read HDF4 \"Scientific Dataset\" (SD) files.\n - The netCDF-4 C library from \n [ftp://ftp.unidata.ucar.edu/pub/netcdf](ftp://ftp.unidata.ucar.edu/pub/netcdf).\n Version 4.1.1 or higher is required (4.2 or higher recommended).\n Be sure to build with `--enable-netcdf-4 --enable-shared`, and set\n `CPPFLAGS=\"-I $HDF5_DIR/include\"` and `LDFLAGS=\"-L $HDF5_DIR/lib\"`,\n where `$HDF5_DIR` is the directory where HDF5 was installed.\n If you want [OPeNDAP](http://opendap.org) support, add `--enable-dap`.\n If you want HDF4 SD support, add `--enable-hdf4` and add\n the location of the HDF4 headers and library to `$CPPFLAGS` and `$LDFLAGS`.\n\n\nInstall\n=======\n\n - install the requisite python modules and C libraries (see above). It's\n easiest if all the C libs are built as shared libraries.\n - By default, the utility `nc-config`, installed with netcdf 4.1.2 or higher,\n will be run used to determine where all the dependencies live.\n - If `nc-config` is not in your default `$PATH`, rename the\n file `setup.cfg.template` to `setup.cfg`, then edit\n in a text editor (follow the instructions in the comments).\n In addition to specifying the path to `nc-config`,\n you can manually set the paths to all the libraries and their include files\n (in case `nc-config` does not do the right thing).\n - run `python setup.py build`, then `python setup.py install` (as root if\n necessary).\n - [`pip install`](https://pip.pypa.io/en/latest/reference/pip_install.html) can\n also be used, with library paths set with environment variables. To make\n this work, the `USE_SETUPC""FG` environment variable must be used to tell \n setup.py not to use `setup.cfg`.\n For example, `USE_SETUPCFG=0 HDF5_INCDIR=/usr/include/hdf5/serial\n HDF5_LIBDIR=/usr/lib/x86_64-linux-gnu/hdf5/serial pip install` has been\n shown to work on an Ubuntu/Debian linux system. Similarly, environment variables\n (all capitalized) can be used to set the include and library paths for\n `hdf5`, `netCDF4`, `hdf4`, `szip`, `jpeg`, `curl` and `zlib`. If the\n libraries are installed in standard places (e.g. `/usr` or `/usr/local`), \n the environment variables do not need to be set.\n - run the tests in the 'test' directory by running `python run_all.py`.\n\nTutorial\n========\n\n1. [Creating/Opening/Closing a netCDF file.](#section1)\n2. [Groups in a netCDF file.](#section2)\n3. [Dimensions in a netCDF file.](#section3)\n4. [Variables in a netCDF file.](#section4)\n5. [Attributes in a netCDF file.](#section5)\n6. [Writing data to and retrieving data from a netCDF variable.](#section6)\n7. [Dealing with time coordinates.](#section7)\n8. [Reading data from a multi-file netCDF dataset.](#section8)\n9. [Efficient compression of netCDF variables.](#section9)\n10. [Beyond homogeneous arrays of a fixed type - compound data types.](#section10)\n11. [Variable-length (vlen) data types.](#section11)\n12. [Enum data type.](#section12)\n\n\n##
1) Creating/Opening/Closing a netCDF file.\n\nTo create a netCDF file from python, you simply call the `netCDF4.Dataset`\nconstructor. This is also the method used to open an existing netCDF\nfile. If the file is open for write access (`mode='w', 'r+'` or `'a'`), you may\nwrite any type of data including new dimensions, groups, variables and\nattributes. netCDF files come in five flavors (`NETCDF3_CLASSIC,\nNETCDF3_64BIT_OFFSET, NETCDF3_64BIT_DATA, NETCDF4_CLASSIC`, and `NETCDF4`). \n`NETCDF3_CLASSIC` was the original netcdf binary format, and was limited \nto file sizes less than 2 Gb. `NETCDF3_64BIT_OFFSET` was"" introduced\nin version 3.6.0 of the library, and extended the original binary format\nto allow for file sizes greater than 2 Gb. \n`NETCDF3_64BIT_DATA` is a new format that requires version 4.4.0 of\nthe C library - it extends the `NETCDF3_64BIT_OFFSET` binary format to\nallow for unsigned/64 bit integer data types and 64-bit dimension sizes.\n`NETCDF3_64BIT` is an alias for `NETCDF3_64BIT_OFFSET`.\n`NETCDF4_CLASSIC` files use the version 4 disk format (HDF5), but omits features\nnot found in the version 3 API. They can be read by netCDF 3 clients\nonly if they have been relinked against the netCDF 4 library. They can\nalso be read by HDF5 clients. `NETCDF4` files use the version 4 disk\nformat (HDF5) and use the new features of the version 4 API. The\n`netCDF4` module can read and write files in any of these formats. When\ncreating a new file, the format may be specified using the `format`\nkeyword in the `Dataset` constructor. The default format is\n`NETCDF4`. To see how a given file is formatted, you can examine the\n`data_model` attribute. Closing the netCDF file is\naccomplished via the `netCDF4.Dataset.close` method of the `netCDF4.Dataset`\ninstance.\n\nHere's an example:\n\n :::python\n >>> from netCDF4 import Dataset\n >>> rootgrp = Dataset(\"test.nc\", \"w\", format=\"NETCDF4\")\n >>> print rootgrp.data_model\n NETCDF4\n >>> rootgrp.close()\n\nRemote [OPeNDAP](http://opendap.org)-hosted datasets can be accessed for\nreading over http if a URL is provided to the `netCDF4.Dataset` constructor instead of a\nfilename. However, this requires that the netCDF library be built with\nOPenDAP support, via the `--enable-dap` configure option (added in\nversion 4.0.1).\n\n\n##
2) Groups in a netCDF file.\n\nnetCDF version 4 added support for organizing data in hierarchical\ngroups, which are analagous to directories in a filesystem. Groups serve\nas containers for variables, dimensions and attributes, as well as other\ngroups."" A `netCDF4.Dataset` defines creates a special group, called\nthe 'root group', which is similar to the root directory in a unix\nfilesystem. To create `netCDF4.Group` instances, use the\n`netCDF4.Dataset.createGroup` method of a `netCDF4.Dataset` or `netCDF4.Group`\ninstance. `netCDF4.Dataset.createGroup` takes a single argument, a\npython string containing the name of the new group. The new `netCDF4.Group`\ninstances contained within the root group can be accessed by name using\nthe `groups` dictionary attribute of the `netCDF4.Dataset` instance. Only\n`NETCDF4` formatted files support Groups, if you try to create a Group\nin a netCDF 3 file you will get an error message.\n\n :::python\n >>> rootgrp = Dataset(\"test.nc\", \"a\")\n >>> fcstgrp = rootgrp.createGroup(\"forecasts\")\n >>> analgrp = rootgrp.createGroup(\"analyses\")\n >>> print rootgrp.groups\n OrderedDict([(\"forecasts\", \n ),\n (\"analyses\", \n )])\n\nGroups can exist within groups in a `netCDF4.Dataset`, just as directories\nexist within directories in a unix filesystem. Each `netCDF4.Group` instance\nhas a `groups` attribute dictionary containing all of the group\ninstances contained within that group. Each `netCDF4.Group` instance also has a\n`path` attribute that contains a simulated unix directory path to\nthat group. To simplify the creation of nested groups, you can\nuse a unix-like path as an argument to `netCDF4.Dataset.createGroup`.\n\n :::python\n >>> fcstgrp1 = rootgrp.createGroup(\"/forecasts/model1\")\n >>> fcstgrp2 = rootgrp.createGroup(\"/forecasts/model2\")\n\nIf any of the intermediate elements of the path do not exist, they are created,\njust as with the unix command `'mkdir -p'`. If you try to create a group\nthat already exists, no error will be raised, and the existing group will be \nreturned.\n\nHere's an exa""mple that shows how to navigate all the groups in a\n`netCDF4.Dataset`. The function `walktree` is a Python generator that is used\nto walk the directory tree. Note that printing the `netCDF4.Dataset` or `netCDF4.Group`\nobject yields summary information about it's contents.\n\n :::python\n >>> def walktree(top):\n >>> values = top.groups.values()\n >>> yield values\n >>> for value in top.groups.values():\n >>> for children in walktree(value):\n >>> yield children\n >>> print rootgrp\n >>> for children in walktree(rootgrp):\n >>> for child in children:\n >>> print child\n \n root group (NETCDF4 file format):\n dimensions:\n variables:\n groups: forecasts, analyses\n \n group /forecasts:\n dimensions:\n variables:\n groups: model1, model2\n \n group /analyses:\n dimensions:\n variables:\n groups:\n \n group /forecasts/model1:\n dimensions:\n variables:\n groups:\n \n group /forecasts/model2:\n dimensions:\n variables:\n groups:\n\n##
3) Dimensions in a netCDF file.\n\nnetCDF defines the sizes of all variables in terms of dimensions, so\nbefore any variables can be created the dimensions they use must be\ncreated first. A special case, not often used in practice, is that of a\nscalar variable, which has no dimensions. A dimension is created using\nthe `netCDF4.Dataset.createDimension` method of a `netCDF4.Dataset`\nor `netCDF4.Group` instance. A Python string is used to set the name of the\ndimension, and an integer value is used to set the size. To create an\nunlimited dimension (a dimension that can be appended to), the size\nvalue is set to `None` or 0. In this example, th""ere both the `time` and\n`level` dimensions are unlimited. Having more than one unlimited\ndimension is a new netCDF 4 feature, in netCDF 3 files there may be only\none, and it must be the first (leftmost) dimension of the variable.\n\n :::python\n >>> level = rootgrp.createDimension(\"level\", None)\n >>> time = rootgrp.createDimension(\"time\", None)\n >>> lat = rootgrp.createDimension(\"lat\", 73)\n >>> lon = rootgrp.createDimension(\"lon\", 144)\n\n\nAll of the `netCDF4.Dimension` instances are stored in a python dictionary.\n\n :::python\n >>> print rootgrp.dimensions\n OrderedDict([(\"level\", ),\n (\"time\", ),\n (\"lat\", ),\n (\"lon\", )])\n\nCalling the python `len` function with a `netCDF4.Dimension` instance returns\nthe current size of that dimension.\nThe `netCDF4.Dimension.isunlimited` method of a `netCDF4.Dimension` instance\ncan be used to determine if the dimensions is unlimited, or appendable.\n\n :::python\n >>> print len(lon)\n 144\n >>> print len.isunlimited()\n False\n >>> print time.isunlimited()\n True\n\nPrinting the `netCDF4.Dimension` object\nprovides useful summary info, including the name and length of the dimension,\nand whether it is unlimited.\n\n :::python\n >>> for dimobj in rootgrp.dimensions.values():\n >>> print dimobj\n (unlimited): name = \"level\", size = 0\n (unlimited): name = \"time\", size = 0\n : name = \"lat\", size = 73\n : name = \"lon\", size = 144\n (unlimited): name = \"time\", size = 0\n\n`netCDF4.Dimension` names can be c""hanged using the\n`netCDF4.Datatset.renameDimension` method of a `netCDF4.Dataset` or\n`netCDF4.Group` instance.\n\n##
4) Variables in a netCDF file.\n\nnetCDF variables behave much like python multidimensional array objects\nsupplied by the [numpy module](http://numpy.scipy.org). However,\nunlike numpy arrays, netCDF4 variables can be appended to along one or\nmore 'unlimited' dimensions. To create a netCDF variable, use the\n`netCDF4.Dataset.createVariable` method of a `netCDF4.Dataset` or\n`netCDF4.Group` instance. The `netCDF4.Dataset.createVariable` method\nhas two mandatory arguments, the variable name (a Python string), and\nthe variable datatype. The variable's dimensions are given by a tuple\ncontaining the dimension names (defined previously with\n`netCDF4.Dataset.createDimension`). To create a scalar\nvariable, simply leave out the dimensions keyword. The variable\nprimitive datatypes correspond to the dtype attribute of a numpy array.\nYou can specify the datatype as a numpy dtype object, or anything that\ncan be converted to a numpy dtype object. Valid datatype specifiers\ninclude: `'f4'` (32-bit floating point), `'f8'` (64-bit floating\npoint), `'i4'` (32-bit signed integer), `'i2'` (16-bit signed\ninteger), `'i8'` (64-bit singed integer), `'i1'` (8-bit signed\ninteger), `'u1'` (8-bit unsigned integer), `'u2'` (16-bit unsigned\ninteger), `'u4'` (32-bit unsigned integer), `'u8'` (64-bit unsigned\ninteger), or `'S1'` (single-character string). The old Numeric\nsingle-character typecodes (`'f'`,`'d'`,`'h'`,\n`'s'`,`'b'`,`'B'`,`'c'`,`'i'`,`'l'`), corresponding to\n(`'f4'`,`'f8'`,`'i2'`,`'i2'`,`'i1'`,`'i1'`,`'S1'`,`'i4'`,`'i4'`),\nwill also work. The unsigned integer types and the 64-bit integer type\ncan only be used if the file format is `NETCDF4`.\n\nThe dimensions themselves are usually also defined as variables, called\ncoordinate variables. The `netCDF4.Dataset.createVariable`\nmethod returns an instance of the `netCDF4.Variable` ""class whose methods can be\nused later to access and set variable data and attributes.\n\n :::python\n >>> times = rootgrp.createVariable(\"time\",\"f8\",(\"time\",))\n >>> levels = rootgrp.createVariable(\"level\",\"i4\",(\"level\",))\n >>> latitudes = rootgrp.createVariable(\"latitude\",\"f4\",(\"lat\",))\n >>> longitudes = rootgrp.createVariable(\"longitude\",\"f4\",(\"lon\",))\n >>> # two dimensions unlimited\n >>> temp = rootgrp.createVariable(\"temp\",\"f4\",(\"time\",\"level\",\"lat\",\"lon\",))\n\nTo get summary info on a `netCDF4.Variable` instance in an interactive session, just print it.\n\n :::python\n >>> print temp\n \n float32 temp(time, level, lat, lon)\n least_significant_digit: 3\n units: K\n unlimited dimensions: time, level\n current shape = (0, 0, 73, 144)\n\nYou can use a path to create a Variable inside a hierarchy of groups.\n\n :::python\n >>> ftemp = rootgrp.createVariable(\"/forecasts/model1/temp\",\"f4\",(\"time\",\"level\",\"lat\",\"lon\",))\n\nIf the intermediate groups do not yet exist, they will be created.\n\nYou can also query a `netCDF4.Dataset` or `netCDF4.Group` instance directly to obtain `netCDF4.Group` or \n`netCDF4.Variable` instances using paths.\n\n :::python\n >>> print rootgrp[\"/forecasts/model1\"] # a Group instance\n \n group /forecasts/model1:\n dimensions(sizes):\n variables(dimensions): float32 temp(time,level,lat,lon)\n groups:\n >>> print rootgrp[\"/forecasts/model1/temp\"] # a Variable instance\n \n float32 temp(time, level, lat, lon)\n path = /forecasts/model1\n unlimited dimensions: time, level\n current shape = (0, 0, 73, 144)\n filling on, default _FillValue of 9.96920996839e+36 used\n\nAll of the variables in the `netCDF4.Dataset` or `netCDF4.Group` are stored in a\nPython dictionary, in the sa""me way as the dimensions:\n\n :::python\n >>> print rootgrp.variables\n OrderedDict([(\"time\", ),\n (\"level\", ),\n (\"latitude\", ),\n (\"longitude\", ),\n (\"temp\", )])\n\n`netCDF4.Variable` names can be changed using the\n`netCDF4.Dataset.renameVariable` method of a `netCDF4.Dataset`\ninstance.\n\n\n##
5) Attributes in a netCDF file.\n\nThere are two types of attributes in a netCDF file, global and variable.\nGlobal attributes provide information about a group, or the entire\ndataset, as a whole. `netCDF4.Variable` attributes provide information about\none of the variables in a group. Global attributes are set by assigning\nvalues to `netCDF4.Dataset` or `netCDF4.Group` instance variables. `netCDF4.Variable`\nattributes are set by assigning values to `netCDF4.Variable` instances\nvariables. Attributes can be strings, numbers or sequences. Returning to\nour example,\n\n :::python\n >>> import time\n >>> rootgrp.description = \"bogus example script\"\n >>> rootgrp.history = \"Created \" + time.ctime(time.time())\n >>> rootgrp.source = \"netCDF4 python module tutorial\"\n >>> latitudes.units = \"degrees north\"\n >>> longitudes.units = \"degrees east\"\n >>> levels.units = \"hPa\"\n >>> temp.units = \"K\"\n >>> times.units = \"hours since 0001-01-01 00:00:00.0\"\n >>> times.calendar = \"gregorian\"\n\nThe `netCDF4.Dataset.ncattrs` method of a `netCDF4.Dataset`, `netCDF4.Group` or\n`netCDF4.Variable` instance can be used to retrieve the names of all the netCDF\nattributes. This method is provided as a convenience, since using the\nbuilt-in `dir` Python function will return a bunch of private methods\nand attributes that cannot (or should not) be modified ""by the user.\n\n :::python\n >>> for name in rootgrp.ncattrs():\n >>> print \"Global attr\", name, \"=\", getattr(rootgrp,name)\n Global attr description = bogus example script\n Global attr history = Created Mon Nov 7 10.30:56 2005\n Global attr source = netCDF4 python module tutorial\n\nThe `__dict__` attribute of a `netCDF4.Dataset`, `netCDF4.Group` or `netCDF4.Variable`\ninstance provides all the netCDF attribute name/value pairs in a python\ndictionary:\n\n :::python\n >>> print rootgrp.__dict__\n OrderedDict([(u\"description\", u\"bogus example script\"),\n (u\"history\", u\"Created Thu Mar 3 19:30:33 2011\"),\n (u\"source\", u\"netCDF4 python module tutorial\")])\n\nAttributes can be deleted from a netCDF `netCDF4.Dataset`, `netCDF4.Group` or\n`netCDF4.Variable` using the python `del` statement (i.e. `del grp.foo`\nremoves the attribute `foo` the the group `grp`).\n\n##
6) Writing data to and retrieving data from a netCDF variable.\n\nNow that you have a netCDF `netCDF4.Variable` instance, how do you put data\ninto it? You can just treat it like an array and assign data to a slice.\n\n :::python\n >>> import numpy\n >>> lats = numpy.arange(-90,91,2.5)\n >>> lons = numpy.arange(-180,180,2.5)\n >>> latitudes[:] = lats\n >>> longitudes[:] = lons\n >>> print \"latitudes =\\n\",latitudes[:]\n latitudes =\n [-90. -87.5 -85. -82.5 -80. -77.5 -75. -72.5 -70. -67.5 -65. -62.5\n -60. -57.5 -55. -52.5 -50. -47.5 -45. -42.5 -40. -37.5 -35. -32.5\n -30. -27.5 -25. -22.5 -20. -17.5 -15. -12.5 -10. -7.5 -5. -2.5\n 0. 2.5 5. 7.5 10. 12.5 15. 17.5 20. 22.5 25. 27.5\n 30. 32.5 35. 37.5 40. 42.5 45. 47.5 50. 52.5 55. 57.5\n 60. 62.5 65. 67.5 70. 72.5 75. 77.5 80. 82.5 85. 87.5\n 90. ]\n\nUnlike NumPy's array objects, netCDF `netCDF4.Variable`\nobjects with unlimite""d dimensions will grow along those dimensions if you\nassign data outside the currently defined range of indices.\n\n :::python\n >>> # append along two unlimited dimensions by assigning to slice.\n >>> nlats = len(rootgrp.dimensions[\"lat\"])\n >>> nlons = len(rootgrp.dimensions[\"lon\"])\n >>> print \"temp shape before adding data = \",temp.shape\n temp shape before adding data = (0, 0, 73, 144)\n >>>\n >>> from numpy.random import uniform\n >>> temp[0:5,0:10,:,:] = uniform(size=(5,10,nlats,nlons))\n >>> print \"temp shape after adding data = \",temp.shape\n temp shape after adding data = (6, 10, 73, 144)\n >>>\n >>> # levels have grown, but no values yet assigned.\n >>> print \"levels shape after adding pressure data = \",levels.shape\n levels shape after adding pressure data = (10,)\n\nNote that the size of the levels variable grows when data is appended\nalong the `level` dimension of the variable `temp`, even though no\ndata has yet been assigned to levels.\n\n :::python\n >>> # now, assign data to levels dimension variable.\n >>> levels[:] = [1000.,850.,700.,500.,300.,250.,200.,150.,100.,50.]\n\nHowever, that there are some differences between NumPy and netCDF\nvariable slicing rules. Slices behave as usual, being specified as a\n`start:stop:step` triplet. Using a scalar integer index `i` takes the ith\nelement and reduces the rank of the output array by one. Boolean array and\ninteger sequence indexing behaves differently for netCDF variables\nthan for numpy arrays. Only 1-d boolean arrays and integer sequences are\nallowed, and these indices work independently along each dimension (similar\nto the way vector subscripts work in fortran). This means that\n\n :::python\n >>> temp[0, 0, [0,1,2,3], [0,1,2,3]]\n\nreturns an array of shape (4,4) when slicing a netCDF variable, but for a\nnumpy array it returns an array of shape (4,).\nSimilarly, a netCDF variable of shape `(2,3,4,5)` indexed\nwith `""[0, array([True, False, True]), array([False, True, True, True]), :]`\nwould return a `(2, 3, 5)` array. In NumPy, this would raise an error since\nit would be equivalent to `[0, [0,1], [1,2,3], :]`. When slicing with integer\nsequences, the indices ***need not be sorted*** and ***may contain\nduplicates*** (both of these are new features in version 1.2.1).\nWhile this behaviour may cause some confusion for those used to NumPy's 'fancy indexing' rules,\nit provides a very powerful way to extract data from multidimensional netCDF\nvariables by using logical operations on the dimension arrays to create slices.\n\nFor example,\n\n :::python\n >>> tempdat = temp[::2, [1,3,6], lats>0, lons>0]\n\nwill extract time indices 0,2 and 4, pressure levels\n850, 500 and 200 hPa, all Northern Hemisphere latitudes and Eastern\nHemisphere longitudes, resulting in a numpy array of shape (3, 3, 36, 71).\n\n :::python\n >>> print \"shape of fancy temp slice = \",tempdat.shape\n shape of fancy temp slice = (3, 3, 36, 71)\n\n***Special note for scalar variables***: To extract data from a scalar variable\n`v` with no associated dimensions, use `np.asarray(v)` or `v[...]`. The result\nwill be a numpy scalar array.\n\n##
7) Dealing with time coordinates.\n\nTime coordinate values pose a special challenge to netCDF users. Most\nmetadata standards (such as CF) specify that time should be\nmeasure relative to a fixed date using a certain calendar, with units\nspecified like `hours since YY:MM:DD hh-mm-ss`. These units can be\nawkward to deal with, without a utility to convert the values to and\nfrom calendar dates. The functione called `netCDF4.num2date` and `netCDF4.date2num` are\nprovided with this package to do just that. Here's an example of how they\ncan be used:\n\n :::python\n >>> # fill in times.\n >>> from datetime import datetime, timedelta\n >>> from netCDF4 import num2date, date2num\n >>> dates = [datetime(2001,3,1)+n*timedelta""(hours=12) for n in range(temp.shape[0])]\n >>> times[:] = date2num(dates,units=times.units,calendar=times.calendar)\n >>> print \"time values (in units %s): \" % times.units+\"\\n\",times[:]\n time values (in units hours since January 1, 0001):\n [ 17533056. 17533068. 17533080. 17533092. 17533104.]\n >>> dates = num2date(times[:],units=times.units,calendar=times.calendar)\n >>> print \"dates corresponding to time values:\\n\",dates\n dates corresponding to time values:\n [2001-03-01 00:00:00 2001-03-01 12:00:00 2001-03-02 00:00:00\n 2001-03-02 12:00:00 2001-03-03 00:00:00]\n\n`netCDF4.num2date` converts numeric values of time in the specified `units`\nand `calendar` to datetime objects, and `netCDF4.date2num` does the reverse.\nAll the calendars currently defined in the\n[CF metadata convention](http://cfconventions.org) are supported.\nA function called `netCDF4.date2index` is also provided which returns the indices\nof a netCDF time variable corresponding to a sequence of datetime instances.\n\n\n##
8) Reading data from a multi-file netCDF dataset.\n\nIf you want to read data from a variable that spans multiple netCDF files,\nyou can use the `netCDF4.MFDataset` class to read the data as if it were\ncontained in a single file. Instead of using a single filename to create\na `netCDF4.Dataset` instance, create a `netCDF4.MFDataset` instance with either a list\nof filenames, or a string with a wildcard (which is then converted to\na sorted list of files using the python glob module).\nVariables in the list of files that share the same unlimited\ndimension are aggregated together, and can be sliced across multiple\nfiles. To illustrate this, let's first create a bunch of netCDF files with\nthe same variable (with the same unlimited dimension). The files\nmust in be in `NETCDF3_64BIT_OFFSET`, `NETCDF3_64BIT_DATA`, `NETCDF3_CLASSIC` or\n`NETCDF4_CLASSIC` format (`NETCDF4` formatted multi-file\ndatasets are not support""ed).\n\n :::python\n >>> for nf in range(10):\n >>> f = Dataset(\"mftest%s.nc\" % nf,\"w\")\n >>> f.createDimension(\"x\",None)\n >>> x = f.createVariable(\"x\",\"i\",(\"x\",))\n >>> x[0:10] = numpy.arange(nf*10,10*(nf+1))\n >>> f.close()\n\nNow read all the files back in at once with `netCDF4.MFDataset`\n\n :::python\n >>> from netCDF4 import MFDataset\n >>> f = MFDataset(\"mftest*nc\")\n >>> print f.variables[\"x\"][:]\n [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24\n 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49\n 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74\n 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]\n\nNote that `netCDF4.MFDataset` can only be used to read, not write, multi-file\ndatasets.\n\n##
9) Efficient compression of netCDF variables.\n\nData stored in netCDF 4 `netCDF4.Variable` objects can be compressed and\ndecompressed on the fly. The parameters for the compression are\ndetermined by the `zlib`, `complevel` and `shuffle` keyword arguments\nto the `netCDF4.Dataset.createVariable` method. To turn on\ncompression, set `zlib=True`. The `complevel` keyword regulates the\nspeed and efficiency of the compression (1 being fastest, but lowest\ncompression ratio, 9 being slowest but best compression ratio). The\ndefault value of `complevel` is 4. Setting `shuffle=False` will turn\noff the HDF5 shuffle filter, which de-interlaces a block of data before\ncompression by reordering the bytes. The shuffle filter can\nsignificantly improve compression ratios, and is on by default. Setting\n`fletcher32` keyword argument to\n`netCDF4.Dataset.createVariable` to `True` (it's `False` by\ndefault) enables the Fletcher32 checksum algorithm for error detection.\nIt's also possible to set the HDF5 chunking parameters and endian-ness\nof the binary data stored in the ""HDF5 file with the `chunksizes`\nand `endian` keyword arguments to\n`netCDF4.Dataset.createVariable`. These keyword arguments only\nare relevant for `NETCDF4` and `NETCDF4_CLASSIC` files (where the\nunderlying file format is HDF5) and are silently ignored if the file\nformat is `NETCDF3_CLASSIC`, `NETCDF3_64BIT_OFFSET` or `NETCDF3_64BIT_DATA`.\n\nIf your data only has a certain number of digits of precision (say for\nexample, it is temperature data that was measured with a precision of\n0.1 degrees), you can dramatically improve zlib compression by\nquantizing (or truncating) the data using the `least_significant_digit`\nkeyword argument to `netCDF4.Dataset.createVariable`. The least\nsignificant digit is the power of ten of the smallest decimal place in\nthe data that is a reliable value. For example if the data has a\nprecision of 0.1, then setting `least_significant_digit=1` will cause\ndata the data to be quantized using `numpy.around(scale*data)/scale`, where\nscale = 2**bits, and bits is determined so that a precision of 0.1 is\nretained (in this case bits=4). Effectively, this makes the compression\n'lossy' instead of 'lossless', that is some precision in the data is\nsacrificed for the sake of disk space.\n\nIn our example, try replacing the line\n\n :::python\n >>> temp = rootgrp.createVariable(\"temp\",\"f4\",(\"time\",\"level\",\"lat\",\"lon\",))\n\nwith\n\n :::python\n >>> temp = dataset.createVariable(\"temp\",\"f4\",(\"time\",\"level\",\"lat\",\"lon\",),zlib=True)\n\nand then\n\n :::python\n >>> temp = dataset.createVariable(\"temp\",\"f4\",(\"time\",\"level\",\"lat\",\"lon\",),zlib=True,least_significant_digit=3)\n\nand see how much smaller the resulting files are.\n\n##
10) Beyond homogeneous arrays of a fixed type - compound data types.\n\nCompound data types map directly to numpy structured (a.k.a 'record'\narrays). Structured arrays are akin to C structs, or derived types\nin Fortran. They allow for the con""struction of table-like structures\ncomposed of combinations of other data types, including other\ncompound types. Compound types might be useful for representing multiple\nparameter values at each point on a grid, or at each time and space\nlocation for scattered (point) data. You can then access all the\ninformation for a point by reading one variable, instead of reading\ndifferent parameters from different variables. Compound data types\nare created from the corresponding numpy data type using the\n`netCDF4.Dataset.createCompoundType` method of a `netCDF4.Dataset` or `netCDF4.Group` instance.\nSince there is no native complex data type in netcdf, compound types are handy\nfor storing numpy complex arrays. Here's an example:\n\n :::python\n >>> f = Dataset(\"complex.nc\",\"w\")\n >>> size = 3 # length of 1-d complex array\n >>> # create sample complex data.\n >>> datac = numpy.exp(1j*(1.+numpy.linspace(0, numpy.pi, size)))\n >>> # create complex128 compound data type.\n >>> complex128 = numpy.dtype([(\"real\",numpy.float64),(\"imag\",numpy.float64)])\n >>> complex128_t = f.createCompoundType(complex128,\"complex128\")\n >>> # create a variable with this data type, write some data to it.\n >>> f.createDimension(\"x_dim\",None)\n >>> v = f.createVariable(\"cmplx_var\",complex128_t,\"x_dim\")\n >>> data = numpy.empty(size,complex128) # numpy structured array\n >>> data[\"real\"] = datac.real; data[\"imag\"] = datac.imag\n >>> v[:] = data # write numpy structured array to netcdf compound var\n >>> # close and reopen the file, check the contents.\n >>> f.close(); f = Dataset(\"complex.nc\")\n >>> v = f.variables[\"cmplx_var\"]\n >>> datain = v[:] # read in all the data into a numpy structured array\n >>> # create an empty numpy complex array\n >>> datac2 = numpy.empty(datain.shape,numpy.complex128)\n >>> # .. fill it with contents of structured array.\n >>> datac2.real = datain[\"real\"]; datac2.imag ="" datain[\"imag\"]\n >>> print datac.dtype,datac # original data\n complex128 [ 0.54030231+0.84147098j -0.84147098+0.54030231j -0.54030231-0.84147098j]\n >>>\n >>> print datac2.dtype,datac2 # data from file\n complex128 [ 0.54030231+0.84147098j -0.84147098+0.54030231j -0.54030231-0.84147098j]\n\nCompound types can be nested, but you must create the 'inner'\nones first. All of the compound types defined for a `netCDF4.Dataset` or `netCDF4.Group` are stored in a\nPython dictionary, just like variables and dimensions. As always, printing\nobjects gives useful summary information in an interactive session:\n\n :::python\n >>> print f\n \n root group (NETCDF4 file format):\n dimensions: x_dim\n variables: cmplx_var\n groups:\n \n >>> print f.variables[\"cmplx_var\"]\n compound cmplx_var(x_dim)\n compound data type: [(\"real\", \">> print f.cmptypes\n OrderedDict([(\"complex128\", )])\n >>> print f.cmptypes[\"complex128\"]\n : name = \"complex128\", numpy dtype = [(u\"real\",\"11) Variable-length (vlen) data types.\n\nNetCDF 4 has support for variable-length or \"ragged\" arrays. These are arrays\nof variable length sequences having the same type. To create a variable-length\ndata type, use the `netCDF4.Dataset.createVLType` method\nmethod of a `netCDF4.Dataset` or `netCDF4.Group` instance.\n\n :::python\n >>> f = Dataset(\"tst_vlen.nc\",\"w\")\n >>> vlen_t = f.createVLType(numpy.int32, \"phony_vlen\")\n\nThe numpy datatype of the variable-length sequences and the name of the\nnew datatype must be specified. Any of the primitive datatypes can be\nused (signed and unsigned integers, 32 and 64 bi""t floats, and characters),\nbut compound data types cannot.\nA new variable can then be created using this datatype.\n\n :::python\n >>> x = f.createDimension(\"x\",3)\n >>> y = f.createDimension(\"y\",4)\n >>> vlvar = f.createVariable(\"phony_vlen_var\", vlen_t, (\"y\",\"x\"))\n\nSince there is no native vlen datatype in numpy, vlen arrays are represented\nin python as object arrays (arrays of dtype `object`). These are arrays whose\nelements are Python object pointers, and can contain any type of python object.\nFor this application, they must contain 1-D numpy arrays all of the same type\nbut of varying length.\nIn this case, they contain 1-D numpy `int32` arrays of random length betwee\n1 and 10.\n\n :::python\n >>> import random\n >>> data = numpy.empty(len(y)*len(x),object)\n >>> for n in range(len(y)*len(x)):\n >>> data[n] = numpy.arange(random.randint(1,10),dtype=\"int32\")+1\n >>> data = numpy.reshape(data,(len(y),len(x)))\n >>> vlvar[:] = data\n >>> print \"vlen variable =\\n\",vlvar[:]\n vlen variable =\n [[[ 1 2 3 4 5 6 7 8 9 10] [1 2 3 4 5] [1 2 3 4 5 6 7 8]]\n [[1 2 3 4 5 6 7] [1 2 3 4 5 6] [1 2 3 4 5]]\n [[1 2 3 4 5] [1 2 3 4] [1]]\n [[ 1 2 3 4 5 6 7 8 9 10] [ 1 2 3 4 5 6 7 8 9 10]\n [1 2 3 4 5 6 7 8]]]\n >>> print f\n \n root group (NETCDF4 file format):\n dimensions: x, y\n variables: phony_vlen_var\n groups:\n >>> print f.variables[\"phony_vlen_var\"]\n \n vlen phony_vlen_var(y, x)\n vlen data type: int32\n unlimited dimensions:\n current shape = (4, 3)\n >>> print f.VLtypes[\"phony_vlen\"]\n : name = \"phony_vlen\", numpy dtype = int32\n\nNumpy object arrays containing python strings can also be written as vlen\nvariables, For vlen strings, you don't need to create a vlen data type.\nInstead, simply use th""e python `str` builtin (or a numpy string datatype\nwith fixed length greater than 1) when calling the\n`netCDF4.Dataset.createVariable` method.\n\n :::python\n >>> z = f.createDimension(\"z\",10)\n >>> strvar = rootgrp.createVariable(\"strvar\", str, \"z\")\n\nIn this example, an object array is filled with random python strings with\nrandom lengths between 2 and 12 characters, and the data in the object\narray is assigned to the vlen string variable.\n\n :::python\n >>> chars = \"1234567890aabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n >>> data = numpy.empty(10,\"O\")\n >>> for n in range(10):\n >>> stringlen = random.randint(2,12)\n >>> data[n] = \"\".join([random.choice(chars) for i in range(stringlen)])\n >>> strvar[:] = data\n >>> print \"variable-length string variable:\\n\",strvar[:]\n variable-length string variable:\n [aDy29jPt 5DS9X8 jd7aplD b8t4RM jHh8hq KtaPWF9cQj Q1hHN5WoXSiT MMxsVeq tdLUzvVTzj]\n >>> print f\n \n root group (NETCDF4 file format):\n dimensions: x, y, z\n variables: phony_vlen_var, strvar\n groups:\n >>> print f.variables[\"strvar\"]\n \n vlen strvar(z)\n vlen data type: \n unlimited dimensions:\n current size = (10,)\n\nIt is also possible to set contents of vlen string variables with numpy arrays\nof any string or unicode data type. Note, however, that accessing the contents\nof such variables will always return numpy arrays with dtype `object`.\n\n##
12) Enum data type.\n\nnetCDF4 has an enumerated data type, which is an integer datatype that is\nrestricted to certain named values. Since Enums don't map directly to\na numpy data type, they are read and written as integer arrays.\n\nHere's an example of using an Enum type to hold cloud type data. \nThe base integer data type and a python dictionary describing the allowed\nvalue""s and their names are used to define an Enum data type using\n`netCDF4.Dataset.createEnumType`.\n\n :::python\n >>> nc = Dataset('clouds.nc','w')\n >>> # python dict with allowed values and their names.\n >>> enum_dict = {u'Altocumulus': 7, u'Missing': 255, \n >>> u'Stratus': 2, u'Clear': 0,\n >>> u'Nimbostratus': 6, u'Cumulus': 4, u'Altostratus': 5,\n >>> u'Cumulonimbus': 1, u'Stratocumulus': 3}\n >>> # create the Enum type called 'cloud_t'.\n >>> cloud_type = nc.createEnumType(numpy.uint8,'cloud_t',enum_dict)\n >>> print cloud_type\n : name = 'cloud_t',\n numpy dtype = uint8, fields/values ={u'Cumulus': 4,\n u'Altocumulus': 7, u'Missing': 255,\n u'Stratus': 2, u'Clear': 0,\n u'Cumulonimbus': 1, u'Stratocumulus': 3,\n u'Nimbostratus': 6, u'Altostratus': 5}\n\nA new variable can be created in the usual way using this data type.\nInteger data is written to the variable that represents the named\ncloud types in enum_dict. A `ValueError` will be raised if an attempt\nis made to write an integer value not associated with one of the\nspecified names.\n\n :::python\n >>> time = nc.createDimension('time',None)\n >>> # create a 1d variable of type 'cloud_type'.\n >>> # The fill_value is set to the 'Missing' named value.\n >>> cloud_var =\n >>> nc.createVariable('primary_cloud',cloud_type,'time',\n >>> fill_value=enum_dict['Missing'])\n >>> # write some data to the variable.\n >>> cloud_var[:] = [enum_dict['Clear'],enum_dict['Stratus'],\n >>> enum_dict['Cumulus'],enum_dict['Missing'],\n >>> enum_dict['Cumulonimbus']]\n >>> nc.close()\n >>> # reopen the file, read the data.\n >>> nc = Dataset('clouds.nc')\n >>> cloud_var = nc.variables['primary_cloud']\n >>> print cloud_var\n \n enum primary_cloud(time)\n _FillValue: 255\n enum data type: uint8\n unlimited dimensions: time\n current shape = (5"",)\n >>> print cloud_var.datatype.enum_dict\n {u'Altocumulus': 7, u'Missing': 255, u'Stratus': 2,\n u'Clear': 0, u'Nimbostratus': 6, u'Cumulus': 4,\n u'Altostratus': 5, u'Cumulonimbus': 1,\n u'Stratocumulus': 3}\n >>> print cloud_var[:]\n [0 2 4 -- 1]\n >>> nc.close()\n\nAll of the code in this tutorial is available in `examples/tutorial.py`,\nUnit tests are in the `test` directory.\n\n**contact**: Jeffrey Whitaker \n\n**copyright**: 2008 by Jeffrey Whitaker.\n\n**license**: Permission to use, copy, modify, and distribute this software and\nits documentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notice appear in all copies and that\nboth the copyright notice and this permission notice appear in\nsupporting documentation.\nTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO\nEVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR\nCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF\nUSE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n- - -\n"; static char __pyx_k_assign_vlen_method_only_for_use[] = "_assign_vlen method only for use with VLEN variables"; static char __pyx_k_cannot_set__FillValue_attribute[] = "cannot set _FillValue attribute for VLEN or compound variable"; static char __pyx_k_cannot_specify_chunksizes_for_a[] = "cannot specify chunksizes for a contiguous dataset"; static char __pyx_k_current_size_of_Dimension_calls[] = "current size of Dimension (calls `len` on Dimension instance)"; static char __pyx_k_data_model_describes_the_netCDF[] = "`data_model` describes the netCDF\n data model version, one of `NETCDF3_CLASSIC`, `NETCDF4`,\n `NETCDF4_CLASSIC`, `NETCDF3_64BIT_OFFSET` or `NETCDF3_64BIT_DATA`."; static char __pyx_k_disk_format_describes_the_under[] = "`disk_format` describes the underlying\n file format, one of `NETCDF3`, `HDF5`, `HDF4`,\n `PNETCDF`, `DAP2`, `DAP4` or `UNDEFINED`. Only available if using\n netcdf C library version >= 4.3.1, otherwise will always return\n `UNDEFINED`."; static char __pyx_k_endian_keyword_argument_must_be[] = "'endian' keyword argument must be 'little','big' or 'native', got '%s'"; static char __pyx_k_endian_ness_of_dtype_and_endian[] = "endian-ness of dtype and endian kwarg do not match, using endian kwarg"; static char __pyx_k_get_variables_by_attribute_self[] = "\n**`get_variables_by_attribute(self, **kwargs)`**\n\nReturns a list of variables that match specific conditions.\n\nCan pass in key=value parameters and variables are returned that\ncontain all of the matches. For example, \n\n :::python\n >>> # Get variables with x-axis attribute.\n >>> vs = nc.get_variables_by_attributes(axis='X')\n >>> # Get variables with matching \"standard_name\" attribute\n >>> vs = nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')\n\nCan pass in key=callable parameter and variables are returned if the\ncallable returns True. The callable should accept a single parameter,\nthe attribute value. None is given as the attribute value when the\nattribute does not exist on the variable. For example,\n\n :::python\n >>> # Get Axis variables\n >>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])\n >>> # Get variables that don't have an \"axis\" attribute\n >>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)\n >>> # Get variables that have a \"grid_mapping\" attribute\n >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)\n"; static char __pyx_k_get_variables_s_dimension_names[] = "get variables's dimension names"; static char __pyx_k_illegal_data_type_for_attribute[] = "illegal data type for attribute, must be one of %s, got %s"; static char __pyx_k_name_s_numpy_dtype_s_fields_val[] = ": name = '%s', numpy dtype = %s, fields/values =%s\n"; static char __pyx_k_negative_reference_year_in_time[] = "negative reference year in time units, must be >= 1"; static char __pyx_k_netcdf_time_variable_is_missing[] = "netcdf time variable is missing a 'units' attribute"; static char __pyx_k_parent_is_a_reference_to_the_pa[] = "`parent` is a reference to the parent\n `netCDF4.Group` instance. `None` for the root group or `netCDF4.Dataset` instance"; static char __pyx_k_s_is_one_of_the_reserved_attrib[] = "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead."; static char __pyx_k_same_as_data_model_retained_for[] = "same as `data_model`, retained for backwards compatibility."; static char __pyx_k_single_element_VLEN_slices_must[] = "single element VLEN slices must be specified by integers only"; static char __pyx_k_wrong_data_type_in_object_array[] = "wrong data type in object array: should be %s, got %s"; static char __pyx_k_wrong_data_type_should_be_s_got[] = "wrong data type: should be %s, got %s"; static char __pyx_k_zero_not_allowed_as_a_reference[] = "zero not allowed as a reference year, does not exist in Julian or Gregorian calendars"; static char __pyx_k_A_numpy_integer_dtype_object_des[] = "A numpy integer dtype object describing the base type for the Enum."; static char __pyx_k_A_python_dictionary_describing_t[] = "A python dictionary describing the enum fields and values."; static char __pyx_k_A_tuple_with_the_current_shape_l[] = "A tuple with the current shape (length of all dimensions)."; static char __pyx_k_Dataset_get_variables_by_attribu[] = "Dataset.get_variables_by_attributes (line 2460)"; static char __pyx_k_Describes_the_power_of_ten_of_th[] = "Describes the power of ten of the \n smallest decimal place in the data the contains a reliable value. Data is\n truncated to this decimal place when it is assigned to the `netCDF4.Variable`\n instance. If `None`, the data is not truncated."; static char __pyx_k_Dimension_object_no_longer_valid[] = "Dimension object no longer valid"; static char __pyx_k_If_True_child_Dimension_and_Vari[] = "If `True`, child Dimension and Variables objects only keep weak references to\n the parent Dataset or Group."; static char __pyx_k_If_True_data_is_automatically_co[] = "If True, data is automatically converted to/from masked \n arrays when missing values or fill values are present. Default is `True`, can be\n reset using `netCDF4.Variable.set_auto_mask` and `netCDF4.Variable.set_auto_maskandscale`\n methods."; static char __pyx_k_MFNetCDF4_only_works_with_NETCDF[] = "MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4"; static char __pyx_k_MFTime_requires_that_the_same_ti[] = "MFTime requires that the same time calendar is used by all files."; static char __pyx_k_MFTime_requires_that_the_time_va[] = "MFTime requires that the time variable in all files have a calendar attribute"; static char __pyx_k_Return_the_number_of_stored_elem[] = "Return the number of stored elements."; static char __pyx_k_The_cmptypes_dictionary_maps_the[] = "The `cmptypes` dictionary maps the names of\n compound types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the\n `netCDF4.CompoundType` class."; static char __pyx_k_The_dimensions_dictionary_maps_t[] = "The `dimensions` dictionary maps the names of\n dimensions defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the\n `netCDF4.Dimension` class."; static char __pyx_k_The_enumtypes_dictionary_maps_th[] = "The `enumtypes` dictionary maps the names of\n Enum types defined for the `netCDF4.Group` or `netCDF4.Dataset` to instances of the\n `netCDF4.EnumType` class."; static char __pyx_k_The_groups_dictionary_maps_the_n[] = "The groups dictionary maps the names of groups created for\n this `netCDF4.Dataset` or `netCDF4.Group` to instances of the `netCDF4.Group` class (the\n `netCDF4.Dataset` class is simply a special case of the `netCDF4.Group` class which\n describes the root group in the netCDF4 file)."; static char __pyx_k_The_number_of_variable_dimension[] = "The number of variable dimensions."; static char __pyx_k_The_variables_dictionary_maps_th[] = "The `variables` dictionary maps the names of variables\n defined for this `netCDF4.Dataset` or `netCDF4.Group` to instances of the `netCDF4.Variable`\n class."; static char __pyx_k_Unsupported_compound_type_elemen[] = "Unsupported compound type element"; static char __pyx_k_Variable_least_significant_digit[] = "Variable.least_significant_digit"; static char __pyx_k_Variable_length_strings_are_only[] = "Variable length strings are only supported for the NETCDF4 format. For other formats, consider using netCDF4.stringtochar to convert string arrays into character arrays with an additional dimension."; static char __pyx_k_WARNING_unsupported_Compound_typ[] = "WARNING: unsupported Compound type, skipping..."; static char __pyx_k_WARNING_unsupported_Enum_type_sk[] = "WARNING: unsupported Enum type, skipping..."; static char __pyx_k_WARNING_unsupported_VLEN_type_sk[] = "WARNING: unsupported VLEN type, skipping..."; static char __pyx_k_WARNING_variable_s_has_unsupport[] = "WARNING: variable '%s' has unsupported compound datatype, skipping .."; static char __pyx_k_aggregation_variable_s_not_defin[] = "aggregation variable %s not defined in %s"; static char __pyx_k_attribute_s_has_unsupported_data[] = "attribute %s has unsupported datatype"; static char __pyx_k_cannot_assign_fill_value_for_mas[] = "cannot assign fill_value for masked array when missing_value attribute is not a scalar"; static char __pyx_k_cannot_close_a_netCDF4_Group_onl[] = "cannot close a `netCDF4.Group` (only applies to Dataset)"; static char __pyx_k_cannot_find_compound_type_in_thi[] = "cannot find compound type in this group or parent groups"; static char __pyx_k_cannot_use_utc_offset_for_refere[] = "cannot use utc_offset for reference years <= 0"; static char __pyx_k_cannot_using_file_globbing_for_r[] = "cannot using file globbing for remote (OPeNDAP) datasets"; static char __pyx_k_chunksize_cannot_exceed_dimensio[] = "chunksize cannot exceed dimension size"; static char __pyx_k_chunksizes_must_be_a_sequence_wi[] = "chunksizes must be a sequence with the same length as dimensions"; static char __pyx_k_compound_field_of_an_unsupported[] = "compound field of an unsupported data type"; static char __pyx_k_created_using_fill_value_keyword[] = "created (using fill_value keyword to createVariable)"; static char __pyx_k_data_to_put_in_string_variable_m[] = "data to put in string variable must be an object array containing Python strings"; static char __pyx_k_dimension_s_not_defined_in_group[] = "dimension %s not defined in group %s or any group in it's family tree"; static char __pyx_k_diskless_mode_requires_netcdf_li[] = "diskless mode requires netcdf lib >= 4.2.1, you have %s"; static char __pyx_k_dtype_must_string_or_unicode_S_o[] = "dtype must string or unicode ('S' or 'U')"; static char __pyx_k_filling_on_default__FillValue_of[] = "filling on, default _FillValue of %s ignored\n"; static char __pyx_k_find_current_sizes_of_all_variab[] = "find current sizes of all variable dimensions"; static char __pyx_k_format_not_supported_by_python_i[] = "format not supported by python interface"; static char __pyx_k_if_True_scale_factor_and_add_off[] = "if True, `scale_factor` and `add_offset` are\n applied. Default is `True`, can be reset using `netCDF4.Variable.set_auto_scale` and\n `netCDF4.Variable.set_auto_maskandscale` methods."; static char __pyx_k_illegal_primitive_data_type_must[] = "illegal primitive data type, must be one of %s, got %s"; static char __pyx_k_invalid_scale_factor_or_add_offs[] = "invalid scale_factor or add_offset attribute, no unpacking done..."; static char __pyx_k_masked_arrays_cannot_be_assigned[] = "masked arrays cannot be assigned by VLEN str slices"; static char __pyx_k_master_dataset_s_does_not_have_a[] = "master dataset %s does not have a aggregation dimension"; static char __pyx_k_negative_strides_not_allowed_whe[] = "negative strides not allowed when slicing MFVariable Variable instance"; static char __pyx_k_numpy_data_type_for_primitive_da[] = "numpy data type (for primitive data types) or\n VLType/CompoundType/EnumType instance \n (for compound, vlen or enum data types)"; static char __pyx_k_only_endian_native_allowed_for_N[] = "only endian='native' allowed for NETCDF3 files"; static char __pyx_k_only_numpy_string_unicode_or_obj[] = "only numpy string, unicode or object arrays can be assigned to VLEN str var slices"; static char __pyx_k_please_install_ordereddict_https[] = "please install ordereddict (https://pypi.python.org/pypi/ordereddict)"; static char __pyx_k_requires_numpy_version_1_0rc1_or[] = "requires numpy version 1.0rc1 or later"; static char __pyx_k_root_group_s_data_model_file_for[] = "root group (%s data model, file format %s):\n"; static char __pyx_k_size_of_data_array_does_not_conf[] = "size of data array does not conform to slice"; static char __pyx_k_strides_must_all_be_1_for_string[] = "strides must all be 1 for string variables"; static char __pyx_k_strides_must_all_be_1_for_vlen_v[] = "strides must all be 1 for vlen variables"; static char __pyx_k_string_name_of_Dimension_instanc[] = "string name of Dimension instance"; static char __pyx_k_string_name_of_Variable_instance[] = "string name of Variable instance"; static char __pyx_k_to_assign_values_to_a_non_scalar[] = "to assign values to a non-scalar variable, use a slice"; static char __pyx_k_to_retrieve_values_from_a_non_sc[] = "to retrieve values from a non-scalar variable, use slicing"; static char __pyx_k_trying_to_assign_illegal_value_t[] = "trying to assign illegal value to Enum variable"; static char __pyx_k_type_must_string_or_unicode_S_or[] = "type must string or unicode ('S' or 'U')"; static char __pyx_k_unsupported_component_type_for_V[] = "unsupported component type for VLEN"; static char __pyx_k_unsupported_datatype_specified_f[] = "unsupported datatype specified for VLEN"; static char __pyx_k_variable_s_data_type_mismatch_be[] = "variable %s : data type mismatch between master %s (%s) and extension %s (%s)"; static char __pyx_k_variable_s_dimensions_mismatch_b[] = "variable %s : dimensions mismatch between master %s (%s) and extension %s (%s)"; static char __pyx_k_variable_s_rank_mismatch_between[] = "variable %s : rank mismatch between master %s (%s) and extension %s (%s)"; static char __pyx_k_variable_s_shape_mismatch_betwee[] = "variable %s : shape mismatch between master %s (%s) and extension %s (%s)"; static char __pyx_k_vlen_string_array_attributes_not[] = "vlen string array attributes not supported"; static char __pyx_k_A_numpy_dtype_object_describing_2[] = "A numpy dtype object describing the compound data type."; static char __pyx_k_A_numpy_dtype_object_describing_3[] = "A numpy dtype object describing the component type for the VLEN."; static char __pyx_k_A_string_describing_the_name_of_2[] = "A string describing the name of the `netCDF4.Dimension` - used when creating a\n `netCDF4.Variable` instance with `netCDF4.Dataset.createVariable`."; static char __pyx_k_s_is_one_of_the_reserved_attrib_2[] = "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead."; static char __pyx_k_WARNING_variable_s_has_unsupport_2[] = "WARNING: variable '%s' has unsupported VLEN datatype, skipping .."; static char __pyx_k_WARNING_variable_s_has_unsupport_3[] = "WARNING: variable '%s' has unsupported Enum datatype, skipping .."; static char __pyx_k_WARNING_variable_s_has_unsupport_4[] = "WARNING: variable '%s' has unsupported datatype, skipping .."; static char __pyx_k_filling_on_default__FillValue_of_2[] = "filling on, default _FillValue of %s used\n"; static char __pyx_k_master_dataset_s_does_not_have_a_2[] = "master dataset %s does not have any variables to aggregate"; static char __pyx_k_numpy_data_type_for_primitive_da_2[] = "numpy data type (for primitive data types) or\n VLType/CompoundType/EnumType instance (for compound, vlen or enum\n data types)."; static char __pyx_k_unsupported_datatype_specified_f_2[] = "unsupported datatype specified for Enum (must be integer)"; static PyObject *__pyx_kp_s_; static PyObject *__pyx_kp_s_0m; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_1_2_2; static PyObject *__pyx_kp_s_4_2_1; static PyObject *__pyx_kp_s_4_4_0; static PyObject *__pyx_kp_s_4m; static PyObject *__pyx_kp_s_A_numpy_dtype_object_describing; static PyObject *__pyx_kp_s_A_numpy_dtype_object_describing_2; static PyObject *__pyx_kp_s_A_numpy_dtype_object_describing_3; static PyObject *__pyx_kp_s_A_numpy_integer_dtype_object_des; static PyObject *__pyx_kp_s_A_python_dictionary_describing_t; static PyObject *__pyx_kp_s_A_string_describing_the_name_of; static PyObject *__pyx_kp_s_A_string_describing_the_name_of_2; static PyObject *__pyx_kp_s_A_tuple_containing_the_names_of; static PyObject *__pyx_kp_s_A_tuple_with_the_current_shape_l; static PyObject *__pyx_kp_s_Always_True_Indicates_to_client; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_s_Class_for_reading_multi_file_ne; static PyObject *__pyx_kp_s_Class_providing_an_interface_to; static PyObject *__pyx_kp_s_CompoundType_dtype; static PyObject *__pyx_kp_s_CompoundType_name; static PyObject *__pyx_kp_s_Dataset_cmptypes; static PyObject *__pyx_kp_s_Dataset_data_model; static PyObject *__pyx_kp_s_Dataset_dimensions; static PyObject *__pyx_kp_s_Dataset_disk_format; static PyObject *__pyx_kp_s_Dataset_enumtypes; static PyObject *__pyx_kp_s_Dataset_file_format; static PyObject *__pyx_kp_u_Dataset_get_variables_by_attribu; static PyObject *__pyx_kp_s_Dataset_groups; static PyObject *__pyx_kp_s_Dataset_keepweakref; static PyObject *__pyx_kp_s_Dataset_parent; static PyObject *__pyx_kp_s_Dataset_path; static PyObject *__pyx_kp_s_Dataset_variables; static PyObject *__pyx_kp_s_Dataset_vltypes; static PyObject *__pyx_kp_s_Describes_the_power_of_ten_of_th; static PyObject *__pyx_n_s_Dimension; static PyObject *__pyx_n_s_Dimension___init; static PyObject *__pyx_n_s_Dimension___len; static PyObject *__pyx_n_s_Dimension___repr; static PyObject *__pyx_n_s_Dimension_isunlimited; static PyObject *__pyx_kp_s_Dimension_name; static PyObject *__pyx_kp_s_Dimension_object_no_longer_valid; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_EnumType_dtype; static PyObject *__pyx_kp_s_EnumType_enum_dict; static PyObject *__pyx_kp_s_EnumType_name; static PyObject *__pyx_n_s_FillValue; static PyObject *__pyx_kp_s_FillValue_attribute_must_be_set; static PyObject *__pyx_kp_s_Group_name; static PyObject *__pyx_n_s_HDF4; static PyObject *__pyx_n_s_IOError; static PyObject *__pyx_kp_s_If_True_child_Dimension_and_Vari; static PyObject *__pyx_kp_s_If_True_data_is_automatically_co; static PyObject *__pyx_kp_s_Illegal_index; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_MFDataset; static PyObject *__pyx_n_s_MFDataset___getattribute; static PyObject *__pyx_n_s_MFDataset___init; static PyObject *__pyx_n_s_MFDataset___repr; static PyObject *__pyx_n_s_MFDataset___setattr; static PyObject *__pyx_n_s_MFDataset_close; static PyObject *__pyx_n_s_MFDataset_ncattrs; static PyObject *__pyx_kp_s_MFNetCDF4_only_works_with_NETCDF; static PyObject *__pyx_n_s_MFTime; static PyObject *__pyx_n_s_MFTime___getitem; static PyObject *__pyx_n_s_MFTime___init; static PyObject *__pyx_n_s_MFTime__delta; static PyObject *__pyx_n_s_MFTime__time; static PyObject *__pyx_kp_s_MFTime_requires_that_the_same_ti; static PyObject *__pyx_kp_s_MFTime_requires_that_the_time_va; static PyObject *__pyx_n_s_MINYEAR; static PyObject *__pyx_n_s_NC_DISKLESS; static PyObject *__pyx_n_s_NETCDF3; static PyObject *__pyx_n_s_NETCDF3_64BIT; static PyObject *__pyx_n_s_NETCDF3_64BIT_OFFSET; static PyObject *__pyx_n_s_NETCDF3_CLASSIC; static PyObject *__pyx_n_s_NETCDF4; static PyObject *__pyx_n_s_NETCDF4_CLASSIC; static PyObject *__pyx_n_s_NUMCHARS; static PyObject *__pyx_n_s_O; static PyObject *__pyx_n_s_OrderedDict; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_S; static PyObject *__pyx_n_s_S1; static PyObject *__pyx_n_s_StartCountStride; static PyObject *__pyx_kp_s_String_name; static PyObject *__pyx_kp_s_The_cmptypes_dictionary_maps_the; static PyObject *__pyx_kp_s_The_dimensions_dictionary_maps_t; static PyObject *__pyx_kp_s_The_enumtypes_dictionary_maps_th; static PyObject *__pyx_kp_s_The_groups_dictionary_maps_the_n; static PyObject *__pyx_kp_s_The_number_of_stored_elements; static PyObject *__pyx_kp_s_The_number_of_variable_dimension; static PyObject *__pyx_kp_s_The_variables_dictionary_maps_th; static PyObject *__pyx_kp_s_The_vltypes_dictionary_maps_the; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_U; static PyObject *__pyx_n_s_UNDEFINED; static PyObject *__pyx_n_s_UnicodeDecodeError; static PyObject *__pyx_kp_s_Unsupported_compound_type_elemen; static PyObject *__pyx_kp_s_Users_jsw_python_netcdf4_python; static PyObject *__pyx_n_s_V; static PyObject *__pyx_kp_s_VLType_dtype; static PyObject *__pyx_kp_s_VLType_name; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_Variable; static PyObject *__pyx_n_s_Variable___getattr; static PyObject *__pyx_n_s_Variable___getitem; static PyObject *__pyx_n_s_Variable___init; static PyObject *__pyx_n_s_Variable___len; static PyObject *__pyx_kp_s_Variable___orthogonal_indexing; static PyObject *__pyx_n_s_Variable___repr; static PyObject *__pyx_n_s_Variable__shape; static PyObject *__pyx_kp_s_Variable_datatype; static PyObject *__pyx_kp_s_Variable_dimensions; static PyObject *__pyx_kp_s_Variable_dtype; static PyObject *__pyx_kp_s_Variable_least_significant_digit; static PyObject *__pyx_kp_s_Variable_length_strings_are_only; static PyObject *__pyx_kp_s_Variable_mask; static PyObject *__pyx_kp_s_Variable_name; static PyObject *__pyx_n_s_Variable_ncattrs; static PyObject *__pyx_kp_s_Variable_ndim; static PyObject *__pyx_kp_s_Variable_object_no_longer_valid; static PyObject *__pyx_kp_s_Variable_scale; static PyObject *__pyx_n_s_Variable_set_auto_maskandscale; static PyObject *__pyx_kp_s_Variable_shape; static PyObject *__pyx_kp_s_Variable_size; static PyObject *__pyx_n_s_Variable_typecode; static PyObject *__pyx_kp_s_WARNING_unsupported_Compound_typ; static PyObject *__pyx_kp_s_WARNING_unsupported_Enum_type_sk; static PyObject *__pyx_kp_s_WARNING_unsupported_VLEN_type_sk; static PyObject *__pyx_kp_s_WARNING_variable_s_has_unsupport; static PyObject *__pyx_kp_s_WARNING_variable_s_has_unsupport_2; static PyObject *__pyx_kp_s_WARNING_variable_s_has_unsupport_3; static PyObject *__pyx_kp_s_WARNING_variable_s_has_unsupport_4; static PyObject *__pyx_kp_s__128; static PyObject *__pyx_kp_s__14; static PyObject *__pyx_kp_s__15; static PyObject *__pyx_kp_s__16; static PyObject *__pyx_kp_s__19; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__21; static PyObject *__pyx_kp_s__22; static PyObject *__pyx_kp_s__24; static PyObject *__pyx_kp_s__25; static PyObject *__pyx_n_s__28; static PyObject *__pyx_kp_s__36; static PyObject *__pyx_kp_s__37; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_add_offset; static PyObject *__pyx_n_s_aggDimId; static PyObject *__pyx_n_s_aggDimName; static PyObject *__pyx_n_s_aggdim; static PyObject *__pyx_kp_s_aggregation_variable_s_not_defin; static PyObject *__pyx_n_s_align; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_any; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_around; static PyObject *__pyx_n_s_arr; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_as; static PyObject *__pyx_n_s_asarray; static PyObject *__pyx_n_s_assign_vlen; static PyObject *__pyx_kp_s_assign_vlen_method_only_for_use; static PyObject *__pyx_n_s_astype; static PyObject *__pyx_kp_s_attribute_s_has_unsupported_data; static PyObject *__pyx_n_s_attrs; static PyObject *__pyx_n_s_atype; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_basedate; static PyObject *__pyx_n_s_big; static PyObject *__pyx_n_s_bool; static PyObject *__pyx_n_s_bs; static PyObject *__pyx_n_s_byteorder; static PyObject *__pyx_n_s_byteswap; static PyObject *__pyx_n_s_calendar; static PyObject *__pyx_kp_s_cannot_assign_fill_value_for_mas; static PyObject *__pyx_kp_s_cannot_close_a_netCDF4_Group_onl; static PyObject *__pyx_kp_s_cannot_find_compound_type_in_thi; static PyObject *__pyx_kp_s_cannot_set__FillValue_attribute; static PyObject *__pyx_kp_s_cannot_specify_chunksizes_for_a; static PyObject *__pyx_kp_s_cannot_use_utc_offset_for_refere; static PyObject *__pyx_kp_s_cannot_using_file_globbing_for_r; static PyObject *__pyx_n_s_cdf; static PyObject *__pyx_n_s_cdfRecVar; static PyObject *__pyx_n_s_cdfRecVar_2; static PyObject *__pyx_n_s_cdfTLen; static PyObject *__pyx_n_s_cdfVLen; static PyObject *__pyx_n_s_cdfVLen_2; static PyObject *__pyx_n_s_cdf_2; static PyObject *__pyx_n_s_cdfm; static PyObject *__pyx_n_s_cdftime; static PyObject *__pyx_n_s_char; static PyObject *__pyx_n_s_chartostring; static PyObject *__pyx_n_s_check; static PyObject *__pyx_n_s_chunk_cache; static PyObject *__pyx_kp_s_chunksize_cannot_exceed_dimensio; static PyObject *__pyx_n_s_chunksizes; static PyObject *__pyx_kp_s_chunksizes_must_be_a_sequence_wi; static PyObject *__pyx_n_s_clobber; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_cmptype; static PyObject *__pyx_n_s_cmptypes; static PyObject *__pyx_n_s_cnt; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_complevel; static PyObject *__pyx_n_s_compound; static PyObject *__pyx_kp_s_compound_data_type_s; static PyObject *__pyx_kp_s_compound_field_of_an_unsupported; static PyObject *__pyx_n_s_concatenate; static PyObject *__pyx_n_s_contiguous; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_createGroup; static PyObject *__pyx_kp_s_created_using_fill_value_keyword; static PyObject *__pyx_kp_s_current_shape_s; static PyObject *__pyx_kp_s_current_size_s; static PyObject *__pyx_n_s_d; static PyObject *__pyx_kp_s_d_d_d; static PyObject *__pyx_kp_s_d_d_d_s; static PyObject *__pyx_n_s_dat; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_data_model; static PyObject *__pyx_n_s_data_model_2; static PyObject *__pyx_kp_s_data_model_describes_the_netCDF; static PyObject *__pyx_kp_s_data_to_put_in_string_variable_m; static PyObject *__pyx_n_s_datashape; static PyObject *__pyx_n_s_datatype; static PyObject *__pyx_n_s_datatype_name; static PyObject *__pyx_n_s_date; static PyObject *__pyx_n_s_date2index; static PyObject *__pyx_n_s_date2num; static PyObject *__pyx_n_s_dateparse; static PyObject *__pyx_n_s_dates; static PyObject *__pyx_n_s_datetime; static PyObject *__pyx_n_s_day; static PyObject *__pyx_n_s_day_units; static PyObject *__pyx_n_s_days; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_default_encoding; static PyObject *__pyx_n_s_default_fillvals; static PyObject *__pyx_n_s_delncattr; static PyObject *__pyx_kp_s_development; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dim; static PyObject *__pyx_kp_s_dimension_s_not_defined_in_group; static PyObject *__pyx_n_s_dimensions; static PyObject *__pyx_kp_s_dimensions_cannot_be_altered; static PyObject *__pyx_kp_s_dimensions_s; static PyObject *__pyx_kp_s_dimensions_sizes_s; static PyObject *__pyx_n_s_dimid; static PyObject *__pyx_n_s_dimlens; static PyObject *__pyx_n_s_dimname; static PyObject *__pyx_n_s_dimnames; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_dims_2; static PyObject *__pyx_n_s_dimtotlen; static PyObject *__pyx_n_s_disk_format; static PyObject *__pyx_n_s_disk_format_2; static PyObject *__pyx_kp_s_disk_format_describes_the_under; static PyObject *__pyx_n_s_diskless; static PyObject *__pyx_kp_s_diskless_mode_requires_netcdf_li; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_dset; static PyObject *__pyx_n_s_dset_2; static PyObject *__pyx_n_s_dt; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_kp_s_dtype_must_string_or_unicode_S_o; static PyObject *__pyx_n_s_dtype_name; static PyObject *__pyx_n_s_elem; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_enddef; static PyObject *__pyx_n_s_endian; static PyObject *__pyx_kp_s_endian_keyword_argument_must_be; static PyObject *__pyx_kp_s_endian_ness_of_dtype_and_endian; static PyObject *__pyx_n_s_endswith; static PyObject *__pyx_n_s_enum; static PyObject *__pyx_kp_s_enum_data_type_s; static PyObject *__pyx_n_s_enum_dict; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_enumtype; static PyObject *__pyx_n_s_enumtypes; static PyObject *__pyx_n_s_exact; static PyObject *__pyx_n_s_exclude; static PyObject *__pyx_n_s_extDims; static PyObject *__pyx_n_s_extShape; static PyObject *__pyx_n_s_extType; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_f4; static PyObject *__pyx_kp_s_f4_2; static PyObject *__pyx_kp_s_f4_3; static PyObject *__pyx_n_s_f8; static PyObject *__pyx_n_s_fields; static PyObject *__pyx_n_s_file_format; static PyObject *__pyx_n_s_file_format_2; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_kp_s_filepath_method_not_enabled_To; static PyObject *__pyx_n_s_files; static PyObject *__pyx_n_s_files_2; static PyObject *__pyx_n_s_fill_value; static PyObject *__pyx_n_s_filled; static PyObject *__pyx_kp_s_filling_off; static PyObject *__pyx_kp_s_filling_on; static PyObject *__pyx_kp_s_filling_on_default__FillValue_of; static PyObject *__pyx_kp_s_filling_on_default__FillValue_of_2; static PyObject *__pyx_n_s_find; static PyObject *__pyx_n_s_find_dim; static PyObject *__pyx_n_s_flat; static PyObject *__pyx_n_s_flatten; static PyObject *__pyx_n_s_fletcher32; static PyObject *__pyx_n_s_float; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_format_dict; static PyObject *__pyx_kp_s_format_not_supported_by_python_i; static PyObject *__pyx_n_s_formats; static PyObject *__pyx_n_s_genexpr; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_var_chunk_cache; static PyObject *__pyx_kp_u_get_variables_by_attribute_self; static PyObject *__pyx_n_s_getattr; static PyObject *__pyx_n_s_getattribute; static PyObject *__pyx_n_s_getdims; static PyObject *__pyx_n_s_gethdf5libversion; static PyObject *__pyx_n_s_getitem; static PyObject *__pyx_n_s_getlibversion; static PyObject *__pyx_n_s_getname; static PyObject *__pyx_n_s_getncattr; static PyObject *__pyx_n_s_glob; static PyObject *__pyx_n_s_gregorian; static PyObject *__pyx_kp_s_group_s; static PyObject *__pyx_n_s_groups; static PyObject *__pyx_kp_s_groups_s; static PyObject *__pyx_kp_s_groups_s_2; static PyObject *__pyx_n_s_grp; static PyObject *__pyx_n_s_grp_2; static PyObject *__pyx_n_s_grpid; static PyObject *__pyx_n_s_grpnames; static PyObject *__pyx_n_s_grps; static PyObject *__pyx_n_s_has_cdf5; static PyObject *__pyx_n_s_has_nc_inq_format_extended; static PyObject *__pyx_n_s_has_nc_inq_path; static PyObject *__pyx_n_s_has_rename_grp; static PyObject *__pyx_n_s_hdf5libversion; static PyObject *__pyx_n_s_hour; static PyObject *__pyx_n_s_hr_units; static PyObject *__pyx_n_s_http; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_i0; static PyObject *__pyx_n_s_i1; static PyObject *__pyx_n_s_i2; static PyObject *__pyx_n_s_i4; static PyObject *__pyx_n_s_i8; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_idx; static PyObject *__pyx_kp_s_if_True_scale_factor_and_add_off; static PyObject *__pyx_kp_s_illegal_data_type_for_attribute; static PyObject *__pyx_kp_s_illegal_primitive_data_type_must; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_in1d; static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_intnptonctype; static PyObject *__pyx_kp_s_invalid_scale_factor_or_add_offs; static PyObject *__pyx_n_s_isMA; static PyObject *__pyx_n_s_is_native_big; static PyObject *__pyx_n_s_is_native_little; static PyObject *__pyx_n_s_iscompound; static PyObject *__pyx_n_s_isenum; static PyObject *__pyx_n_s_ismasked; static PyObject *__pyx_n_s_isnan; static PyObject *__pyx_n_s_isostring; static PyObject *__pyx_n_s_isprimitive; static PyObject *__pyx_n_s_isscalar; static PyObject *__pyx_n_s_isunlimited; static PyObject *__pyx_n_s_isvlen; static PyObject *__pyx_n_s_item; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_itertools; static PyObject *__pyx_n_s_iu; static PyObject *__pyx_n_s_izip; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_julian; static PyObject *__pyx_n_s_k; static PyObject *__pyx_n_s_keepweakref; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_least_significant_digit; static PyObject *__pyx_n_s_len; static PyObject *__pyx_kp_s_len_of_unsized_object; static PyObject *__pyx_n_s_little; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_lst; static PyObject *__pyx_n_s_lstArr; static PyObject *__pyx_n_s_ma; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_majorvers; static PyObject *__pyx_n_s_mask; static PyObject *__pyx_n_s_masked_array; static PyObject *__pyx_kp_s_masked_arrays_cannot_be_assigned; static PyObject *__pyx_n_s_master; static PyObject *__pyx_n_s_masterDims; static PyObject *__pyx_n_s_masterRecVar; static PyObject *__pyx_n_s_masterShape; static PyObject *__pyx_n_s_masterType; static PyObject *__pyx_kp_s_master_dataset_s_does_not_have_a; static PyObject *__pyx_kp_s_master_dataset_s_does_not_have_a_2; static PyObject *__pyx_n_s_mastervar; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_microsec_units; static PyObject *__pyx_n_s_microseconds; static PyObject *__pyx_n_s_millisec_units; static PyObject *__pyx_n_s_min_units; static PyObject *__pyx_n_s_minorvers; static PyObject *__pyx_n_s_minute; static PyObject *__pyx_n_s_missing_value; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_kp_s_mode_must_be_w_r_a_or_r_got_s; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_month; static PyObject *__pyx_n_s_msecs; static PyObject *__pyx_n_s_msecsd; static PyObject *__pyx_n_s_msg; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_n1; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_kp_s_name_cannot_be_altered; static PyObject *__pyx_kp_s_name_s_numpy_dtype_s; static PyObject *__pyx_kp_s_name_s_numpy_dtype_s_fields_val; static PyObject *__pyx_kp_s_name_s_size_s; static PyObject *__pyx_n_s_names; static PyObject *__pyx_n_s_native; static PyObject *__pyx_n_s_nbytes; static PyObject *__pyx_n_s_nc_type; static PyObject *__pyx_n_s_ncattrs; static PyObject *__pyx_n_s_ncdump; static PyObject *__pyx_n_s_ncdump_var; static PyObject *__pyx_n_s_nctime; static PyObject *__pyx_n_s_nctonptype; static PyObject *__pyx_n_s_ndim; static PyObject *__pyx_n_s_needsworkaround_issue485; static PyObject *__pyx_kp_s_negative_reference_year_in_time; static PyObject *__pyx_kp_s_negative_strides_not_allowed_whe; static PyObject *__pyx_n_s_nelems; static PyObject *__pyx_n_s_netCDF4__netCDF4; static PyObject *__pyx_n_s_netcdf4libversion; static PyObject *__pyx_kp_s_netcdf_time_variable_is_missing; static PyObject *__pyx_n_s_netcdftime; static PyObject *__pyx_n_s_newSlice; static PyObject *__pyx_n_s_newname; static PyObject *__pyx_kp_s_no_since_in_unit_string; static PyObject *__pyx_n_s_normpath; static PyObject *__pyx_n_s_nptonctype; static PyObject *__pyx_n_s_npversion; static PyObject *__pyx_n_s_num; static PyObject *__pyx_n_s_num2date; static PyObject *__pyx_n_s_numpy; static PyObject *__pyx_kp_s_numpy_data_type_for_primitive_da_2; static PyObject *__pyx_n_s_numv; static PyObject *__pyx_n_s_nunlimdim; static PyObject *__pyx_n_s_nv; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_offsets; static PyObject *__pyx_n_s_oldname; static PyObject *__pyx_kp_s_only_endian_native_allowed_for_N; static PyObject *__pyx_kp_s_only_numpy_string_unicode_or_obj; static PyObject *__pyx_n_s_ordereddict; static PyObject *__pyx_n_s_orthogoral_indexing; static PyObject *__pyx_n_s_out_array_shape; static PyObject *__pyx_n_s_parent; static PyObject *__pyx_kp_s_parent_is_a_reference_to_the_pa; static PyObject *__pyx_n_s_parse_date; static PyObject *__pyx_n_s_part; static PyObject *__pyx_n_s_patchstring; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_path_2; static PyObject *__pyx_kp_s_path_s; static PyObject *__pyx_kp_s_path_shows_the_location_of_the; static PyObject *__pyx_n_s_pdoc; static PyObject *__pyx_n_s_persist; static PyObject *__pyx_kp_s_please_install_ordereddict_https; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_posixpath; static PyObject *__pyx_n_s_preemption; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_private_atts; static PyObject *__pyx_n_s_prod; static PyObject *__pyx_n_s_proleptic_gregorian; static PyObject *__pyx_n_s_proxy; static PyObject *__pyx_n_s_put; static PyObject *__pyx_n_s_put_2; static PyObject *__pyx_n_s_put_ind; static PyObject *__pyx_n_s_python3; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quantize; static PyObject *__pyx_n_s_r; static PyObject *__pyx_kp_s_r_2; static PyObject *__pyx_kp_s_r_3; static PyObject *__pyx_kp_s_r_s; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_ravel; static PyObject *__pyx_n_s_recLen; static PyObject *__pyx_n_s_recVar; static PyObject *__pyx_n_s_recdimlen; static PyObject *__pyx_n_s_recdimname; static PyObject *__pyx_n_s_recdimname_2; static PyObject *__pyx_n_s_redef; static PyObject *__pyx_n_s_ref_date; static PyObject *__pyx_n_s_ref_num; static PyObject *__pyx_n_s_releasevers; static PyObject *__pyx_kp_s_renameGroup_method_not_enabled; static PyObject *__pyx_n_s_replace; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_kp_s_requires_numpy_version_1_0rc1_or; static PyObject *__pyx_n_s_reshape; static PyObject *__pyx_n_s_reverse_format_dict; static PyObject *__pyx_kp_s_root_group_s_data_model_file_for; static PyObject *__pyx_n_s_round; static PyObject *__pyx_kp_s_s; static PyObject *__pyx_n_s_s_2; static PyObject *__pyx_kp_s_s_is_one_of_the_reserved_attrib; static PyObject *__pyx_kp_s_s_is_one_of_the_reserved_attrib_2; static PyObject *__pyx_kp_s_s_not_a_valid_dimension_name; static PyObject *__pyx_kp_s_s_not_a_valid_variable_name; static PyObject *__pyx_kp_s_s_not_found_in_s; static PyObject *__pyx_kp_s_s_s; static PyObject *__pyx_kp_s_s_s_s; static PyObject *__pyx_kp_s_s_s_s_2; static PyObject *__pyx_kp_s_same_as_data_model_retained_for; static PyObject *__pyx_n_s_scale; static PyObject *__pyx_n_s_scale_factor; static PyObject *__pyx_n_s_sec_units; static PyObject *__pyx_n_s_second; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_secs; static PyObject *__pyx_n_s_select; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_send; static PyObject *__pyx_n_s_set_auto_mask; static PyObject *__pyx_n_s_set_auto_maskandscale; static PyObject *__pyx_n_s_set_auto_scale; static PyObject *__pyx_n_s_set_default_format; static PyObject *__pyx_n_s_setattr; static PyObject *__pyx_n_s_setncattr; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_shape_2; static PyObject *__pyx_kp_s_shape_cannot_be_altered; static PyObject *__pyx_n_s_shuffle; static PyObject *__pyx_n_s_since; static PyObject *__pyx_kp_s_single_element_VLEN_slices_must; static PyObject *__pyx_n_s_size; static PyObject *__pyx_kp_s_size_cannot_be_altered; static PyObject *__pyx_kp_s_size_of_data_array_does_not_conf; static PyObject *__pyx_n_s_slen; static PyObject *__pyx_n_s_sortbylist; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_squeeze; static PyObject *__pyx_n_s_sta; static PyObject *__pyx_n_s_standard; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_step; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_str; static PyObject *__pyx_n_s_strd; static PyObject *__pyx_n_s_stride; static PyObject *__pyx_kp_s_strides_must_all_be_1_for_string; static PyObject *__pyx_kp_s_strides_must_all_be_1_for_vlen_v; static PyObject *__pyx_n_s_string; static PyObject *__pyx_kp_s_string_type; static PyObject *__pyx_n_s_stringtoarr; static PyObject *__pyx_n_s_stringtochar; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_strt; static PyObject *__pyx_n_s_subdtype; static PyObject *__pyx_n_s_sum; static PyObject *__pyx_n_s_supportedtypes; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_td; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_throw; static PyObject *__pyx_n_s_tile; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_time2index; static PyObject *__pyx_n_s_timedelta; static PyObject *__pyx_n_s_times; static PyObject *__pyx_n_s_timestr; static PyObject *__pyx_n_s_timestr_split; static PyObject *__pyx_kp_s_to_assign_values_to_a_non_scalar; static PyObject *__pyx_kp_s_to_retrieve_values_from_a_non_sc; static PyObject *__pyx_n_s_tolist; static PyObject *__pyx_n_s_toma; static PyObject *__pyx_n_s_tostr; static PyObject *__pyx_n_s_tostring; static PyObject *__pyx_n_s_totaltime; static PyObject *__pyx_n_s_traceback; static PyObject *__pyx_kp_s_trying_to_assign_illegal_value_t; static PyObject *__pyx_n_s_tsecs; static PyObject *__pyx_kp_s_type_must_string_or_unicode_S_or; static PyObject *__pyx_n_s_typecode; static PyObject *__pyx_n_s_typeid; static PyObject *__pyx_kp_s_u; static PyObject *__pyx_n_s_u1; static PyObject *__pyx_n_s_u2; static PyObject *__pyx_n_s_u4; static PyObject *__pyx_n_s_u8; static PyObject *__pyx_n_s_unicode; static PyObject *__pyx_n_s_unicode_error; static PyObject *__pyx_n_s_unit; static PyObject *__pyx_n_s_units; static PyObject *__pyx_n_s_unlimdims; static PyObject *__pyx_kp_s_unlimited_dimensions_s; static PyObject *__pyx_kp_s_unlimited_dimensions_s_2; static PyObject *__pyx_kp_s_unlimited_name_s_size_s; static PyObject *__pyx_kp_s_unrecognized_format_requested; static PyObject *__pyx_kp_s_unsupported_component_type_for_V; static PyObject *__pyx_kp_s_unsupported_datatype_specified_f; static PyObject *__pyx_kp_s_unsupported_datatype_specified_f_2; static PyObject *__pyx_kp_s_unsupported_time_units; static PyObject *__pyx_n_s_utc_offset; static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_n_s_utils; static PyObject *__pyx_n_s_utime; static PyObject *__pyx_n_s_v; static PyObject *__pyx_n_s_vInst; static PyObject *__pyx_n_s_vName; static PyObject *__pyx_n_s_val; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_value_2; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_var; static PyObject *__pyx_n_s_varInfo; static PyObject *__pyx_kp_s_variable_s_data_type_mismatch_be; static PyObject *__pyx_kp_s_variable_s_dimensions_mismatch_b; static PyObject *__pyx_kp_s_variable_s_rank_mismatch_between; static PyObject *__pyx_kp_s_variable_s_shape_mismatch_betwee; static PyObject *__pyx_n_s_variables; static PyObject *__pyx_kp_s_variables_dimensions_s; static PyObject *__pyx_kp_s_variables_s; static PyObject *__pyx_n_s_varid; static PyObject *__pyx_n_s_varname; static PyObject *__pyx_n_s_varnames; static PyObject *__pyx_n_s_vars; static PyObject *__pyx_n_s_version; static PyObject *__pyx_n_s_version_info; static PyObject *__pyx_n_s_vid; static PyObject *__pyx_n_s_view; static PyObject *__pyx_n_s_vlen; static PyObject *__pyx_kp_s_vlen_data_type_s; static PyObject *__pyx_kp_s_vlen_string_array_attributes_not; static PyObject *__pyx_n_s_vltype; static PyObject *__pyx_n_s_vltypes; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_walk_grps; static PyObject *__pyx_n_s_warn; static PyObject *__pyx_n_s_warnings; static PyObject *__pyx_n_s_weakref; static PyObject *__pyx_kp_s_wrong_data_type_in_object_array; static PyObject *__pyx_kp_s_wrong_data_type_should_be_s_got; static PyObject *__pyx_n_s_ws; static PyObject *__pyx_n_s_year; static PyObject *__pyx_kp_s_zero_not_allowed_as_a_reference; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_n_s_zlib; static PyObject *__pyx_pf_7netCDF4_8_netCDF4_20genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4__gethdf5libversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_2getlibversion(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_4_set_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_format); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_clobber, PyObject *__pyx_v_format, PyObject *__pyx_v_diskless, PyObject *__pyx_v_persist, PyObject *__pyx_v_keepweakref, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_2__enter__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_4__exit__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_atype, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6__getitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_8filepath(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_12__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_14close(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_16isopen(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static void __pyx_pf_7netCDF4_8_netCDF4_7Dataset_18__dealloc__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_20sync(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_22_redef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_24_enddef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_26set_fill_on(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_28set_fill_off(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_30createDimension(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_32renameDimension(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_34createCompoundType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_36createVLType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_38createEnumType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name, PyObject *__pyx_v_enum_dict); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_40createVariable(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_42renameVariable(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_44createGroup(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_groupname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_46ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_48setncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_50setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_52getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_54__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_56delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_58__setattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_60__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_62renameAttribute(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_64renameGroup(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldname, CYTHON_UNUSED PyObject *__pyx_v_newname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_66set_auto_maskandscale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_68set_auto_mask(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_70set_auto_scale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_72get_variables_by_attributes(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing_____get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_5Group___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_2close(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_4_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_5Group_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_name, PyObject *__pyx_v_size, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_2_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_pf_7netCDF4_8_netCDF4_9Dimension_8__len__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_10group(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_12isunlimited(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_name, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_2__array__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8_getdims(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8datatype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4size___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_12group(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_14ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_16setncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_18setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_attdict); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_20getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_22delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_24filters(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_26endian(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_28chunking(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_30get_var_chunk_cache(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_32set_var_chunk_cache(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_nelems, PyObject *__pyx_v_preemption); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_34__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_36__setattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_38__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_40renameAttribute(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_42__getitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_44_toma(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_46_assign_vlen(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_48__setitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data); /* proto */ static Py_ssize_t __pyx_pf_7netCDF4_8_netCDF4_8Variable_50__len__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_52assignValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_54getValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_56set_auto_maskandscale(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_maskandscale); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_58set_auto_scale(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_scale); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_60set_auto_mask(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_mask); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_62_put(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyArrayObject *__pyx_v_data, PyObject *__pyx_v_start, PyObject *__pyx_v_count, PyObject *__pyx_v_stride); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_64_get(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_count, PyObject *__pyx_v_stride); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing_____get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_enum_dict, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6_dateparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_timestr); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8stringtoarr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, PyObject *__pyx_v_NUMCHARS, PyObject *__pyx_v_dtype); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10stringtochar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12chartostring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_14date2num(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dates, PyObject *__pyx_v_units, PyObject *__pyx_v_calendar); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_16num2date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_times, PyObject *__pyx_v_units, PyObject *__pyx_v_calendar); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_18date2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dates, PyObject *__pyx_v_nctime, PyObject *__pyx_v_calendar, PyObject *__pyx_v_select); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_12__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_files, PyObject *__pyx_v_check, PyObject *__pyx_v_aggdim, PyObject *__pyx_v_exclude); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_2__setattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_4__getattribute__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_6ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_8close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9MFDataset_10__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dimname, CYTHON_UNUSED PyObject *__pyx_v_dim, PyObject *__pyx_v_dimlens, PyObject *__pyx_v_dimtotlen); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_2__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_4isunlimited(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10_Dimension_6__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dset, PyObject *__pyx_v_varname, PyObject *__pyx_v_var, PyObject *__pyx_v_recdimname); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_2typecode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_4ncattrs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_6__getattr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_10__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_12_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_14set_auto_maskandscale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9_Variable_16__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6MFTime___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_time, PyObject *__pyx_v_units); /* proto */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6MFTime_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /* proto */ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Dataset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Group(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Dimension(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_Variable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_CompoundType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_VLType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4_EnumType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; static PyObject *__pyx_float_0_0; static PyObject *__pyx_float_1_0; static PyObject *__pyx_float_24_; static PyObject *__pyx_float_60_; static PyObject *__pyx_float_1_e3; static PyObject *__pyx_float_1_e6; static PyObject *__pyx_float_1440_; static PyObject *__pyx_float_3600_; static PyObject *__pyx_float_86400_; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_6; static PyObject *__pyx_int_8; static PyObject *__pyx_int_10; static PyObject *__pyx_int_15; static PyObject *__pyx_int_24; static PyObject *__pyx_int_60; static PyObject *__pyx_int_1582; static PyObject *__pyx_int_1900; static PyObject *__pyx_int_3600; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_slice__9; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_slice__11; static PyObject *__pyx_slice__12; static PyObject *__pyx_slice__13; static PyObject *__pyx_slice__39; static PyObject *__pyx_slice__40; static PyObject *__pyx_slice__45; static PyObject *__pyx_slice__46; static PyObject *__pyx_slice__53; static PyObject *__pyx_slice__54; static PyObject *__pyx_slice__57; static PyObject *__pyx_slice__58; static PyObject *__pyx_slice__64; static PyObject *__pyx_slice__67; static PyObject *__pyx_slice__69; static PyObject *__pyx_slice__70; static PyObject *__pyx_slice__71; static PyObject *__pyx_slice__81; static PyObject *__pyx_slice__84; static PyObject *__pyx_slice__85; static PyObject *__pyx_slice__88; static PyObject *__pyx_slice__90; static PyObject *__pyx_slice__95; static PyObject *__pyx_slice__96; static PyObject *__pyx_slice__99; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__72; static PyObject *__pyx_tuple__73; static PyObject *__pyx_tuple__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__80; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__86; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__98; static PyObject *__pyx_slice__100; static PyObject *__pyx_slice__108; static PyObject *__pyx_slice__113; static PyObject *__pyx_slice__114; static PyObject *__pyx_slice__115; static PyObject *__pyx_slice__116; static PyObject *__pyx_slice__119; static PyObject *__pyx_slice__120; static PyObject *__pyx_slice__121; static PyObject *__pyx_slice__123; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__104; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__125; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__127; static PyObject *__pyx_tuple__129; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__134; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__136; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__140; static PyObject *__pyx_tuple__142; static PyObject *__pyx_tuple__144; static PyObject *__pyx_tuple__146; static PyObject *__pyx_tuple__148; static PyObject *__pyx_tuple__150; static PyObject *__pyx_tuple__152; static PyObject *__pyx_tuple__154; static PyObject *__pyx_tuple__156; static PyObject *__pyx_tuple__158; static PyObject *__pyx_tuple__160; static PyObject *__pyx_tuple__162; static PyObject *__pyx_tuple__164; static PyObject *__pyx_tuple__166; static PyObject *__pyx_tuple__168; static PyObject *__pyx_tuple__170; static PyObject *__pyx_tuple__172; static PyObject *__pyx_tuple__174; static PyObject *__pyx_tuple__176; static PyObject *__pyx_tuple__178; static PyObject *__pyx_tuple__180; static PyObject *__pyx_tuple__182; static PyObject *__pyx_tuple__184; static PyObject *__pyx_tuple__186; static PyObject *__pyx_tuple__188; static PyObject *__pyx_tuple__190; static PyObject *__pyx_tuple__192; static PyObject *__pyx_tuple__194; static PyObject *__pyx_tuple__195; static PyObject *__pyx_codeobj__132; static PyObject *__pyx_codeobj__133; static PyObject *__pyx_codeobj__138; static PyObject *__pyx_codeobj__141; static PyObject *__pyx_codeobj__143; static PyObject *__pyx_codeobj__145; static PyObject *__pyx_codeobj__147; static PyObject *__pyx_codeobj__149; static PyObject *__pyx_codeobj__151; static PyObject *__pyx_codeobj__153; static PyObject *__pyx_codeobj__155; static PyObject *__pyx_codeobj__157; static PyObject *__pyx_codeobj__159; static PyObject *__pyx_codeobj__161; static PyObject *__pyx_codeobj__163; static PyObject *__pyx_codeobj__165; static PyObject *__pyx_codeobj__167; static PyObject *__pyx_codeobj__169; static PyObject *__pyx_codeobj__171; static PyObject *__pyx_codeobj__173; static PyObject *__pyx_codeobj__175; static PyObject *__pyx_codeobj__177; static PyObject *__pyx_codeobj__179; static PyObject *__pyx_codeobj__181; static PyObject *__pyx_codeobj__183; static PyObject *__pyx_codeobj__185; static PyObject *__pyx_codeobj__187; static PyObject *__pyx_codeobj__189; static PyObject *__pyx_codeobj__191; static PyObject *__pyx_codeobj__193; static PyObject *__pyx_codeobj__196; static PyObject *__pyx_gb_7netCDF4_8_netCDF4_22generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ /* "netCDF4/_netCDF4.pyx":1020 * _format_dict['NETCDF3_64BIT'] = NC_FORMAT_64BIT * # invert dictionary mapping * _reverse_format_dict = dict((v, k) for k, v in _format_dict.iteritems()) # <<<<<<<<<<<<<< * # add duplicate entry (NETCDF3_64BIT == NETCDF3_64BIT_OFFSET) * IF HAS_CDF5_FORMAT: */ static PyObject *__pyx_pf_7netCDF4_8_netCDF4_20genexpr(CYTHON_UNUSED PyObject *__pyx_self) { struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)__pyx_tp_new_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr(__pyx_ptype_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_cur_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7netCDF4_8_netCDF4_22generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7netCDF4_8_netCDF4_22generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_7netCDF4_8_netCDF4___pyx_scope_struct__genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("None", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_r); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_t_5 == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; while (1) { __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4); if (unlikely(__pyx_t_7 == 0)) break; if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_v, (PyObject*)__pyx_cur_scope->__pyx_v_k))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":956 * # check for required version of netcdf-4 and hdf5. * * def _gethdf5libversion(): # <<<<<<<<<<<<<< * majorvers = H5_VERS_MAJOR * minorvers = H5_VERS_MINOR */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_1_gethdf5libversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_1_gethdf5libversion = {"_gethdf5libversion", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_1_gethdf5libversion, METH_NOARGS, 0}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_1_gethdf5libversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_gethdf5libversion (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4__gethdf5libversion(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4__gethdf5libversion(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_majorvers; int __pyx_v_minorvers; int __pyx_v_releasevers; PyObject *__pyx_v_patchstring = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_gethdf5libversion", 0); /* "netCDF4/_netCDF4.pyx":957 * * def _gethdf5libversion(): * majorvers = H5_VERS_MAJOR # <<<<<<<<<<<<<< * minorvers = H5_VERS_MINOR * releasevers = H5_VERS_RELEASE */ __pyx_v_majorvers = H5_VERS_MAJOR; /* "netCDF4/_netCDF4.pyx":958 * def _gethdf5libversion(): * majorvers = H5_VERS_MAJOR * minorvers = H5_VERS_MINOR # <<<<<<<<<<<<<< * releasevers = H5_VERS_RELEASE * patchstring = H5_VERS_SUBRELEASE.decode('ascii') */ __pyx_v_minorvers = H5_VERS_MINOR; /* "netCDF4/_netCDF4.pyx":959 * majorvers = H5_VERS_MAJOR * minorvers = H5_VERS_MINOR * releasevers = H5_VERS_RELEASE # <<<<<<<<<<<<<< * patchstring = H5_VERS_SUBRELEASE.decode('ascii') * if not patchstring: */ __pyx_v_releasevers = H5_VERS_RELEASE; /* "netCDF4/_netCDF4.pyx":960 * minorvers = H5_VERS_MINOR * releasevers = H5_VERS_RELEASE * patchstring = H5_VERS_SUBRELEASE.decode('ascii') # <<<<<<<<<<<<<< * if not patchstring: * return '%d.%d.%d' % (majorvers,minorvers,releasevers) */ __pyx_t_1 = __Pyx_decode_c_string(H5_VERS_SUBRELEASE, 0, strlen(H5_VERS_SUBRELEASE), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_patchstring = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":961 * releasevers = H5_VERS_RELEASE * patchstring = H5_VERS_SUBRELEASE.decode('ascii') * if not patchstring: # <<<<<<<<<<<<<< * return '%d.%d.%d' % (majorvers,minorvers,releasevers) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_patchstring); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":962 * patchstring = H5_VERS_SUBRELEASE.decode('ascii') * if not patchstring: * return '%d.%d.%d' % (majorvers,minorvers,releasevers) # <<<<<<<<<<<<<< * else: * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_majorvers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minorvers); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_releasevers); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_d_d_d, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":961 * releasevers = H5_VERS_RELEASE * patchstring = H5_VERS_SUBRELEASE.decode('ascii') * if not patchstring: # <<<<<<<<<<<<<< * return '%d.%d.%d' % (majorvers,minorvers,releasevers) * else: */ } /* "netCDF4/_netCDF4.pyx":964 * return '%d.%d.%d' % (majorvers,minorvers,releasevers) * else: * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring) # <<<<<<<<<<<<<< * * def getlibversion(): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_majorvers); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_minorvers); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_releasevers); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4); __Pyx_INCREF(__pyx_v_patchstring); __Pyx_GIVEREF(__pyx_v_patchstring); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_patchstring); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d_d_d_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":956 * # check for required version of netcdf-4 and hdf5. * * def _gethdf5libversion(): # <<<<<<<<<<<<<< * majorvers = H5_VERS_MAJOR * minorvers = H5_VERS_MINOR */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4._gethdf5libversion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_patchstring); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":966 * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring) * * def getlibversion(): # <<<<<<<<<<<<<< * """ * **`getlibversion()`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_3getlibversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_2getlibversion[] = "\n**`getlibversion()`**\n\nreturns a string describing the version of the netcdf library\nused to build the module, and when it was built.\n "; static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_3getlibversion = {"getlibversion", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_3getlibversion, METH_NOARGS, __pyx_doc_7netCDF4_8_netCDF4_2getlibversion}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_3getlibversion(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getlibversion (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_2getlibversion(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_2getlibversion(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getlibversion", 0); /* "netCDF4/_netCDF4.pyx":973 * used to build the module, and when it was built. * """ * return (nc_inq_libvers()).decode('ascii') # <<<<<<<<<<<<<< * * __netcdf4libversion__ = getlibversion().split()[0] */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((char *)nc_inq_libvers()); __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_r = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":966 * return '%d.%d.%d-%s' % (majorvers,minorvers,releasevers,patchstring) * * def getlibversion(): # <<<<<<<<<<<<<< * """ * **`getlibversion()`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.getlibversion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1066 * # internal C functions. * * cdef _get_att_names(int grpid, int varid): # <<<<<<<<<<<<<< * # Private function to get all the attribute names in a group * cdef int ierr, numatts, n */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_att_names(int __pyx_v_grpid, int __pyx_v_varid) { int __pyx_v_ierr; int __pyx_v_numatts; int __pyx_v_n; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_attslist = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_att_names", 0); /* "netCDF4/_netCDF4.pyx":1070 * cdef int ierr, numatts, n * cdef char namstring[NC_MAX_NAME+1] * if varid == NC_GLOBAL: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_natts(grpid, &numatts) */ __pyx_t_1 = ((__pyx_v_varid == NC_GLOBAL) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1071 * cdef char namstring[NC_MAX_NAME+1] * if varid == NC_GLOBAL: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_natts(grpid, &numatts) * else: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1072 * if varid == NC_GLOBAL: * with nogil: * ierr = nc_inq_natts(grpid, &numatts) # <<<<<<<<<<<<<< * else: * with nogil: */ __pyx_v_ierr = nc_inq_natts(__pyx_v_grpid, (&__pyx_v_numatts)); } /* "netCDF4/_netCDF4.pyx":1071 * cdef char namstring[NC_MAX_NAME+1] * if varid == NC_GLOBAL: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_natts(grpid, &numatts) * else: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "netCDF4/_netCDF4.pyx":1070 * cdef int ierr, numatts, n * cdef char namstring[NC_MAX_NAME+1] * if varid == NC_GLOBAL: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_natts(grpid, &numatts) */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":1074 * ierr = nc_inq_natts(grpid, &numatts) * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varnatts(grpid, varid, &numatts) * if ierr != NC_NOERR: */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1075 * else: * with nogil: * ierr = nc_inq_varnatts(grpid, varid, &numatts) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varnatts(__pyx_v_grpid, __pyx_v_varid, (&__pyx_v_numatts)); } /* "netCDF4/_netCDF4.pyx":1074 * ierr = nc_inq_natts(grpid, &numatts) * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varnatts(grpid, varid, &numatts) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":1076 * with nogil: * ierr = nc_inq_varnatts(grpid, varid, &numatts) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist = [] */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1077 * ierr = nc_inq_varnatts(grpid, varid, &numatts) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * attslist = [] * for n from 0 <= n < numatts: */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1076 * with nogil: * ierr = nc_inq_varnatts(grpid, varid, &numatts) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist = [] */ } /* "netCDF4/_netCDF4.pyx":1078 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist = [] # <<<<<<<<<<<<<< * for n from 0 <= n < numatts: * with nogil: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_attslist = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1079 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist = [] * for n from 0 <= n < numatts: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_attname(grpid, varid, n, namstring) */ __pyx_t_5 = __pyx_v_numatts; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_5; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1080 * attslist = [] * for n from 0 <= n < numatts: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_attname(grpid, varid, n, namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1081 * for n from 0 <= n < numatts: * with nogil: * ierr = nc_inq_attname(grpid, varid, n, namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_attname(__pyx_v_grpid, __pyx_v_varid, __pyx_v_n, __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":1080 * attslist = [] * for n from 0 <= n < numatts: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_attname(grpid, varid, n, namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "netCDF4/_netCDF4.pyx":1082 * with nogil: * ierr = nc_inq_attname(grpid, varid, n, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist.append(namstring.decode(default_encoding,unicode_error)) */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1083 * ierr = nc_inq_attname(grpid, varid, n, namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * attslist.append(namstring.decode(default_encoding,unicode_error)) * return attslist */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1082 * with nogil: * ierr = nc_inq_attname(grpid, varid, n, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist.append(namstring.decode(default_encoding,unicode_error)) */ } /* "netCDF4/_netCDF4.pyx":1084 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist.append(namstring.decode(default_encoding,unicode_error)) # <<<<<<<<<<<<<< * return attslist * */ __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attslist, __pyx_t_3); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":1085 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * attslist.append(namstring.decode(default_encoding,unicode_error)) * return attslist # <<<<<<<<<<<<<< * * cdef _get_att(grp, int varid, name): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_attslist); __pyx_r = __pyx_v_attslist; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1066 * # internal C functions. * * cdef _get_att_names(int grpid, int varid): # <<<<<<<<<<<<<< * # Private function to get all the attribute names in a group * cdef int ierr, numatts, n */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._get_att_names", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_attslist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1087 * return attslist * * cdef _get_att(grp, int varid, name): # <<<<<<<<<<<<<< * # Private function to get an attribute value given its name * cdef int ierr, n, _grpid */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_att(PyObject *__pyx_v_grp, int __pyx_v_varid, PyObject *__pyx_v_name) { int __pyx_v_ierr; int __pyx_v__grpid; size_t __pyx_v_att_len; char *__pyx_v_attname; char *__pyx_v_stratt; nc_type __pyx_v_att_type; PyArrayObject *__pyx_v_value_arr = 0; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_pstring = NULL; PyObject *__pyx_v_type_att = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; PyObject *__pyx_t_26 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_att", 0); /* "netCDF4/_netCDF4.pyx":1095 * cdef nc_type att_type * cdef ndarray value_arr * bytestr = _strencode(name) # <<<<<<<<<<<<<< * attname = bytestr * _grpid = grp._grpid */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1096 * cdef ndarray value_arr * bytestr = _strencode(name) * attname = bytestr # <<<<<<<<<<<<<< * _grpid = grp._grpid * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_attname = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1097 * bytestr = _strencode(name) * attname = bytestr * _grpid = grp._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_3; /* "netCDF4/_netCDF4.pyx":1098 * attname = bytestr * _grpid = grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1099 * _grpid = grp._grpid * with nogil: * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_att(__pyx_v__grpid, __pyx_v_varid, __pyx_v_attname, (&__pyx_v_att_type), (&__pyx_v_att_len)); } /* "netCDF4/_netCDF4.pyx":1098 * attname = bytestr * _grpid = grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1100 * with nogil: * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # attribute is a character or string ... */ __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1101 * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # attribute is a character or string ... * if att_type == NC_CHAR: */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1100 * with nogil: * ierr = nc_inq_att(_grpid, varid, attname, &att_type, &att_len) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # attribute is a character or string ... */ } /* "netCDF4/_netCDF4.pyx":1103 * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # attribute is a character or string ... * if att_type == NC_CHAR: # <<<<<<<<<<<<<< * value_arr = numpy.empty(att_len,'S1') * with nogil: */ switch (__pyx_v_att_type) { case NC_CHAR: /* "netCDF4/_netCDF4.pyx":1104 * # attribute is a character or string ... * if att_type == NC_CHAR: * value_arr = numpy.empty(att_len,'S1') # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_n_s_S1); __Pyx_GIVEREF(__pyx_n_s_S1); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_S1); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1105 * if att_type == NC_CHAR: * value_arr = numpy.empty(att_len,'S1') * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1106 * value_arr = numpy.empty(att_len,'S1') * with nogil: * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_get_att_text(__pyx_v__grpid, __pyx_v_varid, __pyx_v_attname, ((char *)__pyx_v_value_arr->data)); } /* "netCDF4/_netCDF4.pyx":1105 * if att_type == NC_CHAR: * value_arr = numpy.empty(att_len,'S1') * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "netCDF4/_netCDF4.pyx":1107 * with nogil: * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if name == '_FillValue' and python3: */ __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1108 * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if name == '_FillValue' and python3: * # make sure _FillValue for character arrays is a byte on python 3 */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1107 * with nogil: * ierr = nc_get_att_text(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if name == '_FillValue' and python3: */ } /* "netCDF4/_netCDF4.pyx":1109 * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if name == '_FillValue' and python3: # <<<<<<<<<<<<<< * # make sure _FillValue for character arrays is a byte on python 3 * # (issue 271). */ __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_FillValue, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_10) { } else { __pyx_t_4 = __pyx_t_10; goto __pyx_L12_bool_binop_done; } __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_10; __pyx_L12_bool_binop_done:; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1112 * # make sure _FillValue for character arrays is a byte on python 3 * # (issue 271). * pstring = bytes(value_arr) # <<<<<<<<<<<<<< * else: * pstring =\ */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_value_arr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_value_arr)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_value_arr)); __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_pstring = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1109 * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if name == '_FillValue' and python3: # <<<<<<<<<<<<<< * # make sure _FillValue for character arrays is a byte on python 3 * # (issue 271). */ goto __pyx_L11; } /* "netCDF4/_netCDF4.pyx":1115 * else: * pstring =\ * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<< * return pstring * elif att_type == NC_STRING: */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_tostring); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_8 = 1; } } __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_pstring = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L11:; /* "netCDF4/_netCDF4.pyx":1116 * pstring =\ * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','') * return pstring # <<<<<<<<<<<<<< * elif att_type == NC_STRING: * if att_len == 1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pstring); __pyx_r = __pyx_v_pstring; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1103 * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # attribute is a character or string ... * if att_type == NC_CHAR: # <<<<<<<<<<<<<< * value_arr = numpy.empty(att_len,'S1') * with nogil: */ break; /* "netCDF4/_netCDF4.pyx":1117 * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','') * return pstring * elif att_type == NC_STRING: # <<<<<<<<<<<<<< * if att_len == 1: * with nogil: */ case NC_STRING: /* "netCDF4/_netCDF4.pyx":1118 * return pstring * elif att_type == NC_STRING: * if att_len == 1: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) */ __pyx_t_4 = ((__pyx_v_att_len == 1) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1119 * elif att_type == NC_STRING: * if att_len == 1: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1120 * if att_len == 1: * with nogil: * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) # <<<<<<<<<<<<<< * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') * ierr = nc_free_string(1, &stratt) # free memory in netcdf C lib */ __pyx_v_ierr = nc_get_att_string(__pyx_v__grpid, __pyx_v_varid, __pyx_v_attname, (&__pyx_v_stratt)); } /* "netCDF4/_netCDF4.pyx":1119 * elif att_type == NC_STRING: * if att_len == 1: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "netCDF4/_netCDF4.pyx":1121 * with nogil: * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') # <<<<<<<<<<<<<< * ierr = nc_free_string(1, &stratt) # free memory in netcdf C lib * return pstring */ __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_stratt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_decode); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_8 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_5); __pyx_t_9 = 0; __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_v_pstring = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1122 * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') * ierr = nc_free_string(1, &stratt) # free memory in netcdf C lib # <<<<<<<<<<<<<< * return pstring * else: */ __pyx_v_ierr = nc_free_string(1, (&__pyx_v_stratt)); /* "netCDF4/_netCDF4.pyx":1123 * pstring = stratt.decode(default_encoding,unicode_error).replace('\x00','') * ierr = nc_free_string(1, &stratt) # free memory in netcdf C lib * return pstring # <<<<<<<<<<<<<< * else: * raise KeyError('vlen string array attributes not supported') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pstring); __pyx_r = __pyx_v_pstring; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1118 * return pstring * elif att_type == NC_STRING: * if att_len == 1: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_att_string(_grpid, varid, attname, &stratt) */ } /* "netCDF4/_netCDF4.pyx":1125 * return pstring * else: * raise KeyError('vlen string array attributes not supported') # <<<<<<<<<<<<<< * else: * # a regular numeric or compound type. */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":1117 * value_arr.tostring().decode(default_encoding,unicode_error).replace('\x00','') * return pstring * elif att_type == NC_STRING: # <<<<<<<<<<<<<< * if att_len == 1: * with nogil: */ break; default: /* "netCDF4/_netCDF4.pyx":1128 * else: * # a regular numeric or compound type. * if att_type == NC_LONG: # <<<<<<<<<<<<<< * att_type = NC_INT * try: */ __pyx_t_4 = ((__pyx_v_att_type == NC_LONG) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1129 * # a regular numeric or compound type. * if att_type == NC_LONG: * att_type = NC_INT # <<<<<<<<<<<<<< * try: * type_att = _nctonptype[att_type] # see if it is a primitive type */ __pyx_v_att_type = NC_INT; /* "netCDF4/_netCDF4.pyx":1128 * else: * # a regular numeric or compound type. * if att_type == NC_LONG: # <<<<<<<<<<<<<< * att_type = NC_INT * try: */ } /* "netCDF4/_netCDF4.pyx":1130 * if att_type == NC_LONG: * att_type = NC_INT * try: # <<<<<<<<<<<<<< * type_att = _nctonptype[att_type] # see if it is a primitive type * value_arr = numpy.empty(att_len,type_att) */ { __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1131 * att_type = NC_INT * try: * type_att = _nctonptype[att_type] # see if it is a primitive type # <<<<<<<<<<<<<< * value_arr = numpy.empty(att_len,type_att) * except KeyError: */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_att_type, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L19_error;}; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_type_att = __pyx_t_11; __pyx_t_11 = 0; /* "netCDF4/_netCDF4.pyx":1132 * try: * type_att = _nctonptype[att_type] # see if it is a primitive type * value_arr = numpy.empty(att_len,type_att) # <<<<<<<<<<<<<< * except KeyError: * # check if it's a compound */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_v_type_att); __Pyx_GIVEREF(__pyx_v_type_att); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_type_att); __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; /* "netCDF4/_netCDF4.pyx":1130 * if att_type == NC_LONG: * att_type = NC_INT * try: # <<<<<<<<<<<<<< * type_att = _nctonptype[att_type] # see if it is a primitive type * value_arr = numpy.empty(att_len,type_att) */ } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L26_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; /* "netCDF4/_netCDF4.pyx":1133 * type_att = _nctonptype[att_type] # see if it is a primitive type * value_arr = numpy.empty(att_len,type_att) * except KeyError: # <<<<<<<<<<<<<< * # check if it's a compound * try: */ __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_3) { __Pyx_AddTraceback("netCDF4._netCDF4._get_att", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_7, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "netCDF4/_netCDF4.pyx":1135 * except KeyError: * # check if it's a compound * try: # <<<<<<<<<<<<<< * type_att = _read_compound(grp, att_type) * value_arr = numpy.empty(att_len,type_att) */ { __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1136 * # check if it's a compound * try: * type_att = _read_compound(grp, att_type) # <<<<<<<<<<<<<< * value_arr = numpy.empty(att_len,type_att) * except: */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__read_compound(__pyx_v_grp, __pyx_v_att_type, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_type_att, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1137 * try: * type_att = _read_compound(grp, att_type) * value_arr = numpy.empty(att_len,type_att) # <<<<<<<<<<<<<< * except: * # check if it's an enum */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_18 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } __pyx_t_19 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_19); if (__pyx_t_18) { __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18); __pyx_t_18 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_v_type_att); __Pyx_GIVEREF(__pyx_v_type_att); PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_8, __pyx_v_type_att); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_XDECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1135 * except KeyError: * # check if it's a compound * try: # <<<<<<<<<<<<<< * type_att = _read_compound(grp, att_type) * value_arr = numpy.empty(att_len,type_att) */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L36_try_end; __pyx_L29_error:; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1138 * type_att = _read_compound(grp, att_type) * value_arr = numpy.empty(att_len,type_att) * except: # <<<<<<<<<<<<<< * # check if it's an enum * try: */ /*except:*/ { __Pyx_AddTraceback("netCDF4._netCDF4._get_att", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_19) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_19); /* "netCDF4/_netCDF4.pyx":1140 * except: * # check if it's an enum * try: # <<<<<<<<<<<<<< * type_att = _read_enum(grp, att_type) * value_arr = numpy.empty(att_len,type_att.dtype) */ { __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1141 * # check if it's an enum * try: * type_att = _read_enum(grp, att_type) # <<<<<<<<<<<<<< * value_arr = numpy.empty(att_len,type_att.dtype) * except: */ __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__read_enum(__pyx_v_grp, __pyx_v_att_type, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_type_att, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1142 * try: * type_att = _read_enum(grp, att_type) * value_arr = numpy.empty(att_len,type_att.dtype) # <<<<<<<<<<<<<< * except: * raise KeyError('attribute %s has unsupported datatype' % attname) */ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_18); __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_empty); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyInt_FromSize_t(__pyx_v_att_len); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_18); __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_att, __pyx_n_s_dtype); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_24); __pyx_t_25 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_23))) { __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_23); if (likely(__pyx_t_25)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); __Pyx_INCREF(__pyx_t_25); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_23, function); __pyx_t_8 = 1; } } __pyx_t_26 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_26); if (__pyx_t_25) { __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_26, 0, __pyx_t_25); __pyx_t_25 = NULL; } __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_26, 0+__pyx_t_8, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_24); PyTuple_SET_ITEM(__pyx_t_26, 1+__pyx_t_8, __pyx_t_24); __pyx_t_18 = 0; __pyx_t_24 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_26, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L39_error;} __Pyx_XDECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1140 * except: * # check if it's an enum * try: # <<<<<<<<<<<<<< * type_att = _read_enum(grp, att_type) * value_arr = numpy.empty(att_len,type_att.dtype) */ } __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; goto __pyx_L46_try_end; __pyx_L39_error:; __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1143 * type_att = _read_enum(grp, att_type) * value_arr = numpy.empty(att_len,type_att.dtype) * except: # <<<<<<<<<<<<<< * raise KeyError('attribute %s has unsupported datatype' % attname) * with nogil: */ /*except:*/ { __Pyx_AddTraceback("netCDF4._netCDF4._get_att", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_23, &__pyx_t_26) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_23); __Pyx_GOTREF(__pyx_t_26); /* "netCDF4/_netCDF4.pyx":1144 * value_arr = numpy.empty(att_len,type_att.dtype) * except: * raise KeyError('attribute %s has unsupported datatype' % attname) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) */ __pyx_t_24 = __Pyx_PyBytes_FromString(__pyx_v_attname); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} __Pyx_GOTREF(__pyx_t_24); __pyx_t_18 = __Pyx_PyString_Format(__pyx_kp_s_attribute_s_has_unsupported_data, __pyx_t_24); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} __Pyx_GOTREF(__pyx_t_24); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_18); __pyx_t_18 = 0; __pyx_t_18 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_24, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} __Pyx_GOTREF(__pyx_t_18); __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0; __Pyx_Raise(__pyx_t_18, 0, 0, 0); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L41_except_error;} } __pyx_L41_except_error:; /* "netCDF4/_netCDF4.pyx":1140 * except: * # check if it's an enum * try: # <<<<<<<<<<<<<< * type_att = _read_enum(grp, att_type) * value_arr = numpy.empty(att_len,type_att.dtype) */ __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); goto __pyx_L31_except_error; __pyx_L46_try_end:; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; goto __pyx_L30_exception_handled; } __pyx_L31_except_error:; /* "netCDF4/_netCDF4.pyx":1135 * except KeyError: * # check if it's a compound * try: # <<<<<<<<<<<<<< * type_att = _read_compound(grp, att_type) * value_arr = numpy.empty(att_len,type_att) */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L21_except_error; __pyx_L30_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_L36_try_end:; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L20_exception_handled; } goto __pyx_L21_except_error; __pyx_L21_except_error:; /* "netCDF4/_netCDF4.pyx":1130 * if att_type == NC_LONG: * att_type = NC_INT * try: # <<<<<<<<<<<<<< * type_att = _nctonptype[att_type] # see if it is a primitive type * value_arr = numpy.empty(att_len,type_att) */ __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); goto __pyx_L1_error; __pyx_L20_exception_handled:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_L26_try_end:; } /* "netCDF4/_netCDF4.pyx":1145 * except: * raise KeyError('attribute %s has unsupported datatype' % attname) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1146 * raise KeyError('attribute %s has unsupported datatype' % attname) * with nogil: * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_get_att(__pyx_v__grpid, __pyx_v_varid, __pyx_v_attname, __pyx_v_value_arr->data); } /* "netCDF4/_netCDF4.pyx":1145 * except: * raise KeyError('attribute %s has unsupported datatype' % attname) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L51; } __pyx_L51:; } } /* "netCDF4/_netCDF4.pyx":1147 * with nogil: * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if value_arr.shape == (): */ __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1148 * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if value_arr.shape == (): * # return a scalar for a scalar array */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1147 * with nogil: * ierr = nc_get_att(_grpid, varid, attname, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if value_arr.shape == (): */ } /* "netCDF4/_netCDF4.pyx":1149 * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if value_arr.shape == (): # <<<<<<<<<<<<<< * # return a scalar for a scalar array * return value_arr.item() */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1151 * if value_arr.shape == (): * # return a scalar for a scalar array * return value_arr.item() # <<<<<<<<<<<<<< * elif att_len == 1: * # return a scalar for a single element array */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_item); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (__pyx_t_11) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1149 * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * if value_arr.shape == (): # <<<<<<<<<<<<<< * # return a scalar for a scalar array * return value_arr.item() */ } /* "netCDF4/_netCDF4.pyx":1152 * # return a scalar for a scalar array * return value_arr.item() * elif att_len == 1: # <<<<<<<<<<<<<< * # return a scalar for a single element array * return value_arr[0] */ __pyx_t_4 = ((__pyx_v_att_len == 1) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":1154 * elif att_len == 1: * # return a scalar for a single element array * return value_arr[0] # <<<<<<<<<<<<<< * else: * return value_arr */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_value_arr), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1152 * # return a scalar for a scalar array * return value_arr.item() * elif att_len == 1: # <<<<<<<<<<<<<< * # return a scalar for a single element array * return value_arr[0] */ } /* "netCDF4/_netCDF4.pyx":1156 * return value_arr[0] * else: * return value_arr # <<<<<<<<<<<<<< * * def _set_default_format(object format='NETCDF4'): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_value_arr)); __pyx_r = ((PyObject *)__pyx_v_value_arr); goto __pyx_L0; } break; } /* "netCDF4/_netCDF4.pyx":1087 * return attslist * * cdef _get_att(grp, int varid, name): # <<<<<<<<<<<<<< * # Private function to get an attribute value given its name * cdef int ierr, n, _grpid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_23); __Pyx_XDECREF(__pyx_t_24); __Pyx_XDECREF(__pyx_t_25); __Pyx_XDECREF(__pyx_t_26); __Pyx_AddTraceback("netCDF4._netCDF4._get_att", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_value_arr); __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_pstring); __Pyx_XDECREF(__pyx_v_type_att); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1158 * return value_arr * * def _set_default_format(object format='NETCDF4'): # <<<<<<<<<<<<<< * # Private function to set the netCDF file format * if format not in _format_dict: */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5_set_default_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_5_set_default_format = {"_set_default_format", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_5_set_default_format, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5_set_default_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_format = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_set_default_format (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_n_s_NETCDF4); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_default_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_format = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_set_default_format", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4._set_default_format", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_4_set_default_format(__pyx_self, __pyx_v_format); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_4_set_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_default_format", 0); /* "netCDF4/_netCDF4.pyx":1160 * def _set_default_format(object format='NETCDF4'): * # Private function to set the netCDF file format * if format not in _format_dict: # <<<<<<<<<<<<<< * raise ValueError("unrecognized format requested") * nc_set_default_format(_format_dict[format], NULL) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_format, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1161 * # Private function to set the netCDF file format * if format not in _format_dict: * raise ValueError("unrecognized format requested") # <<<<<<<<<<<<<< * nc_set_default_format(_format_dict[format], NULL) * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1160 * def _set_default_format(object format='NETCDF4'): * # Private function to set the netCDF file format * if format not in _format_dict: # <<<<<<<<<<<<<< * raise ValueError("unrecognized format requested") * nc_set_default_format(_format_dict[format], NULL) */ } /* "netCDF4/_netCDF4.pyx":1162 * if format not in _format_dict: * raise ValueError("unrecognized format requested") * nc_set_default_format(_format_dict[format], NULL) # <<<<<<<<<<<<<< * * cdef _get_format(int grpid): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_format); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; nc_set_default_format(__pyx_t_5, NULL); /* "netCDF4/_netCDF4.pyx":1158 * return value_arr * * def _set_default_format(object format='NETCDF4'): # <<<<<<<<<<<<<< * # Private function to set the netCDF file format * if format not in _format_dict: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4._set_default_format", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1164 * nc_set_default_format(_format_dict[format], NULL) * * cdef _get_format(int grpid): # <<<<<<<<<<<<<< * # Private function to get the netCDF file format * cdef int ierr, formatp */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_format(int __pyx_v_grpid) { int __pyx_v_ierr; int __pyx_v_formatp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_format", 0); /* "netCDF4/_netCDF4.pyx":1167 * # Private function to get the netCDF file format * cdef int ierr, formatp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_format(grpid, &formatp) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1168 * cdef int ierr, formatp * with nogil: * ierr = nc_inq_format(grpid, &formatp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_format(__pyx_v_grpid, (&__pyx_v_formatp)); } /* "netCDF4/_netCDF4.pyx":1167 * # Private function to get the netCDF file format * cdef int ierr, formatp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_format(grpid, &formatp) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1169 * with nogil: * ierr = nc_inq_format(grpid, &formatp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if formatp not in _reverse_format_dict: */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1170 * ierr = nc_inq_format(grpid, &formatp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if formatp not in _reverse_format_dict: * raise ValueError('format not supported by python interface') */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1169 * with nogil: * ierr = nc_inq_format(grpid, &formatp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if formatp not in _reverse_format_dict: */ } /* "netCDF4/_netCDF4.pyx":1171 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if formatp not in _reverse_format_dict: # <<<<<<<<<<<<<< * raise ValueError('format not supported by python interface') * return _reverse_format_dict[formatp] */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_formatp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_reverse_format_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":1172 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if formatp not in _reverse_format_dict: * raise ValueError('format not supported by python interface') # <<<<<<<<<<<<<< * return _reverse_format_dict[formatp] * */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1171 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if formatp not in _reverse_format_dict: # <<<<<<<<<<<<<< * raise ValueError('format not supported by python interface') * return _reverse_format_dict[formatp] */ } /* "netCDF4/_netCDF4.pyx":1173 * if formatp not in _reverse_format_dict: * raise ValueError('format not supported by python interface') * return _reverse_format_dict[formatp] # <<<<<<<<<<<<<< * * cdef _get_full_format(int grpid): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_reverse_format_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_formatp, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1164 * nc_set_default_format(_format_dict[format], NULL) * * cdef _get_format(int grpid): # <<<<<<<<<<<<<< * # Private function to get the netCDF file format * cdef int ierr, formatp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4._get_format", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1175 * return _reverse_format_dict[formatp] * * cdef _get_full_format(int grpid): # <<<<<<<<<<<<<< * # Private function to get the underlying disk format * cdef int ierr, formatp, modep */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_full_format(CYTHON_UNUSED int __pyx_v_grpid) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get_full_format", 0); /* "netCDF4/_netCDF4.pyx":1198 * return 'UNDEFINED' * ELSE: * return 'UNDEFINED' # <<<<<<<<<<<<<< * * cdef _set_att(grp, int varid, name, value, nc_type xtype=-99): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_UNDEFINED); __pyx_r = __pyx_n_s_UNDEFINED; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1175 * return _reverse_format_dict[formatp] * * cdef _get_full_format(int grpid): # <<<<<<<<<<<<<< * # Private function to get the underlying disk format * cdef int ierr, formatp, modep */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1200 * return 'UNDEFINED' * * cdef _set_att(grp, int varid, name, value, nc_type xtype=-99): # <<<<<<<<<<<<<< * # Private function to set an attribute name/value pair * cdef int i, ierr, lenarr, n */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__set_att(PyObject *__pyx_v_grp, int __pyx_v_varid, PyObject *__pyx_v_name, PyObject *__pyx_v_value, struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att *__pyx_optional_args) { nc_type __pyx_v_xtype = ((nc_type)-99); int __pyx_v_ierr; int __pyx_v_lenarr; size_t __pyx_v_att_len; nc_type __pyx_v_att_type; char *__pyx_v_attname; char *__pyx_v_datstring; PyArrayObject *__pyx_v_value_arr = 0; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_fmt = NULL; PyObject *__pyx_v_is_netcdf3 = NULL; PyObject *__pyx_v_dats = NULL; PyObject *__pyx_v_value_arr1 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; nc_type __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_set_att", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_xtype = __pyx_optional_args->xtype; } } /* "netCDF4/_netCDF4.pyx":1208 * cdef char *datstring * cdef ndarray value_arr * bytestr = _strencode(name) # <<<<<<<<<<<<<< * attname = bytestr * # put attribute value into a numpy array. */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1209 * cdef ndarray value_arr * bytestr = _strencode(name) * attname = bytestr # <<<<<<<<<<<<<< * # put attribute value into a numpy array. * value_arr = numpy.array(value) */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_attname = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1211 * attname = bytestr * # put attribute value into a numpy array. * value_arr = numpy.array(value) # <<<<<<<<<<<<<< * # if array is 64 bit integers or * # if 64-bit datatype not supported, cast to 32 bit integers. */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_value_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1214 * # if array is 64 bit integers or * # if 64-bit datatype not supported, cast to 32 bit integers. * fmt = _get_format(grp._grpid) # <<<<<<<<<<<<<< * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_format(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_fmt = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1215 * # if 64-bit datatype not supported, cast to 32 bit integers. * fmt = _get_format(grp._grpid) * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' # <<<<<<<<<<<<<< * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ * is_netcdf3): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_7) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = PyObject_RichCompare(__pyx_v_fmt, __pyx_n_s_NETCDF4_CLASSIC, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_L3_bool_binop_done:; __pyx_v_is_netcdf3 = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1216 * fmt = _get_format(grp._grpid) * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ # <<<<<<<<<<<<<< * is_netcdf3): * value_arr = value_arr.astype('i4') */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__9, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_i8, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_i8, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (__pyx_t_8 != 0); if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":1217 * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ * is_netcdf3): # <<<<<<<<<<<<<< * value_arr = value_arr.astype('i4') * # if array contains ascii strings, write a text attribute (stored as bytes). */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_is_netcdf3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __pyx_t_9; __pyx_L6_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":1216 * fmt = _get_format(grp._grpid) * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ # <<<<<<<<<<<<<< * is_netcdf3): * value_arr = value_arr.astype('i4') */ if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1218 * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ * is_netcdf3): * value_arr = value_arr.astype('i4') # <<<<<<<<<<<<<< * # if array contains ascii strings, write a text attribute (stored as bytes). * # if array contains unicode strings, and data model is NETCDF4, */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_value_arr, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1216 * fmt = _get_format(grp._grpid) * is_netcdf3 = fmt.startswith('NETCDF3') or fmt == 'NETCDF4_CLASSIC' * if value_arr.dtype.str[1:] == 'i8' and ('i8' not in _supportedtypes or\ # <<<<<<<<<<<<<< * is_netcdf3): * value_arr = value_arr.astype('i4') */ } /* "netCDF4/_netCDF4.pyx":1222 * # if array contains unicode strings, and data model is NETCDF4, * # write as a string. string arrays are concatenated into a single string. * if value_arr.dtype.char in ['S','U']: # <<<<<<<<<<<<<< * if not value_arr.shape: * dats = _strencode(value_arr.item()) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L10_bool_binop_done; } __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = __pyx_t_9; __pyx_L10_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (__pyx_t_7 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":1223 * # write as a string. string arrays are concatenated into a single string. * if value_arr.dtype.char in ['S','U']: * if not value_arr.shape: # <<<<<<<<<<<<<< * dats = _strencode(value_arr.item()) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_9) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1224 * if value_arr.dtype.char in ['S','U']: * if not value_arr.shape: * dats = _strencode(value_arr.item()) # <<<<<<<<<<<<<< * else: * value_arr1 = value_arr.ravel() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dats = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1223 * # write as a string. string arrays are concatenated into a single string. * if value_arr.dtype.char in ['S','U']: * if not value_arr.shape: # <<<<<<<<<<<<<< * dats = _strencode(value_arr.item()) * else: */ goto __pyx_L12; } /* "netCDF4/_netCDF4.pyx":1226 * dats = _strencode(value_arr.item()) * else: * value_arr1 = value_arr.ravel() # <<<<<<<<<<<<<< * dats = _strencode(''.join(value_arr1.tolist())) * lenarr = len(dats) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_ravel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_value_arr1 = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":1227 * else: * value_arr1 = value_arr.ravel() * dats = _strencode(''.join(value_arr1.tolist())) # <<<<<<<<<<<<<< * lenarr = len(dats) * datstring = dats */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_arr1, __pyx_n_s_tolist); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dats = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L12:; /* "netCDF4/_netCDF4.pyx":1228 * value_arr1 = value_arr.ravel() * dats = _strencode(''.join(value_arr1.tolist())) * lenarr = len(dats) # <<<<<<<<<<<<<< * datstring = dats * if lenarr == 0: */ __pyx_t_10 = PyObject_Length(__pyx_v_dats); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_lenarr = __pyx_t_10; /* "netCDF4/_netCDF4.pyx":1229 * dats = _strencode(''.join(value_arr1.tolist())) * lenarr = len(dats) * datstring = dats # <<<<<<<<<<<<<< * if lenarr == 0: * # write null byte */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_dats); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_datstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1230 * lenarr = len(dats) * datstring = dats * if lenarr == 0: # <<<<<<<<<<<<<< * # write null byte * lenarr=1; datstring = '\x00' */ __pyx_t_7 = ((__pyx_v_lenarr == 0) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1232 * if lenarr == 0: * # write null byte * lenarr=1; datstring = '\x00' # <<<<<<<<<<<<<< * if value_arr.dtype.char == 'U' and not is_netcdf3: * # check to see if attribute already exists */ __pyx_v_lenarr = 1; __pyx_v_datstring = __pyx_k_; /* "netCDF4/_netCDF4.pyx":1230 * lenarr = len(dats) * datstring = dats * if lenarr == 0: # <<<<<<<<<<<<<< * # write null byte * lenarr=1; datstring = '\x00' */ } /* "netCDF4/_netCDF4.pyx":1233 * # write null byte * lenarr=1; datstring = '\x00' * if value_arr.dtype.char == 'U' and not is_netcdf3: # <<<<<<<<<<<<<< * # check to see if attribute already exists * # and is NC_CHAR, if so delete it and re-create it */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_char); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L15_bool_binop_done; } __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_is_netcdf3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((!__pyx_t_9) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L15_bool_binop_done:; if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1239 * # with commit 473259b7728120bb281c52359b1af50cca2fcb72, * # which was included in 4.4.0-RC5. * if _needsworkaround_issue485: # <<<<<<<<<<<<<< * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) * if ierr == NC_NOERR and att_type == NC_CHAR: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_needsworkaround_issue485); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1240 * # which was included in 4.4.0-RC5. * if _needsworkaround_issue485: * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) # <<<<<<<<<<<<<< * if ierr == NC_NOERR and att_type == NC_CHAR: * ierr = nc_del_att(grp._grpid, varid, attname) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_inq_att(__pyx_t_6, __pyx_v_varid, __pyx_v_attname, (&__pyx_v_att_type), (&__pyx_v_att_len)); /* "netCDF4/_netCDF4.pyx":1241 * if _needsworkaround_issue485: * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) * if ierr == NC_NOERR and att_type == NC_CHAR: # <<<<<<<<<<<<<< * ierr = nc_del_att(grp._grpid, varid, attname) * if ierr != NC_NOERR: */ __pyx_t_8 = ((__pyx_v_ierr == NC_NOERR) != 0); if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L19_bool_binop_done; } __pyx_t_8 = ((__pyx_v_att_type == NC_CHAR) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L19_bool_binop_done:; if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1242 * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) * if ierr == NC_NOERR and att_type == NC_CHAR: * ierr = nc_del_att(grp._grpid, varid, attname) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_del_att(__pyx_t_6, __pyx_v_varid, __pyx_v_attname); /* "netCDF4/_netCDF4.pyx":1243 * if ierr == NC_NOERR and att_type == NC_CHAR: * ierr = nc_del_att(grp._grpid, varid, attname) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # a unicode string, use put_att_string (if NETCDF4 file). */ __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1244 * ierr = nc_del_att(grp._grpid, varid, attname) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # a unicode string, use put_att_string (if NETCDF4 file). * ierr = nc_put_att_string(grp._grpid, varid, attname, 1, &datstring) */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1243 * if ierr == NC_NOERR and att_type == NC_CHAR: * ierr = nc_del_att(grp._grpid, varid, attname) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # a unicode string, use put_att_string (if NETCDF4 file). */ } /* "netCDF4/_netCDF4.pyx":1241 * if _needsworkaround_issue485: * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) * if ierr == NC_NOERR and att_type == NC_CHAR: # <<<<<<<<<<<<<< * ierr = nc_del_att(grp._grpid, varid, attname) * if ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":1239 * # with commit 473259b7728120bb281c52359b1af50cca2fcb72, * # which was included in 4.4.0-RC5. * if _needsworkaround_issue485: # <<<<<<<<<<<<<< * ierr = nc_inq_att(grp._grpid, varid, attname, &att_type, &att_len) * if ierr == NC_NOERR and att_type == NC_CHAR: */ } /* "netCDF4/_netCDF4.pyx":1246 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # a unicode string, use put_att_string (if NETCDF4 file). * ierr = nc_put_att_string(grp._grpid, varid, attname, 1, &datstring) # <<<<<<<<<<<<<< * else: * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_put_att_string(__pyx_t_6, __pyx_v_varid, __pyx_v_attname, 1, (&__pyx_v_datstring)); /* "netCDF4/_netCDF4.pyx":1233 * # write null byte * lenarr=1; datstring = '\x00' * if value_arr.dtype.char == 'U' and not is_netcdf3: # <<<<<<<<<<<<<< * # check to see if attribute already exists * # and is NC_CHAR, if so delete it and re-create it */ goto __pyx_L14; } /* "netCDF4/_netCDF4.pyx":1248 * ierr = nc_put_att_string(grp._grpid, varid, attname, 1, &datstring) * else: * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_put_att_text(__pyx_t_6, __pyx_v_varid, __pyx_v_attname, __pyx_v_lenarr, __pyx_v_datstring); } __pyx_L14:; /* "netCDF4/_netCDF4.pyx":1249 * else: * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # a 'regular' array type ('f4','i4','f8' etc) */ __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1250 * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # a 'regular' array type ('f4','i4','f8' etc) * else: */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1249 * else: * ierr = nc_put_att_text(grp._grpid, varid, attname, lenarr, datstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * # a 'regular' array type ('f4','i4','f8' etc) */ } /* "netCDF4/_netCDF4.pyx":1222 * # if array contains unicode strings, and data model is NETCDF4, * # write as a string. string arrays are concatenated into a single string. * if value_arr.dtype.char in ['S','U']: # <<<<<<<<<<<<<< * if not value_arr.shape: * dats = _strencode(value_arr.item()) */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":1253 * # a 'regular' array type ('f4','i4','f8' etc) * else: * if value_arr.dtype.kind == 'V': # compound attribute. # <<<<<<<<<<<<<< * xtype = _find_cmptype(grp,value_arr.dtype) * elif value_arr.dtype.str[1:] not in _supportedtypes: */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_V, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":1254 * else: * if value_arr.dtype.kind == 'V': # compound attribute. * xtype = _find_cmptype(grp,value_arr.dtype) # <<<<<<<<<<<<<< * elif value_arr.dtype.str[1:] not in _supportedtypes: * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__find_cmptype(__pyx_v_grp, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyInt_As_nc_type(__pyx_t_1); if (unlikely((__pyx_t_11 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xtype = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":1253 * # a 'regular' array type ('f4','i4','f8' etc) * else: * if value_arr.dtype.kind == 'V': # compound attribute. # <<<<<<<<<<<<<< * xtype = _find_cmptype(grp,value_arr.dtype) * elif value_arr.dtype.str[1:] not in _supportedtypes: */ goto __pyx_L23; } /* "netCDF4/_netCDF4.pyx":1255 * if value_arr.dtype.kind == 'V': # compound attribute. * xtype = _find_cmptype(grp,value_arr.dtype) * elif value_arr.dtype.str[1:] not in _supportedtypes: # <<<<<<<<<<<<<< * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) * elif xtype == -99: # if xtype is not passed in as kwarg. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__11, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":1256 * xtype = _find_cmptype(grp,value_arr.dtype) * elif value_arr.dtype.str[1:] not in _supportedtypes: * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) # <<<<<<<<<<<<<< * elif xtype == -99: # if xtype is not passed in as kwarg. * xtype = _nptonctype[value_arr.dtype.str[1:]] */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__12, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_illegal_data_type_for_attribute, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1255 * if value_arr.dtype.kind == 'V': # compound attribute. * xtype = _find_cmptype(grp,value_arr.dtype) * elif value_arr.dtype.str[1:] not in _supportedtypes: # <<<<<<<<<<<<<< * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) * elif xtype == -99: # if xtype is not passed in as kwarg. */ } /* "netCDF4/_netCDF4.pyx":1257 * elif value_arr.dtype.str[1:] not in _supportedtypes: * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) * elif xtype == -99: # if xtype is not passed in as kwarg. # <<<<<<<<<<<<<< * xtype = _nptonctype[value_arr.dtype.str[1:]] * lenarr = PyArray_SIZE(value_arr) */ __pyx_t_8 = ((__pyx_v_xtype == -99L) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":1258 * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) * elif xtype == -99: # if xtype is not passed in as kwarg. * xtype = _nptonctype[value_arr.dtype.str[1:]] # <<<<<<<<<<<<<< * lenarr = PyArray_SIZE(value_arr) * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_value_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyInt_As_nc_type(__pyx_t_5); if (unlikely((__pyx_t_11 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_xtype = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":1257 * elif value_arr.dtype.str[1:] not in _supportedtypes: * raise TypeError, 'illegal data type for attribute, must be one of %s, got %s' % (_supportedtypes, value_arr.dtype.str[1:]) * elif xtype == -99: # if xtype is not passed in as kwarg. # <<<<<<<<<<<<<< * xtype = _nptonctype[value_arr.dtype.str[1:]] * lenarr = PyArray_SIZE(value_arr) */ } __pyx_L23:; /* "netCDF4/_netCDF4.pyx":1259 * elif xtype == -99: # if xtype is not passed in as kwarg. * xtype = _nptonctype[value_arr.dtype.str[1:]] * lenarr = PyArray_SIZE(value_arr) # <<<<<<<<<<<<<< * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) * if ierr != NC_NOERR: */ __pyx_v_lenarr = PyArray_SIZE(__pyx_v_value_arr); /* "netCDF4/_netCDF4.pyx":1260 * xtype = _nptonctype[value_arr.dtype.str[1:]] * lenarr = PyArray_SIZE(value_arr) * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ierr = nc_put_att(__pyx_t_6, __pyx_v_varid, __pyx_v_attname, __pyx_v_xtype, __pyx_v_lenarr, __pyx_v_value_arr->data); /* "netCDF4/_netCDF4.pyx":1261 * lenarr = PyArray_SIZE(value_arr) * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":1262 * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) * if ierr != NC_NOERR: * raise AttributeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * cdef _get_types(group): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1261 * lenarr = PyArray_SIZE(value_arr) * ierr = nc_put_att(grp._grpid, varid, attname, xtype, lenarr, value_arr.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * */ } } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":1200 * return 'UNDEFINED' * * cdef _set_att(grp, int varid, name, value, nc_type xtype=-99): # <<<<<<<<<<<<<< * # Private function to set an attribute name/value pair * cdef int i, ierr, lenarr, n */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4._set_att", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_value_arr); __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_fmt); __Pyx_XDECREF(__pyx_v_is_netcdf3); __Pyx_XDECREF(__pyx_v_dats); __Pyx_XDECREF(__pyx_v_value_arr1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1264 * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * * cdef _get_types(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.CompoundType`, * # `netCDF4.VLType` or `netCDF4.EnumType` instances for all the */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_types(PyObject *__pyx_v_group) { int __pyx_v_ierr; int __pyx_v_ntypes; int __pyx_v_classp; int __pyx_v_n; int __pyx_v__grpid; nc_type __pyx_v_xtype; nc_type *__pyx_v_typeids; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_cmptypes = NULL; PyObject *__pyx_v_vltypes = NULL; PyObject *__pyx_v_enumtypes = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_cmptype = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_vltype = NULL; PyObject *__pyx_v_enumtype = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_types", 0); /* "netCDF4/_netCDF4.pyx":1272 * cdef nc_type *typeids * cdef char namstring[NC_MAX_NAME+1] * _grpid = group._grpid # <<<<<<<<<<<<<< * # get the number of user defined types in this group. * with nogil: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1274 * _grpid = group._grpid * # get the number of user defined types in this group. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1275 * # get the number of user defined types in this group. * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_typeids(__pyx_v__grpid, (&__pyx_v_ntypes), NULL); } /* "netCDF4/_netCDF4.pyx":1274 * _grpid = group._grpid * # get the number of user defined types in this group. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1276 * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ntypes > 0: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1277 * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if ntypes > 0: * typeids = malloc(sizeof(nc_type) * ntypes) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1276 * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ntypes > 0: */ } /* "netCDF4/_netCDF4.pyx":1278 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ntypes > 0: # <<<<<<<<<<<<<< * typeids = malloc(sizeof(nc_type) * ntypes) * with nogil: */ __pyx_t_3 = ((__pyx_v_ntypes > 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1279 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ntypes > 0: * typeids = malloc(sizeof(nc_type) * ntypes) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) */ __pyx_v_typeids = ((nc_type *)malloc(((sizeof(nc_type)) * __pyx_v_ntypes))); /* "netCDF4/_netCDF4.pyx":1280 * if ntypes > 0: * typeids = malloc(sizeof(nc_type) * ntypes) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1281 * typeids = malloc(sizeof(nc_type) * ntypes) * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_typeids(__pyx_v__grpid, (&__pyx_v_ntypes), __pyx_v_typeids); } /* "netCDF4/_netCDF4.pyx":1280 * if ntypes > 0: * typeids = malloc(sizeof(nc_type) * ntypes) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "netCDF4/_netCDF4.pyx":1282 * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for CompoundType instances. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1283 * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # create empty dictionary for CompoundType instances. * cmptypes = OrderedDict() */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1282 * with nogil: * ierr = nc_inq_typeids(_grpid, &ntypes, typeids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for CompoundType instances. */ } /* "netCDF4/_netCDF4.pyx":1278 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ntypes > 0: # <<<<<<<<<<<<<< * typeids = malloc(sizeof(nc_type) * ntypes) * with nogil: */ } /* "netCDF4/_netCDF4.pyx":1285 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for CompoundType instances. * cmptypes = OrderedDict() # <<<<<<<<<<<<<< * vltypes = OrderedDict() * enumtypes = OrderedDict() */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cmptypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1286 * # create empty dictionary for CompoundType instances. * cmptypes = OrderedDict() * vltypes = OrderedDict() # <<<<<<<<<<<<<< * enumtypes = OrderedDict() * if ntypes > 0: */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_vltypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1287 * cmptypes = OrderedDict() * vltypes = OrderedDict() * enumtypes = OrderedDict() # <<<<<<<<<<<<<< * if ntypes > 0: * for n from 0 <= n < ntypes: */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_enumtypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1288 * vltypes = OrderedDict() * enumtypes = OrderedDict() * if ntypes > 0: # <<<<<<<<<<<<<< * for n from 0 <= n < ntypes: * xtype = typeids[n] */ __pyx_t_3 = ((__pyx_v_ntypes > 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1289 * enumtypes = OrderedDict() * if ntypes > 0: * for n from 0 <= n < ntypes: # <<<<<<<<<<<<<< * xtype = typeids[n] * with nogil: */ __pyx_t_2 = __pyx_v_ntypes; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1290 * if ntypes > 0: * for n from 0 <= n < ntypes: * xtype = typeids[n] # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_user_type(_grpid, xtype, namstring, */ __pyx_v_xtype = (__pyx_v_typeids[__pyx_v_n]); /* "netCDF4/_netCDF4.pyx":1291 * for n from 0 <= n < ntypes: * xtype = typeids[n] * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, xtype, namstring, * NULL,NULL,NULL,&classp) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1292 * xtype = typeids[n] * with nogil: * ierr = nc_inq_user_type(_grpid, xtype, namstring, # <<<<<<<<<<<<<< * NULL,NULL,NULL,&classp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_inq_user_type(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_namstring, NULL, NULL, NULL, (&__pyx_v_classp)); } /* "netCDF4/_netCDF4.pyx":1291 * for n from 0 <= n < ntypes: * xtype = typeids[n] * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, xtype, namstring, * NULL,NULL,NULL,&classp) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L19; } __pyx_L19:; } } /* "netCDF4/_netCDF4.pyx":1294 * ierr = nc_inq_user_type(_grpid, xtype, namstring, * NULL,NULL,NULL,&classp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if classp == NC_COMPOUND: # a compound */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1295 * NULL,NULL,NULL,&classp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if classp == NC_COMPOUND: # a compound * name = namstring.decode(default_encoding,unicode_error) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1294 * ierr = nc_inq_user_type(_grpid, xtype, namstring, * NULL,NULL,NULL,&classp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if classp == NC_COMPOUND: # a compound */ } /* "netCDF4/_netCDF4.pyx":1296 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if classp == NC_COMPOUND: # a compound # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the compound type info from the file, */ switch (__pyx_v_classp) { case NC_COMPOUND: /* "netCDF4/_netCDF4.pyx":1297 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if classp == NC_COMPOUND: # a compound * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * # read the compound type info from the file, * # create a CompoundType instance from it. */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1300 * # read the compound type info from the file, * # create a CompoundType instance from it. * try: # <<<<<<<<<<<<<< * cmptype = _read_compound(group, xtype) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1301 * # create a CompoundType instance from it. * try: * cmptype = _read_compound(group, xtype) # <<<<<<<<<<<<<< * except KeyError: * msg='WARNING: unsupported Compound type, skipping...' */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__read_compound(__pyx_v_group, __pyx_v_xtype, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L21_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_cmptype, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1300 * # read the compound type info from the file, * # create a CompoundType instance from it. * try: # <<<<<<<<<<<<<< * cmptype = _read_compound(group, xtype) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L28_try_end; __pyx_L21_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1302 * try: * cmptype = _read_compound(group, xtype) * except KeyError: # <<<<<<<<<<<<<< * msg='WARNING: unsupported Compound type, skipping...' * warnings.warn(msg) */ __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_14) { __Pyx_AddTraceback("netCDF4._netCDF4._get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); /* "netCDF4/_netCDF4.pyx":1303 * cmptype = _read_compound(group, xtype) * except KeyError: * msg='WARNING: unsupported Compound type, skipping...' # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __Pyx_INCREF(__pyx_kp_s_WARNING_unsupported_Compound_typ); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_kp_s_WARNING_unsupported_Compound_typ); /* "netCDF4/_netCDF4.pyx":1304 * except KeyError: * msg='WARNING: unsupported Compound type, skipping...' * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * cmptypes[name] = cmptype */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_5) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1305 * msg='WARNING: unsupported Compound type, skipping...' * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * cmptypes[name] = cmptype * elif classp == NC_VLEN: # a vlen */ goto __pyx_L30_except_continue; __pyx_L30_except_continue:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L27_try_continue; } goto __pyx_L23_except_error; __pyx_L23_except_error:; /* "netCDF4/_netCDF4.pyx":1300 * # read the compound type info from the file, * # create a CompoundType instance from it. * try: # <<<<<<<<<<<<<< * cmptype = _read_compound(group, xtype) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L27_try_continue:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L13_continue; __pyx_L28_try_end:; } /* "netCDF4/_netCDF4.pyx":1306 * warnings.warn(msg) * continue * cmptypes[name] = cmptype # <<<<<<<<<<<<<< * elif classp == NC_VLEN: # a vlen * name = namstring.decode(default_encoding,unicode_error) */ if (unlikely(PyObject_SetItem(__pyx_v_cmptypes, __pyx_v_name, __pyx_v_cmptype) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1296 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if classp == NC_COMPOUND: # a compound # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the compound type info from the file, */ break; /* "netCDF4/_netCDF4.pyx":1307 * continue * cmptypes[name] = cmptype * elif classp == NC_VLEN: # a vlen # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the VLEN type info from the file, */ case NC_VLEN: /* "netCDF4/_netCDF4.pyx":1308 * cmptypes[name] = cmptype * elif classp == NC_VLEN: # a vlen * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * # read the VLEN type info from the file, * # create a VLType instance from it. */ __pyx_t_6 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } __pyx_t_15 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":1311 * # read the VLEN type info from the file, * # create a VLType instance from it. * try: # <<<<<<<<<<<<<< * vltype = _read_vlen(group, xtype) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1312 * # create a VLType instance from it. * try: * vltype = _read_vlen(group, xtype) # <<<<<<<<<<<<<< * except KeyError: * msg='WARNING: unsupported VLEN type, skipping...' */ __pyx_t_10 = __pyx_f_7netCDF4_8_netCDF4__read_vlen(__pyx_v_group, __pyx_v_xtype, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L31_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_vltype, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":1311 * # read the VLEN type info from the file, * # create a VLType instance from it. * try: # <<<<<<<<<<<<<< * vltype = _read_vlen(group, xtype) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L38_try_end; __pyx_L31_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":1313 * try: * vltype = _read_vlen(group, xtype) * except KeyError: # <<<<<<<<<<<<<< * msg='WARNING: unsupported VLEN type, skipping...' * warnings.warn(msg) */ __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_14) { __Pyx_AddTraceback("netCDF4._netCDF4._get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_15); /* "netCDF4/_netCDF4.pyx":1314 * vltype = _read_vlen(group, xtype) * except KeyError: * msg='WARNING: unsupported VLEN type, skipping...' # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __Pyx_INCREF(__pyx_kp_s_WARNING_unsupported_VLEN_type_sk); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_kp_s_WARNING_unsupported_VLEN_type_sk); /* "netCDF4/_netCDF4.pyx":1315 * except KeyError: * msg='WARNING: unsupported VLEN type, skipping...' * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * vltypes[name] = vltype */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_6) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L33_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1316 * msg='WARNING: unsupported VLEN type, skipping...' * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * vltypes[name] = vltype * elif classp == NC_ENUM: # an enum type */ goto __pyx_L40_except_continue; __pyx_L40_except_continue:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L37_try_continue; } goto __pyx_L33_except_error; __pyx_L33_except_error:; /* "netCDF4/_netCDF4.pyx":1311 * # read the VLEN type info from the file, * # create a VLType instance from it. * try: # <<<<<<<<<<<<<< * vltype = _read_vlen(group, xtype) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); goto __pyx_L1_error; __pyx_L37_try_continue:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11); goto __pyx_L13_continue; __pyx_L38_try_end:; } /* "netCDF4/_netCDF4.pyx":1317 * warnings.warn(msg) * continue * vltypes[name] = vltype # <<<<<<<<<<<<<< * elif classp == NC_ENUM: # an enum type * name = namstring.decode(default_encoding,unicode_error) */ if (unlikely(PyObject_SetItem(__pyx_v_vltypes, __pyx_v_name, __pyx_v_vltype) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1307 * continue * cmptypes[name] = cmptype * elif classp == NC_VLEN: # a vlen # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the VLEN type info from the file, */ break; /* "netCDF4/_netCDF4.pyx":1318 * continue * vltypes[name] = vltype * elif classp == NC_ENUM: # an enum type # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the Enum type info from the file, */ case NC_ENUM: /* "netCDF4/_netCDF4.pyx":1319 * vltypes[name] = vltype * elif classp == NC_ENUM: # an enum type * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * # read the Enum type info from the file, * # create a EnumType instance from it. */ __pyx_t_1 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_9 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_15); __pyx_t_15 = 0; /* "netCDF4/_netCDF4.pyx":1322 * # read the Enum type info from the file, * # create a EnumType instance from it. * try: # <<<<<<<<<<<<<< * enumtype = _read_enum(group, xtype) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1323 * # create a EnumType instance from it. * try: * enumtype = _read_enum(group, xtype) # <<<<<<<<<<<<<< * except KeyError: * msg='WARNING: unsupported Enum type, skipping...' */ __pyx_t_15 = __pyx_f_7netCDF4_8_netCDF4__read_enum(__pyx_v_group, __pyx_v_xtype, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L41_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_XDECREF_SET(__pyx_v_enumtype, __pyx_t_15); __pyx_t_15 = 0; /* "netCDF4/_netCDF4.pyx":1322 * # read the Enum type info from the file, * # create a EnumType instance from it. * try: # <<<<<<<<<<<<<< * enumtype = _read_enum(group, xtype) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L48_try_end; __pyx_L41_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; /* "netCDF4/_netCDF4.pyx":1324 * try: * enumtype = _read_enum(group, xtype) * except KeyError: # <<<<<<<<<<<<<< * msg='WARNING: unsupported Enum type, skipping...' * warnings.warn(msg) */ __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_14) { __Pyx_AddTraceback("netCDF4._netCDF4._get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_10, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_5); /* "netCDF4/_netCDF4.pyx":1325 * enumtype = _read_enum(group, xtype) * except KeyError: * msg='WARNING: unsupported Enum type, skipping...' # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __Pyx_INCREF(__pyx_kp_s_WARNING_unsupported_Enum_type_sk); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_kp_s_WARNING_unsupported_Enum_type_sk); /* "netCDF4/_netCDF4.pyx":1326 * except KeyError: * msg='WARNING: unsupported Enum type, skipping...' * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * enumtypes[name] = enumtype */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_1) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_msg); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1327 * msg='WARNING: unsupported Enum type, skipping...' * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * enumtypes[name] = enumtype * free(typeids) */ goto __pyx_L50_except_continue; __pyx_L50_except_continue:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L47_try_continue; } goto __pyx_L43_except_error; __pyx_L43_except_error:; /* "netCDF4/_netCDF4.pyx":1322 * # read the Enum type info from the file, * # create a EnumType instance from it. * try: # <<<<<<<<<<<<<< * enumtype = _read_enum(group, xtype) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L47_try_continue:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L13_continue; __pyx_L48_try_end:; } /* "netCDF4/_netCDF4.pyx":1328 * warnings.warn(msg) * continue * enumtypes[name] = enumtype # <<<<<<<<<<<<<< * free(typeids) * return cmptypes, vltypes, enumtypes */ if (unlikely(PyObject_SetItem(__pyx_v_enumtypes, __pyx_v_name, __pyx_v_enumtype) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1318 * continue * vltypes[name] = vltype * elif classp == NC_ENUM: # an enum type # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * # read the Enum type info from the file, */ break; default: break; } __pyx_L13_continue:; } /* "netCDF4/_netCDF4.pyx":1329 * continue * enumtypes[name] = enumtype * free(typeids) # <<<<<<<<<<<<<< * return cmptypes, vltypes, enumtypes * */ free(__pyx_v_typeids); /* "netCDF4/_netCDF4.pyx":1288 * vltypes = OrderedDict() * enumtypes = OrderedDict() * if ntypes > 0: # <<<<<<<<<<<<<< * for n from 0 <= n < ntypes: * xtype = typeids[n] */ } /* "netCDF4/_netCDF4.pyx":1330 * enumtypes[name] = enumtype * free(typeids) * return cmptypes, vltypes, enumtypes # <<<<<<<<<<<<<< * * cdef _get_dims(group): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_cmptypes); __Pyx_GIVEREF(__pyx_v_cmptypes); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cmptypes); __Pyx_INCREF(__pyx_v_vltypes); __Pyx_GIVEREF(__pyx_v_vltypes); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_vltypes); __Pyx_INCREF(__pyx_v_enumtypes); __Pyx_GIVEREF(__pyx_v_enumtypes); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_enumtypes); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1264 * raise AttributeError((nc_strerror(ierr)).decode('ascii')) * * cdef _get_types(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.CompoundType`, * # `netCDF4.VLType` or `netCDF4.EnumType` instances for all the */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("netCDF4._netCDF4._get_types", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cmptypes); __Pyx_XDECREF(__pyx_v_vltypes); __Pyx_XDECREF(__pyx_v_enumtypes); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_cmptype); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_vltype); __Pyx_XDECREF(__pyx_v_enumtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1332 * return cmptypes, vltypes, enumtypes * * cdef _get_dims(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Dimension` instances for all the * # dimensions in a `netCDF4.Group` or Dataset */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_dims(PyObject *__pyx_v_group) { int __pyx_v_ierr; int __pyx_v_numdims; int __pyx_v_n; int __pyx_v__grpid; int *__pyx_v_dimids; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_dimensions = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_dims", 0); /* "netCDF4/_netCDF4.pyx":1339 * cdef char namstring[NC_MAX_NAME+1] * # get number of dimensions in this Group. * _grpid = group._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_ndims(_grpid, &numdims) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1340 * # get number of dimensions in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_ndims(_grpid, &numdims) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1341 * _grpid = group._grpid * with nogil: * ierr = nc_inq_ndims(_grpid, &numdims) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_ndims(__pyx_v__grpid, (&__pyx_v_numdims)); } /* "netCDF4/_netCDF4.pyx":1340 * # get number of dimensions in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_ndims(_grpid, &numdims) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1342 * with nogil: * ierr = nc_inq_ndims(_grpid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for dimensions. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1343 * ierr = nc_inq_ndims(_grpid, &numdims) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # create empty dictionary for dimensions. * dimensions = OrderedDict() */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1342 * with nogil: * ierr = nc_inq_ndims(_grpid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for dimensions. */ } /* "netCDF4/_netCDF4.pyx":1345 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for dimensions. * dimensions = OrderedDict() # <<<<<<<<<<<<<< * if numdims > 0: * dimids = malloc(sizeof(int) * numdims) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dimensions = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1346 * # create empty dictionary for dimensions. * dimensions = OrderedDict() * if numdims > 0: # <<<<<<<<<<<<<< * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': */ __pyx_t_3 = ((__pyx_v_numdims > 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1347 * dimensions = OrderedDict() * if numdims > 0: * dimids = malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<< * if group.data_model == 'NETCDF4': * with nogil: */ __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims))); /* "netCDF4/_netCDF4.pyx":1348 * if numdims > 0: * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1349 * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1350 * if group.data_model == 'NETCDF4': * with nogil: * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_dimids(__pyx_v__grpid, (&__pyx_v_numdims), __pyx_v_dimids, 0); } /* "netCDF4/_netCDF4.pyx":1349 * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "netCDF4/_netCDF4.pyx":1351 * with nogil: * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1352 * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * for n from 0 <= n < numdims: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1351 * with nogil: * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ } /* "netCDF4/_netCDF4.pyx":1348 * if numdims > 0: * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_dimids(_grpid, &numdims, dimids, 0) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":1354 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * for n from 0 <= n < numdims: # <<<<<<<<<<<<<< * dimids[n] = n * for n from 0 <= n < numdims: */ /*else*/ { __pyx_t_2 = __pyx_v_numdims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1355 * else: * for n from 0 <= n < numdims: * dimids[n] = n # <<<<<<<<<<<<<< * for n from 0 <= n < numdims: * with nogil: */ (__pyx_v_dimids[__pyx_v_n]) = __pyx_v_n; } } __pyx_L8:; /* "netCDF4/_netCDF4.pyx":1356 * for n from 0 <= n < numdims: * dimids[n] = n * for n from 0 <= n < numdims: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) */ __pyx_t_2 = __pyx_v_numdims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1357 * dimids[n] = n * for n from 0 <= n < numdims: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1358 * for n from 0 <= n < numdims: * with nogil: * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_dimname(__pyx_v__grpid, (__pyx_v_dimids[__pyx_v_n]), __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":1357 * dimids[n] = n * for n from 0 <= n < numdims: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } /* "netCDF4/_netCDF4.pyx":1359 * with nogil: * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1360 * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * dimensions[name] = Dimension(group, name, id=dimids[n]) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1359 * with nogil: * ierr = nc_inq_dimname(_grpid, dimids[n], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":1361 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * dimensions[name] = Dimension(group, name, id=dimids[n]) * free(dimids) */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1362 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) * dimensions[name] = Dimension(group, name, id=dimids[n]) # <<<<<<<<<<<<<< * free(dimids) * return dimensions */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyInt_From_int((__pyx_v_dimids[__pyx_v_n])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_id, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dimension), __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyObject_SetItem(__pyx_v_dimensions, __pyx_v_name, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "netCDF4/_netCDF4.pyx":1363 * name = namstring.decode(default_encoding,unicode_error) * dimensions[name] = Dimension(group, name, id=dimids[n]) * free(dimids) # <<<<<<<<<<<<<< * return dimensions * */ free(__pyx_v_dimids); /* "netCDF4/_netCDF4.pyx":1346 * # create empty dictionary for dimensions. * dimensions = OrderedDict() * if numdims > 0: # <<<<<<<<<<<<<< * dimids = malloc(sizeof(int) * numdims) * if group.data_model == 'NETCDF4': */ } /* "netCDF4/_netCDF4.pyx":1364 * dimensions[name] = Dimension(group, name, id=dimids[n]) * free(dimids) * return dimensions # <<<<<<<<<<<<<< * * cdef _get_grps(group): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_dimensions); __pyx_r = __pyx_v_dimensions; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1332 * return cmptypes, vltypes, enumtypes * * cdef _get_dims(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Dimension` instances for all the * # dimensions in a `netCDF4.Group` or Dataset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._get_dims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dimensions); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1366 * return dimensions * * cdef _get_grps(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Group` instances for all the * # groups in a `netCDF4.Group` or Dataset */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_grps(PyObject *__pyx_v_group) { int __pyx_v_ierr; int __pyx_v_numgrps; int __pyx_v_n; int __pyx_v__grpid; int *__pyx_v_grpids; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_groups = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_grps", 0); /* "netCDF4/_netCDF4.pyx":1373 * cdef char namstring[NC_MAX_NAME+1] * # get number of groups in this Group. * _grpid = group._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_grps(_grpid, &numgrps, NULL) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1374 * # get number of groups in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grps(_grpid, &numgrps, NULL) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1375 * _grpid = group._grpid * with nogil: * ierr = nc_inq_grps(_grpid, &numgrps, NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_grps(__pyx_v__grpid, (&__pyx_v_numgrps), NULL); } /* "netCDF4/_netCDF4.pyx":1374 * # get number of groups in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grps(_grpid, &numgrps, NULL) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1376 * with nogil: * ierr = nc_inq_grps(_grpid, &numgrps, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create dictionary containing `netCDF4.Group` instances for groups in this group */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1377 * ierr = nc_inq_grps(_grpid, &numgrps, NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # create dictionary containing `netCDF4.Group` instances for groups in this group * groups = OrderedDict() */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1376 * with nogil: * ierr = nc_inq_grps(_grpid, &numgrps, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create dictionary containing `netCDF4.Group` instances for groups in this group */ } /* "netCDF4/_netCDF4.pyx":1379 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create dictionary containing `netCDF4.Group` instances for groups in this group * groups = OrderedDict() # <<<<<<<<<<<<<< * if numgrps > 0: * grpids = malloc(sizeof(int) * numgrps) */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_groups = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1380 * # create dictionary containing `netCDF4.Group` instances for groups in this group * groups = OrderedDict() * if numgrps > 0: # <<<<<<<<<<<<<< * grpids = malloc(sizeof(int) * numgrps) * with nogil: */ __pyx_t_3 = ((__pyx_v_numgrps > 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1381 * groups = OrderedDict() * if numgrps > 0: * grpids = malloc(sizeof(int) * numgrps) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_grps(_grpid, NULL, grpids) */ __pyx_v_grpids = ((int *)malloc(((sizeof(int)) * __pyx_v_numgrps))); /* "netCDF4/_netCDF4.pyx":1382 * if numgrps > 0: * grpids = malloc(sizeof(int) * numgrps) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grps(_grpid, NULL, grpids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1383 * grpids = malloc(sizeof(int) * numgrps) * with nogil: * ierr = nc_inq_grps(_grpid, NULL, grpids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_grps(__pyx_v__grpid, NULL, __pyx_v_grpids); } /* "netCDF4/_netCDF4.pyx":1382 * if numgrps > 0: * grpids = malloc(sizeof(int) * numgrps) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grps(_grpid, NULL, grpids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L10; } __pyx_L10:; } } /* "netCDF4/_netCDF4.pyx":1384 * with nogil: * ierr = nc_inq_grps(_grpid, NULL, grpids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * for n from 0 <= n < numgrps: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1385 * ierr = nc_inq_grps(_grpid, NULL, grpids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * for n from 0 <= n < numgrps: * with nogil: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1384 * with nogil: * ierr = nc_inq_grps(_grpid, NULL, grpids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * for n from 0 <= n < numgrps: */ } /* "netCDF4/_netCDF4.pyx":1386 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * for n from 0 <= n < numgrps: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_grpname(grpids[n], namstring) */ __pyx_t_2 = __pyx_v_numgrps; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1387 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * for n from 0 <= n < numgrps: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grpname(grpids[n], namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1388 * for n from 0 <= n < numgrps: * with nogil: * ierr = nc_inq_grpname(grpids[n], namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_grpname((__pyx_v_grpids[__pyx_v_n]), __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":1387 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * for n from 0 <= n < numgrps: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grpname(grpids[n], namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L18; } __pyx_L18:; } } /* "netCDF4/_netCDF4.pyx":1389 * with nogil: * ierr = nc_inq_grpname(grpids[n], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1390 * ierr = nc_inq_grpname(grpids[n], namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * groups[name] = Group(group, name, id=grpids[n]) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1389 * with nogil: * ierr = nc_inq_grpname(grpids[n], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":1391 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * groups[name] = Group(group, name, id=grpids[n]) * free(grpids) */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1392 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) * groups[name] = Group(group, name, id=grpids[n]) # <<<<<<<<<<<<<< * free(grpids) * return groups */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyInt_From_int((__pyx_v_grpids[__pyx_v_n])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_id, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Group), __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyObject_SetItem(__pyx_v_groups, __pyx_v_name, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "netCDF4/_netCDF4.pyx":1393 * name = namstring.decode(default_encoding,unicode_error) * groups[name] = Group(group, name, id=grpids[n]) * free(grpids) # <<<<<<<<<<<<<< * return groups * */ free(__pyx_v_grpids); /* "netCDF4/_netCDF4.pyx":1380 * # create dictionary containing `netCDF4.Group` instances for groups in this group * groups = OrderedDict() * if numgrps > 0: # <<<<<<<<<<<<<< * grpids = malloc(sizeof(int) * numgrps) * with nogil: */ } /* "netCDF4/_netCDF4.pyx":1394 * groups[name] = Group(group, name, id=grpids[n]) * free(grpids) * return groups # <<<<<<<<<<<<<< * * cdef _get_vars(group): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_groups); __pyx_r = __pyx_v_groups; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1366 * return dimensions * * cdef _get_grps(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Group` instances for all the * # groups in a `netCDF4.Group` or Dataset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._get_grps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_groups); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1396 * return groups * * cdef _get_vars(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Variable` instances for all the * # variables in a `netCDF4.Group` or Dataset */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__get_vars(PyObject *__pyx_v_group) { int __pyx_v_ierr; int __pyx_v_numvars; int __pyx_v_n; int __pyx_v_nn; int __pyx_v_numdims; int __pyx_v_varid; int __pyx_v_classp; int __pyx_v_iendian; int __pyx_v__grpid; int *__pyx_v_varids; int *__pyx_v_dimids; nc_type __pyx_v_xtype; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; char __pyx_v_namstring_cmp[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_variables = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_endianness = NULL; PyObject *__pyx_v_datatype = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_dimensions = NULL; PyObject *__pyx_v_grp = NULL; int __pyx_v_found; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound __pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_vlen __pyx_t_24; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_enum __pyx_t_25; PyObject *(*__pyx_t_26)(PyObject *); PyObject *(*__pyx_t_27)(PyObject *); int __pyx_t_28; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_vars", 0); /* "netCDF4/_netCDF4.pyx":1406 * cdef char namstring_cmp[NC_MAX_NAME+1] * # get number of variables in this Group. * _grpid = group._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_nvars(_grpid, &numvars) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":1407 * # get number of variables in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_nvars(_grpid, &numvars) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1408 * _grpid = group._grpid * with nogil: * ierr = nc_inq_nvars(_grpid, &numvars) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_nvars(__pyx_v__grpid, (&__pyx_v_numvars)); } /* "netCDF4/_netCDF4.pyx":1407 * # get number of variables in this Group. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_nvars(_grpid, &numvars) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":1409 * with nogil: * ierr = nc_inq_nvars(_grpid, &numvars) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for variables. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1410 * ierr = nc_inq_nvars(_grpid, &numvars) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # create empty dictionary for variables. * variables = OrderedDict() */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1409 * with nogil: * ierr = nc_inq_nvars(_grpid, &numvars) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for variables. */ } /* "netCDF4/_netCDF4.pyx":1412 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # create empty dictionary for variables. * variables = OrderedDict() # <<<<<<<<<<<<<< * if numvars > 0: * # get variable ids. */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_variables = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1413 * # create empty dictionary for variables. * variables = OrderedDict() * if numvars > 0: # <<<<<<<<<<<<<< * # get variable ids. * varids = malloc(sizeof(int) * numvars) */ __pyx_t_3 = ((__pyx_v_numvars > 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1415 * if numvars > 0: * # get variable ids. * varids = malloc(sizeof(int) * numvars) # <<<<<<<<<<<<<< * if group.data_model == 'NETCDF4': * with nogil: */ __pyx_v_varids = ((int *)malloc(((sizeof(int)) * __pyx_v_numvars))); /* "netCDF4/_netCDF4.pyx":1416 * # get variable ids. * varids = malloc(sizeof(int) * numvars) * if group.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_varids(_grpid, &numvars, varids) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1417 * varids = malloc(sizeof(int) * numvars) * if group.data_model == 'NETCDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varids(_grpid, &numvars, varids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1418 * if group.data_model == 'NETCDF4': * with nogil: * ierr = nc_inq_varids(_grpid, &numvars, varids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varids(__pyx_v__grpid, (&__pyx_v_numvars), __pyx_v_varids); } /* "netCDF4/_netCDF4.pyx":1417 * varids = malloc(sizeof(int) * numvars) * if group.data_model == 'NETCDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varids(_grpid, &numvars, varids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L11; } __pyx_L11:; } } /* "netCDF4/_netCDF4.pyx":1419 * with nogil: * ierr = nc_inq_varids(_grpid, &numvars, varids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1420 * ierr = nc_inq_varids(_grpid, &numvars, varids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * for n from 0 <= n < numvars: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1419 * with nogil: * ierr = nc_inq_varids(_grpid, &numvars, varids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ } /* "netCDF4/_netCDF4.pyx":1416 * # get variable ids. * varids = malloc(sizeof(int) * numvars) * if group.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_varids(_grpid, &numvars, varids) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":1422 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * for n from 0 <= n < numvars: # <<<<<<<<<<<<<< * varids[n] = n * # loop over variables. */ /*else*/ { __pyx_t_2 = __pyx_v_numvars; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1423 * else: * for n from 0 <= n < numvars: * varids[n] = n # <<<<<<<<<<<<<< * # loop over variables. * for n from 0 <= n < numvars: */ (__pyx_v_varids[__pyx_v_n]) = __pyx_v_n; } } __pyx_L8:; /* "netCDF4/_netCDF4.pyx":1425 * varids[n] = n * # loop over variables. * for n from 0 <= n < numvars: # <<<<<<<<<<<<<< * varid = varids[n] * # get variable name. */ __pyx_t_2 = __pyx_v_numvars; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_2; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":1426 * # loop over variables. * for n from 0 <= n < numvars: * varid = varids[n] # <<<<<<<<<<<<<< * # get variable name. * with nogil: */ __pyx_v_varid = (__pyx_v_varids[__pyx_v_n]); /* "netCDF4/_netCDF4.pyx":1428 * varid = varids[n] * # get variable name. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varname(_grpid, varid, namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1429 * # get variable name. * with nogil: * ierr = nc_inq_varname(_grpid, varid, namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varname(__pyx_v__grpid, __pyx_v_varid, __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":1428 * varid = varids[n] * # get variable name. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varname(_grpid, varid, namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } /* "netCDF4/_netCDF4.pyx":1430 * with nogil: * ierr = nc_inq_varname(_grpid, varid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1431 * ierr = nc_inq_varname(_grpid, varid, namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * if ierr != NC_NOERR: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1430 * with nogil: * ierr = nc_inq_varname(_grpid, varid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":1432 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1433 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get variable type. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1434 * name = namstring.decode(default_encoding,unicode_error) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # get variable type. * with nogil: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1433 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get variable type. */ } /* "netCDF4/_netCDF4.pyx":1436 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get variable type. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vartype(_grpid, varid, &xtype) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1437 * # get variable type. * with nogil: * ierr = nc_inq_vartype(_grpid, varid, &xtype) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_vartype(__pyx_v__grpid, __pyx_v_varid, (&__pyx_v_xtype)); } /* "netCDF4/_netCDF4.pyx":1436 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get variable type. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vartype(_grpid, varid, &xtype) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L28; } __pyx_L28:; } } /* "netCDF4/_netCDF4.pyx":1438 * with nogil: * ierr = nc_inq_vartype(_grpid, varid, &xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get endian-ness of variable. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1439 * ierr = nc_inq_vartype(_grpid, varid, &xtype) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # get endian-ness of variable. * endianness = None */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1438 * with nogil: * ierr = nc_inq_vartype(_grpid, varid, &xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get endian-ness of variable. */ } /* "netCDF4/_netCDF4.pyx":1441 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # get endian-ness of variable. * endianness = None # <<<<<<<<<<<<<< * # assume data returned by HDF4 lib has already been byte-swapped * # (if needed) so that it is in native endian format (issue #391). */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_endianness, Py_None); /* "netCDF4/_netCDF4.pyx":1444 * # assume data returned by HDF4 lib has already been byte-swapped * # (if needed) so that it is in native endian format (issue #391). * if group.disk_format != 'HDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_endian(_grpid, varid, &iendian) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_disk_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_HDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1445 * # (if needed) so that it is in native endian format (issue #391). * if group.disk_format != 'HDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1446 * if group.disk_format != 'HDF4': * with nogil: * ierr = nc_inq_var_endian(_grpid, varid, &iendian) # <<<<<<<<<<<<<< * if ierr == NC_NOERR: * if iendian == NC_ENDIAN_LITTLE: */ __pyx_v_ierr = nc_inq_var_endian(__pyx_v__grpid, __pyx_v_varid, (&__pyx_v_iendian)); } /* "netCDF4/_netCDF4.pyx":1445 * # (if needed) so that it is in native endian format (issue #391). * if group.disk_format != 'HDF4': * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L35; } __pyx_L35:; } } /* "netCDF4/_netCDF4.pyx":1447 * with nogil: * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: # <<<<<<<<<<<<<< * if iendian == NC_ENDIAN_LITTLE: * endianness = '<' */ __pyx_t_3 = ((__pyx_v_ierr == NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":1448 * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: * if iendian == NC_ENDIAN_LITTLE: # <<<<<<<<<<<<<< * endianness = '<' * elif iendian == NC_ENDIAN_BIG: */ switch (__pyx_v_iendian) { case NC_ENDIAN_LITTLE: /* "netCDF4/_netCDF4.pyx":1449 * if ierr == NC_NOERR: * if iendian == NC_ENDIAN_LITTLE: * endianness = '<' # <<<<<<<<<<<<<< * elif iendian == NC_ENDIAN_BIG: * endianness = '>' */ __Pyx_INCREF(__pyx_kp_s__14); __Pyx_DECREF_SET(__pyx_v_endianness, __pyx_kp_s__14); /* "netCDF4/_netCDF4.pyx":1448 * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: * if iendian == NC_ENDIAN_LITTLE: # <<<<<<<<<<<<<< * endianness = '<' * elif iendian == NC_ENDIAN_BIG: */ break; /* "netCDF4/_netCDF4.pyx":1450 * if iendian == NC_ENDIAN_LITTLE: * endianness = '<' * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<< * endianness = '>' * # check to see if it is a supported user-defined type. */ case NC_ENDIAN_BIG: /* "netCDF4/_netCDF4.pyx":1451 * endianness = '<' * elif iendian == NC_ENDIAN_BIG: * endianness = '>' # <<<<<<<<<<<<<< * # check to see if it is a supported user-defined type. * try: */ __Pyx_INCREF(__pyx_kp_s__15); __Pyx_DECREF_SET(__pyx_v_endianness, __pyx_kp_s__15); /* "netCDF4/_netCDF4.pyx":1450 * if iendian == NC_ENDIAN_LITTLE: * endianness = '<' * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<< * endianness = '>' * # check to see if it is a supported user-defined type. */ break; default: break; } /* "netCDF4/_netCDF4.pyx":1447 * with nogil: * ierr = nc_inq_var_endian(_grpid, varid, &iendian) * if ierr == NC_NOERR: # <<<<<<<<<<<<<< * if iendian == NC_ENDIAN_LITTLE: * endianness = '<' */ } /* "netCDF4/_netCDF4.pyx":1444 * # assume data returned by HDF4 lib has already been byte-swapped * # (if needed) so that it is in native endian format (issue #391). * if group.disk_format != 'HDF4': # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_endian(_grpid, varid, &iendian) */ } /* "netCDF4/_netCDF4.pyx":1453 * endianness = '>' * # check to see if it is a supported user-defined type. * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[xtype] * if endianness is not None: */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1454 * # check to see if it is a supported user-defined type. * try: * datatype = _nctonptype[xtype] # <<<<<<<<<<<<<< * if endianness is not None: * datatype = endianness + datatype */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L37_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_xtype, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L37_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1455 * try: * datatype = _nctonptype[xtype] * if endianness is not None: # <<<<<<<<<<<<<< * datatype = endianness + datatype * except KeyError: */ __pyx_t_3 = (__pyx_v_endianness != Py_None); __pyx_t_14 = (__pyx_t_3 != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1456 * datatype = _nctonptype[xtype] * if endianness is not None: * datatype = endianness + datatype # <<<<<<<<<<<<<< * except KeyError: * if xtype == NC_STRING: */ __pyx_t_6 = PyNumber_Add(__pyx_v_endianness, __pyx_v_datatype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L37_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1455 * try: * datatype = _nctonptype[xtype] * if endianness is not None: # <<<<<<<<<<<<<< * datatype = endianness + datatype * except KeyError: */ } /* "netCDF4/_netCDF4.pyx":1453 * endianness = '>' * # check to see if it is a supported user-defined type. * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[xtype] * if endianness is not None: */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L44_try_end; __pyx_L37_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1457 * if endianness is not None: * datatype = endianness + datatype * except KeyError: # <<<<<<<<<<<<<< * if xtype == NC_STRING: * datatype = str */ __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_AddTraceback("netCDF4._netCDF4._get_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_10); /* "netCDF4/_netCDF4.pyx":1458 * datatype = endianness + datatype * except KeyError: * if xtype == NC_STRING: # <<<<<<<<<<<<<< * datatype = str * else: */ __pyx_t_14 = ((__pyx_v_xtype == NC_STRING) != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1459 * except KeyError: * if xtype == NC_STRING: * datatype = str # <<<<<<<<<<<<<< * else: * with nogil: */ __Pyx_INCREF(((PyObject *)(&PyString_Type))); __Pyx_XDECREF_SET(__pyx_v_datatype, ((PyObject *)(&PyString_Type))); /* "netCDF4/_netCDF4.pyx":1458 * datatype = endianness + datatype * except KeyError: * if xtype == NC_STRING: # <<<<<<<<<<<<<< * datatype = str * else: */ goto __pyx_L48; } /* "netCDF4/_netCDF4.pyx":1461 * datatype = str * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, xtype, namstring_cmp, * NULL, NULL, NULL, &classp) */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1462 * else: * with nogil: * ierr = nc_inq_user_type(_grpid, xtype, namstring_cmp, # <<<<<<<<<<<<<< * NULL, NULL, NULL, &classp) * if classp == NC_COMPOUND: # a compound type */ __pyx_v_ierr = nc_inq_user_type(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_namstring_cmp, NULL, NULL, NULL, (&__pyx_v_classp)); } /* "netCDF4/_netCDF4.pyx":1461 * datatype = str * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, xtype, namstring_cmp, * NULL, NULL, NULL, &classp) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L53; } __pyx_L53:; } } /* "netCDF4/_netCDF4.pyx":1464 * ierr = nc_inq_user_type(_grpid, xtype, namstring_cmp, * NULL, NULL, NULL, &classp) * if classp == NC_COMPOUND: # a compound type # <<<<<<<<<<<<<< * # create CompoundType instance describing this compound type. * try: */ switch (__pyx_v_classp) { case NC_COMPOUND: /* "netCDF4/_netCDF4.pyx":1466 * if classp == NC_COMPOUND: # a compound type * # create CompoundType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_compound(group, xtype, endian=endianness) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1467 * # create CompoundType instance describing this compound type. * try: * datatype = _read_compound(group, xtype, endian=endianness) # <<<<<<<<<<<<<< * except KeyError: * msg="WARNING: variable '%s' has unsupported compound datatype, skipping .." % name */ __pyx_t_19.__pyx_n = 1; __pyx_t_19.endian = __pyx_v_endianness; __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__read_compound(__pyx_v_group, __pyx_v_xtype, &__pyx_t_19); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L54_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1466 * if classp == NC_COMPOUND: # a compound type * # create CompoundType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_compound(group, xtype, endian=endianness) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L61_try_end; __pyx_L54_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1468 * try: * datatype = _read_compound(group, xtype, endian=endianness) * except KeyError: # <<<<<<<<<<<<<< * msg="WARNING: variable '%s' has unsupported compound datatype, skipping .." % name * warnings.warn(msg) */ __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_AddTraceback("netCDF4._netCDF4._get_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_8); /* "netCDF4/_netCDF4.pyx":1469 * datatype = _read_compound(group, xtype, endian=endianness) * except KeyError: * msg="WARNING: variable '%s' has unsupported compound datatype, skipping .." % name # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __pyx_t_20 = __Pyx_PyString_Format(__pyx_kp_s_WARNING_variable_s_has_unsupport, __pyx_v_name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20)); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1470 * except KeyError: * msg="WARNING: variable '%s' has unsupported compound datatype, skipping .." % name * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * elif classp == NC_VLEN: # a compound type */ __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s_warn); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_22); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __pyx_t_21 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_22))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_22); if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_22, function); } } if (!__pyx_t_21) { __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_22, __pyx_v_msg); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_20); } else { __pyx_t_23 = PyTuple_New(1+1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_23); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_21); __pyx_t_21 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_23, 0+1, __pyx_v_msg); __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_23, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1471 * msg="WARNING: variable '%s' has unsupported compound datatype, skipping .." % name * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * elif classp == NC_VLEN: # a compound type * # create VLType instance describing this compound type. */ goto __pyx_L63_except_continue; __pyx_L63_except_continue:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L60_try_continue; } goto __pyx_L56_except_error; __pyx_L56_except_error:; /* "netCDF4/_netCDF4.pyx":1466 * if classp == NC_COMPOUND: # a compound type * # create CompoundType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_compound(group, xtype, endian=endianness) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L39_except_error; __pyx_L60_try_continue:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L47_except_continue; __pyx_L61_try_end:; } /* "netCDF4/_netCDF4.pyx":1464 * ierr = nc_inq_user_type(_grpid, xtype, namstring_cmp, * NULL, NULL, NULL, &classp) * if classp == NC_COMPOUND: # a compound type # <<<<<<<<<<<<<< * # create CompoundType instance describing this compound type. * try: */ break; /* "netCDF4/_netCDF4.pyx":1472 * warnings.warn(msg) * continue * elif classp == NC_VLEN: # a compound type # <<<<<<<<<<<<<< * # create VLType instance describing this compound type. * try: */ case NC_VLEN: /* "netCDF4/_netCDF4.pyx":1474 * elif classp == NC_VLEN: # a compound type * # create VLType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_vlen(group, xtype, endian=endianness) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1475 * # create VLType instance describing this compound type. * try: * datatype = _read_vlen(group, xtype, endian=endianness) # <<<<<<<<<<<<<< * except KeyError: * msg="WARNING: variable '%s' has unsupported VLEN datatype, skipping .." % name */ __pyx_t_24.__pyx_n = 1; __pyx_t_24.endian = __pyx_v_endianness; __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__read_vlen(__pyx_v_group, __pyx_v_xtype, &__pyx_t_24); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L64_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1474 * elif classp == NC_VLEN: # a compound type * # create VLType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_vlen(group, xtype, endian=endianness) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L71_try_end; __pyx_L64_error:; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1476 * try: * datatype = _read_vlen(group, xtype, endian=endianness) * except KeyError: # <<<<<<<<<<<<<< * msg="WARNING: variable '%s' has unsupported VLEN datatype, skipping .." % name * warnings.warn(msg) */ __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_AddTraceback("netCDF4._netCDF4._get_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_5, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":1477 * datatype = _read_vlen(group, xtype, endian=endianness) * except KeyError: * msg="WARNING: variable '%s' has unsupported VLEN datatype, skipping .." % name # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __pyx_t_20 = __Pyx_PyString_Format(__pyx_kp_s_WARNING_variable_s_has_unsupport_2, __pyx_v_name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20)); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1478 * except KeyError: * msg="WARNING: variable '%s' has unsupported VLEN datatype, skipping .." % name * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * elif classp == NC_ENUM: */ __pyx_t_22 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_22); __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_warn); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; __pyx_t_22 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_23))) { __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_23); if (likely(__pyx_t_22)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23); __Pyx_INCREF(__pyx_t_22); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_23, function); } } if (!__pyx_t_22) { __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_v_msg); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_20); } else { __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_21); __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22); __pyx_t_22 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_v_msg); __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_21, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L66_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1479 * msg="WARNING: variable '%s' has unsupported VLEN datatype, skipping .." % name * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * elif classp == NC_ENUM: * # create EnumType instance describing this compound type. */ goto __pyx_L73_except_continue; __pyx_L73_except_continue:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L70_try_continue; } goto __pyx_L66_except_error; __pyx_L66_except_error:; /* "netCDF4/_netCDF4.pyx":1474 * elif classp == NC_VLEN: # a compound type * # create VLType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_vlen(group, xtype, endian=endianness) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); goto __pyx_L39_except_error; __pyx_L70_try_continue:; __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16); goto __pyx_L47_except_continue; __pyx_L71_try_end:; } /* "netCDF4/_netCDF4.pyx":1472 * warnings.warn(msg) * continue * elif classp == NC_VLEN: # a compound type # <<<<<<<<<<<<<< * # create VLType instance describing this compound type. * try: */ break; /* "netCDF4/_netCDF4.pyx":1480 * warnings.warn(msg) * continue * elif classp == NC_ENUM: # <<<<<<<<<<<<<< * # create EnumType instance describing this compound type. * try: */ case NC_ENUM: /* "netCDF4/_netCDF4.pyx":1482 * elif classp == NC_ENUM: * # create EnumType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_enum(group, xtype, endian=endianness) * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); /*try:*/ { /* "netCDF4/_netCDF4.pyx":1483 * # create EnumType instance describing this compound type. * try: * datatype = _read_enum(group, xtype, endian=endianness) # <<<<<<<<<<<<<< * except KeyError: * msg="WARNING: variable '%s' has unsupported Enum datatype, skipping .." % name */ __pyx_t_25.__pyx_n = 1; __pyx_t_25.endian = __pyx_v_endianness; __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__read_enum(__pyx_v_group, __pyx_v_xtype, &__pyx_t_25); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L74_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_datatype, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1482 * elif classp == NC_ENUM: * # create EnumType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_enum(group, xtype, endian=endianness) * except KeyError: */ } __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; goto __pyx_L81_try_end; __pyx_L74_error:; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":1484 * try: * datatype = _read_enum(group, xtype, endian=endianness) * except KeyError: # <<<<<<<<<<<<<< * msg="WARNING: variable '%s' has unsupported Enum datatype, skipping .." % name * warnings.warn(msg) */ __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_15) { __Pyx_AddTraceback("netCDF4._netCDF4._get_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_8); /* "netCDF4/_netCDF4.pyx":1485 * datatype = _read_enum(group, xtype, endian=endianness) * except KeyError: * msg="WARNING: variable '%s' has unsupported Enum datatype, skipping .." % name # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __pyx_t_20 = __Pyx_PyString_Format(__pyx_kp_s_WARNING_variable_s_has_unsupport_3, __pyx_v_name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_20)); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1486 * except KeyError: * msg="WARNING: variable '%s' has unsupported Enum datatype, skipping .." % name * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * else: */ __pyx_t_23 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_23); __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_warn); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __pyx_t_23 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_21))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_21); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_21, function); } } if (!__pyx_t_23) { __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_v_msg); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_20); } else { __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_22); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23); __pyx_t_23 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_22, 0+1, __pyx_v_msg); __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_22, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L76_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; } __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; /* "netCDF4/_netCDF4.pyx":1487 * msg="WARNING: variable '%s' has unsupported Enum datatype, skipping .." % name * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * else: * msg="WARNING: variable '%s' has unsupported datatype, skipping .." % name */ goto __pyx_L83_except_continue; __pyx_L83_except_continue:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L80_try_continue; } goto __pyx_L76_except_error; __pyx_L76_except_error:; /* "netCDF4/_netCDF4.pyx":1482 * elif classp == NC_ENUM: * # create EnumType instance describing this compound type. * try: # <<<<<<<<<<<<<< * datatype = _read_enum(group, xtype, endian=endianness) * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L39_except_error; __pyx_L80_try_continue:; __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); goto __pyx_L47_except_continue; __pyx_L81_try_end:; } /* "netCDF4/_netCDF4.pyx":1480 * warnings.warn(msg) * continue * elif classp == NC_ENUM: # <<<<<<<<<<<<<< * # create EnumType instance describing this compound type. * try: */ break; default: /* "netCDF4/_netCDF4.pyx":1489 * continue * else: * msg="WARNING: variable '%s' has unsupported datatype, skipping .." % name # <<<<<<<<<<<<<< * warnings.warn(msg) * continue */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_WARNING_variable_s_has_unsupport_4, __pyx_v_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1490 * else: * msg="WARNING: variable '%s' has unsupported datatype, skipping .." % name * warnings.warn(msg) # <<<<<<<<<<<<<< * continue * # get number of dimensions. */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_5) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_msg); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_msg); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_20, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L39_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1491 * msg="WARNING: variable '%s' has unsupported datatype, skipping .." % name * warnings.warn(msg) * continue # <<<<<<<<<<<<<< * # get number of dimensions. * with nogil: */ goto __pyx_L47_except_continue; break; } } __pyx_L48:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L38_exception_handled; __pyx_L47_except_continue:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L43_try_continue; } goto __pyx_L39_except_error; __pyx_L39_except_error:; /* "netCDF4/_netCDF4.pyx":1453 * endianness = '>' * # check to see if it is a supported user-defined type. * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[xtype] * if endianness is not None: */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L43_try_continue:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L15_continue; __pyx_L38_exception_handled:; __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L44_try_end:; } /* "netCDF4/_netCDF4.pyx":1493 * continue * # get number of dimensions. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(_grpid, varid, &numdims) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1494 * # get number of dimensions. * with nogil: * ierr = nc_inq_varndims(_grpid, varid, &numdims) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varndims(__pyx_v__grpid, __pyx_v_varid, (&__pyx_v_numdims)); } /* "netCDF4/_netCDF4.pyx":1493 * continue * # get number of dimensions. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(_grpid, varid, &numdims) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L88; } __pyx_L88:; } } /* "netCDF4/_netCDF4.pyx":1495 * with nogil: * ierr = nc_inq_varndims(_grpid, varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) */ __pyx_t_14 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1496 * ierr = nc_inq_varndims(_grpid, varid, &numdims) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_10 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1495 * with nogil: * ierr = nc_inq_varndims(_grpid, varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) */ } /* "netCDF4/_netCDF4.pyx":1497 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<< * # get dimension ids. * with nogil: */ __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims))); /* "netCDF4/_netCDF4.pyx":1499 * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vardimid(_grpid, varid, dimids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":1500 * # get dimension ids. * with nogil: * ierr = nc_inq_vardimid(_grpid, varid, dimids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_vardimid(__pyx_v__grpid, __pyx_v_varid, __pyx_v_dimids); } /* "netCDF4/_netCDF4.pyx":1499 * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vardimid(_grpid, varid, dimids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L94; } __pyx_L94:; } } /* "netCDF4/_netCDF4.pyx":1501 * with nogil: * ierr = nc_inq_vardimid(_grpid, varid, dimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over dimensions, retrieve names. */ __pyx_t_14 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1502 * ierr = nc_inq_vardimid(_grpid, varid, dimids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # loop over dimensions, retrieve names. * # if not found in current group, look in parents. */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_10 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1501 * with nogil: * ierr = nc_inq_vardimid(_grpid, varid, dimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over dimensions, retrieve names. */ } /* "netCDF4/_netCDF4.pyx":1508 * # and so does it's parent - can a variable in grp1 * # use the 'foo' dimension from the parent? * dimensions = [] # <<<<<<<<<<<<<< * for nn from 0 <= nn < numdims: * grp = group */ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_dimensions, ((PyObject*)__pyx_t_10)); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":1509 * # use the 'foo' dimension from the parent? * dimensions = [] * for nn from 0 <= nn < numdims: # <<<<<<<<<<<<<< * grp = group * found = False */ __pyx_t_15 = __pyx_v_numdims; for (__pyx_v_nn = 0; __pyx_v_nn < __pyx_t_15; __pyx_v_nn++) { /* "netCDF4/_netCDF4.pyx":1510 * dimensions = [] * for nn from 0 <= nn < numdims: * grp = group # <<<<<<<<<<<<<< * found = False * while not found: */ __Pyx_INCREF(__pyx_v_group); __Pyx_XDECREF_SET(__pyx_v_grp, __pyx_v_group); /* "netCDF4/_netCDF4.pyx":1511 * for nn from 0 <= nn < numdims: * grp = group * found = False # <<<<<<<<<<<<<< * while not found: * for key, value in grp.dimensions.items(): */ __pyx_v_found = 0; /* "netCDF4/_netCDF4.pyx":1512 * grp = group * found = False * while not found: # <<<<<<<<<<<<<< * for key, value in grp.dimensions.items(): * if value._dimid == dimids[nn]: */ while (1) { __pyx_t_14 = ((!(__pyx_v_found != 0)) != 0); if (!__pyx_t_14) break; /* "netCDF4/_netCDF4.pyx":1513 * found = False * while not found: * for key, value in grp.dimensions.items(): # <<<<<<<<<<<<<< * if value._dimid == dimids[nn]: * dimensions.append(key) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_1) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { __pyx_t_6 = __pyx_t_10; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; __pyx_t_26 = NULL; } else { __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_26 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { if (likely(!__pyx_t_26)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); #endif } } else { __pyx_t_10 = __pyx_t_26(__pyx_t_6); if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_10); } if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { PyObject* sequence = __pyx_t_10; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_27 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_27(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L102_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_8 = __pyx_t_27(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L102_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_27(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_27 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L103_unpacking_done; __pyx_L102_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_27 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L103_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1514 * while not found: * for key, value in grp.dimensions.items(): * if value._dimid == dimids[nn]: # <<<<<<<<<<<<<< * dimensions.append(key) * found = True */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_dimid); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __Pyx_PyInt_From_int((__pyx_v_dimids[__pyx_v_nn])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1515 * for key, value in grp.dimensions.items(): * if value._dimid == dimids[nn]: * dimensions.append(key) # <<<<<<<<<<<<<< * found = True * break */ __pyx_t_28 = __Pyx_PyList_Append(__pyx_v_dimensions, __pyx_v_key); if (unlikely(__pyx_t_28 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1516 * if value._dimid == dimids[nn]: * dimensions.append(key) * found = True # <<<<<<<<<<<<<< * break * grp = grp.parent */ __pyx_v_found = 1; /* "netCDF4/_netCDF4.pyx":1517 * dimensions.append(key) * found = True * break # <<<<<<<<<<<<<< * grp = grp.parent * free(dimids) */ goto __pyx_L101_break; /* "netCDF4/_netCDF4.pyx":1514 * while not found: * for key, value in grp.dimensions.items(): * if value._dimid == dimids[nn]: # <<<<<<<<<<<<<< * dimensions.append(key) * found = True */ } /* "netCDF4/_netCDF4.pyx":1513 * found = False * while not found: * for key, value in grp.dimensions.items(): # <<<<<<<<<<<<<< * if value._dimid == dimids[nn]: * dimensions.append(key) */ } __pyx_L101_break:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1518 * found = True * break * grp = grp.parent # <<<<<<<<<<<<<< * free(dimids) * # create new variable instance. */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_parent); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_grp, __pyx_t_6); __pyx_t_6 = 0; } } /* "netCDF4/_netCDF4.pyx":1519 * break * grp = grp.parent * free(dimids) # <<<<<<<<<<<<<< * # create new variable instance. * if endianness == '>': */ free(__pyx_v_dimids); /* "netCDF4/_netCDF4.pyx":1521 * free(dimids) * # create new variable instance. * if endianness == '>': # <<<<<<<<<<<<<< * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') * elif endianness == '<': */ __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_endianness, __pyx_kp_s__15, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1522 * # create new variable instance. * if endianness == '>': * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') # <<<<<<<<<<<<<< * elif endianness == '<': * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='little') */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_name); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_dimensions); __Pyx_GIVEREF(__pyx_v_dimensions); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_dimensions); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_endian, __pyx_n_s_big) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Variable), __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_variables, __pyx_v_name, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1521 * free(dimids) * # create new variable instance. * if endianness == '>': # <<<<<<<<<<<<<< * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') * elif endianness == '<': */ goto __pyx_L105; } /* "netCDF4/_netCDF4.pyx":1523 * if endianness == '>': * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') * elif endianness == '<': # <<<<<<<<<<<<<< * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='little') * else: */ __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_endianness, __pyx_kp_s__14, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":1524 * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') * elif endianness == '<': * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='little') # <<<<<<<<<<<<<< * else: * variables[name] = Variable(group, name, datatype, dimensions, id=varid) */ __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_name); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_dimensions); __Pyx_GIVEREF(__pyx_v_dimensions); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_dimensions); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_endian, __pyx_n_s_little) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Variable), __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_variables, __pyx_v_name, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1523 * if endianness == '>': * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='big') * elif endianness == '<': # <<<<<<<<<<<<<< * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='little') * else: */ goto __pyx_L105; } /* "netCDF4/_netCDF4.pyx":1526 * variables[name] = Variable(group, name, datatype, dimensions, id=varid, endian='little') * else: * variables[name] = Variable(group, name, datatype, dimensions, id=varid) # <<<<<<<<<<<<<< * free(varids) # free pointer holding variable ids. * return variables */ /*else*/ { __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_name); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_dimensions); __Pyx_GIVEREF(__pyx_v_dimensions); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_dimensions); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_varid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Variable), __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_variables, __pyx_v_name, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L105:; __pyx_L15_continue:; } /* "netCDF4/_netCDF4.pyx":1527 * else: * variables[name] = Variable(group, name, datatype, dimensions, id=varid) * free(varids) # free pointer holding variable ids. # <<<<<<<<<<<<<< * return variables * */ free(__pyx_v_varids); /* "netCDF4/_netCDF4.pyx":1413 * # create empty dictionary for variables. * variables = OrderedDict() * if numvars > 0: # <<<<<<<<<<<<<< * # get variable ids. * varids = malloc(sizeof(int) * numvars) */ } /* "netCDF4/_netCDF4.pyx":1528 * variables[name] = Variable(group, name, datatype, dimensions, id=varid) * free(varids) # free pointer holding variable ids. * return variables # <<<<<<<<<<<<<< * * # these are class attributes that */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_variables); __pyx_r = __pyx_v_variables; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1396 * return groups * * cdef _get_vars(group): # <<<<<<<<<<<<<< * # Private function to create `netCDF4.Variable` instances for all the * # variables in a `netCDF4.Group` or Dataset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); __Pyx_XDECREF(__pyx_t_23); __Pyx_AddTraceback("netCDF4._netCDF4._get_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_variables); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_endianness); __Pyx_XDECREF(__pyx_v_datatype); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_dimensions); __Pyx_XDECREF(__pyx_v_grp); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1662 * the parent Dataset or Group.""" * * def __init__(self, filename, mode='r', clobber=True, format='NETCDF4', # <<<<<<<<<<<<<< * diskless=False, persist=False, keepweakref=False, **kwargs): * """ */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset___init__[] = "\n **`__init__(self, filename, mode=\"r\", clobber=True, diskless=False,\n persist=False, weakref=False, format='NETCDF4')`**\n\n `netCDF4.Dataset` constructor.\n\n **`filename`**: Name of netCDF file to hold dataset. Can also\n\tbe a python 3 pathlib instance or the URL of an OpenDAP dataset.\n \n **`mode`**: access mode. `r` means read-only; no data can be\n modified. `w` means write; a new file is created, an existing file with\n the same name is deleted. `a` and `r+` mean append (in analogy with\n serial files); an existing file is opened for reading and writing.\n Appending `s` to modes `w`, `r+` or `a` will enable unbuffered shared\n access to `NETCDF3_CLASSIC`, `NETCDF3_64BIT_OFFSET` or\n `NETCDF3_64BIT_DATA` formatted files.\n Unbuffered acesss may be useful even if you don't need shared\n access, since it may be faster for programs that don't access data\n sequentially. This option is ignored for `NETCDF4` and `NETCDF4_CLASSIC`\n formatted files.\n \n **`clobber`**: if `True` (default), opening a file with `mode='w'`\n will clobber an existing file with the same name. if `False`, an\n exception will be raised if a file with the same name already exists.\n \n **`format`**: underlying file format (one of `'NETCDF4',\n 'NETCDF4_CLASSIC', 'NETCDF3_CLASSIC'`, `'NETCDF3_64BIT_OFFSET'` or\n `'NETCDF3_64BIT_DATA'`.\n Only relevant if `mode = 'w'` (if `mode = 'r','a'` or `'r+'` the file format\n is automatically detected). Default `'NETCDF4'`, which means the data is\n stored in an HDF5 file, using netCDF 4 API features. Setting\n `format='NETCDF4_CLASSIC'` will create an HDF5 file, using only netCDF 3\n compatibile API features. netCDF 3 clients must be recompiled and linked\n against the netCDF 4 library to read files in `NETCDF4_CLASSIC` format.\n ""`'NETCDF3_CLASSIC'` is the classic netCDF 3 file format that does not\n handle 2+ Gb files. `'NETCDF3_64BIT_OFFSET'` is the 64-bit offset\n version of the netCDF 3 file format, which fully supports 2+ GB files, but\n is only compatible with clients linked against netCDF version 3.6.0 or\n later. `'NETCDF3_64BIT_DATA'` is the 64-bit data version of the netCDF 3\n file format, which supports 64-bit dimension sizes plus unsigned and\n 64 bit integer data types, but is only compatible with clients linked against\n netCDF version 4.4.0 or later.\n \n **`diskless`**: If `True`, create diskless (in memory) file. \n This is an experimental feature added to the C library after the\n netcdf-4.2 release.\n \n **`persist`**: if `diskless=True`, persist file to disk when closed\n (default `False`).\n\n **`keepweakref`**: if `True`, child Dimension and Variable instances will keep weak\n references to the parent Dataset or Group object. Default is `False`, which\n means strong references will be kept. Having Dimension and Variable instances\n keep a strong reference to the parent Dataset instance, which in turn keeps a\n reference to child Dimension and Variable instances, creates circular references.\n Circular references complicate garbage collection, which may mean increased\n memory usage for programs that create may Dataset instances with lots of\n Variables. Setting `keepweakref=True` allows Dataset instances to be\n garbage collected as soon as they go out of scope, potential reducing memory\n usage. However, in most cases this is not desirable, since the associated\n Variable instances may still be needed, but are rendered unusable when the\n parent Dataset instance is garbage collected.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_7Dataset___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_clobber = 0; PyObject *__pyx_v_format = 0; PyObject *__pyx_v_diskless = 0; PyObject *__pyx_v_persist = 0; PyObject *__pyx_v_keepweakref = 0; CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_clobber,&__pyx_n_s_format,&__pyx_n_s_diskless,&__pyx_n_s_persist,&__pyx_n_s_keepweakref,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[1] = ((PyObject *)__pyx_n_s_r); values[2] = ((PyObject *)Py_True); values[3] = ((PyObject *)__pyx_n_s_NETCDF4); /* "netCDF4/_netCDF4.pyx":1663 * * def __init__(self, filename, mode='r', clobber=True, format='NETCDF4', * diskless=False, persist=False, keepweakref=False, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, filename, mode="r", clobber=True, diskless=False, */ values[4] = ((PyObject *)Py_False); values[5] = ((PyObject *)Py_False); values[6] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clobber); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_diskless); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_persist); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_keepweakref); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_mode = values[1]; __pyx_v_clobber = values[2]; __pyx_v_format = values[3]; __pyx_v_diskless = values[4]; __pyx_v_persist = values[5]; __pyx_v_keepweakref = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_clobber, __pyx_v_format, __pyx_v_diskless, __pyx_v_persist, __pyx_v_keepweakref, __pyx_v_kwargs); /* "netCDF4/_netCDF4.pyx":1662 * the parent Dataset or Group.""" * * def __init__(self, filename, mode='r', clobber=True, format='NETCDF4', # <<<<<<<<<<<<<< * diskless=False, persist=False, keepweakref=False, **kwargs): * """ */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_clobber, PyObject *__pyx_v_format, PyObject *__pyx_v_diskless, PyObject *__pyx_v_persist, PyObject *__pyx_v_keepweakref, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { int __pyx_v_grpid; int __pyx_v_ierr; char *__pyx_v_path; PyObject *__pyx_v_bytestr = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; char *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "netCDF4/_netCDF4.pyx":1731 * cdef char namstring[NC_MAX_NAME+1] * # flag to indicate that Variables in this Dataset support orthogonal indexing. * self.__orthogonal_indexing__ = True # <<<<<<<<<<<<<< * if diskless and __netcdf4libversion__ < '4.2.1': * #diskless = False # don't raise error, instead silently ignore */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = Py_True; /* "netCDF4/_netCDF4.pyx":1732 * # flag to indicate that Variables in this Dataset support orthogonal indexing. * self.__orthogonal_indexing__ = True * if diskless and __netcdf4libversion__ < '4.2.1': # <<<<<<<<<<<<<< * #diskless = False # don't raise error, instead silently ignore * raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_kp_s_4_2_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1734 * if diskless and __netcdf4libversion__ < '4.2.1': * #diskless = False # don't raise error, instead silently ignore * raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__) # <<<<<<<<<<<<<< * bytestr = _strencode(str(filename)) * path = bytestr */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdf4libversion); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_diskless_mode_requires_netcdf_li, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1732 * # flag to indicate that Variables in this Dataset support orthogonal indexing. * self.__orthogonal_indexing__ = True * if diskless and __netcdf4libversion__ < '4.2.1': # <<<<<<<<<<<<<< * #diskless = False # don't raise error, instead silently ignore * raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__) */ } /* "netCDF4/_netCDF4.pyx":1735 * #diskless = False # don't raise error, instead silently ignore * raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__) * bytestr = _strencode(str(filename)) # <<<<<<<<<<<<<< * path = bytestr * if mode == 'w': */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_filename); __Pyx_GIVEREF(__pyx_v_filename); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_bytestr = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1736 * raise ValueError('diskless mode requires netcdf lib >= 4.2.1, you have %s' % __netcdf4libversion__) * bytestr = _strencode(str(filename)) * path = bytestr # <<<<<<<<<<<<<< * if mode == 'w': * _set_default_format(format=format) */ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_path = __pyx_t_5; /* "netCDF4/_netCDF4.pyx":1737 * bytestr = _strencode(str(filename)) * path = bytestr * if mode == 'w': # <<<<<<<<<<<<<< * _set_default_format(format=format) * if clobber: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1738 * path = bytestr * if mode == 'w': * _set_default_format(format=format) # <<<<<<<<<<<<<< * if clobber: * if diskless: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_default_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_format, __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1739 * if mode == 'w': * _set_default_format(format=format) * if clobber: # <<<<<<<<<<<<<< * if diskless: * if persist: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_clobber); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1740 * _set_default_format(format=format) * if clobber: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1741 * if clobber: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1742 * if diskless: * if persist: * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_CLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_6 = __Pyx_PyInt_From_int((NC_WRITE | NC_CLOBBER)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1741 * if clobber: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":1744 * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_CLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_CLOBBER, &grpid) */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(NC_CLOBBER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":1740 * _set_default_format(format=format) * if clobber: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_CLOBBER | NC_DISKLESS , &grpid) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":1746 * ierr = nc_create(path, NC_CLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_CLOBBER, &grpid) # <<<<<<<<<<<<<< * else: * if diskless: */ /*else*/ { __pyx_v_ierr = nc_create(__pyx_v_path, NC_CLOBBER, (&__pyx_v_grpid)); } __pyx_L8:; /* "netCDF4/_netCDF4.pyx":1739 * if mode == 'w': * _set_default_format(format=format) * if clobber: # <<<<<<<<<<<<<< * if diskless: * if persist: */ goto __pyx_L7; } /* "netCDF4/_netCDF4.pyx":1748 * ierr = nc_create(path, NC_CLOBBER, &grpid) * else: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1749 * else: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1750 * if diskless: * if persist: * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_NOCLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_6 = __Pyx_PyInt_From_int((NC_WRITE | NC_NOCLOBBER)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1749 * else: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: */ goto __pyx_L11; } /* "netCDF4/_netCDF4.pyx":1752 * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_NOCLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_NOCLOBBER, &grpid) */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int(NC_NOCLOBBER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); } __pyx_L11:; /* "netCDF4/_netCDF4.pyx":1748 * ierr = nc_create(path, NC_CLOBBER, &grpid) * else: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_NOCLOBBER | NC_DISKLESS , &grpid) */ goto __pyx_L10; } /* "netCDF4/_netCDF4.pyx":1754 * ierr = nc_create(path, NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_NOCLOBBER, &grpid) # <<<<<<<<<<<<<< * # reset default format to netcdf3 - this is a workaround * # for issue 170 (nc_open'ing a DAP dataset after switching */ /*else*/ { __pyx_v_ierr = nc_create(__pyx_v_path, NC_NOCLOBBER, (&__pyx_v_grpid)); } __pyx_L10:; } __pyx_L7:; /* "netCDF4/_netCDF4.pyx":1759 * # format to NETCDF4). This bug should be fixed in version * # 4.3.0 of the netcdf library (add a version check here?). * _set_default_format(format='NETCDF3_64BIT_OFFSET') # <<<<<<<<<<<<<< * elif mode == 'r': * if diskless: */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_set_default_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_format, __pyx_n_s_NETCDF3_64BIT_OFFSET) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1737 * bytestr = _strencode(str(filename)) * path = bytestr * if mode == 'w': # <<<<<<<<<<<<<< * _set_default_format(format=format) * if clobber: */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":1760 * # 4.3.0 of the netcdf library (add a version check here?). * _set_default_format(format='NETCDF3_64BIT_OFFSET') * elif mode == 'r': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1761 * _set_default_format(format='NETCDF3_64BIT_OFFSET') * elif mode == 'r': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1762 * elif mode == 'r': * if diskless: * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_open(path, NC_NOWRITE, &grpid) */ __pyx_t_3 = __Pyx_PyInt_From_int(NC_NOWRITE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_open(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1761 * _set_default_format(format='NETCDF3_64BIT_OFFSET') * elif mode == 'r': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) * else: */ goto __pyx_L12; } /* "netCDF4/_netCDF4.pyx":1764 * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) * else: * ierr = nc_open(path, NC_NOWRITE, &grpid) # <<<<<<<<<<<<<< * elif mode == 'r+' or mode == 'a': * if diskless: */ /*else*/ { __pyx_v_ierr = nc_open(__pyx_v_path, NC_NOWRITE, (&__pyx_v_grpid)); } __pyx_L12:; /* "netCDF4/_netCDF4.pyx":1760 * # 4.3.0 of the netcdf library (add a version check here?). * _set_default_format(format='NETCDF3_64BIT_OFFSET') * elif mode == 'r': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_NOWRITE | NC_DISKLESS, &grpid) */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":1765 * else: * ierr = nc_open(path, NC_NOWRITE, &grpid) * elif mode == 'r+' or mode == 'a': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_r_2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L13_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_a, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_t_2; __pyx_L13_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1766 * ierr = nc_open(path, NC_NOWRITE, &grpid) * elif mode == 'r+' or mode == 'a': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1767 * elif mode == 'r+' or mode == 'a': * if diskless: * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_open(path, NC_WRITE, &grpid) */ __pyx_t_6 = __Pyx_PyInt_From_int(NC_WRITE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ierr = nc_open(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1766 * ierr = nc_open(path, NC_NOWRITE, &grpid) * elif mode == 'r+' or mode == 'a': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) * else: */ goto __pyx_L15; } /* "netCDF4/_netCDF4.pyx":1769 * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) * else: * ierr = nc_open(path, NC_WRITE, &grpid) # <<<<<<<<<<<<<< * elif mode == 'as' or mode == 'r+s': * if diskless: */ /*else*/ { __pyx_v_ierr = nc_open(__pyx_v_path, NC_WRITE, (&__pyx_v_grpid)); } __pyx_L15:; /* "netCDF4/_netCDF4.pyx":1765 * else: * ierr = nc_open(path, NC_NOWRITE, &grpid) * elif mode == 'r+' or mode == 'a': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_WRITE | NC_DISKLESS, &grpid) */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":1770 * else: * ierr = nc_open(path, NC_WRITE, &grpid) * elif mode == 'as' or mode == 'r+s': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_as, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L16_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_r_s, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_t_2; __pyx_L16_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1771 * ierr = nc_open(path, NC_WRITE, &grpid) * elif mode == 'as' or mode == 'r+s': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1772 * elif mode == 'as' or mode == 'r+s': * if diskless: * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_open(path, NC_SHARE, &grpid) */ __pyx_t_3 = __Pyx_PyInt_From_int(NC_SHARE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_open(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1771 * ierr = nc_open(path, NC_WRITE, &grpid) * elif mode == 'as' or mode == 'r+s': * if diskless: # <<<<<<<<<<<<<< * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) * else: */ goto __pyx_L18; } /* "netCDF4/_netCDF4.pyx":1774 * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) * else: * ierr = nc_open(path, NC_SHARE, &grpid) # <<<<<<<<<<<<<< * elif mode == 'ws': * if clobber: */ /*else*/ { __pyx_v_ierr = nc_open(__pyx_v_path, NC_SHARE, (&__pyx_v_grpid)); } __pyx_L18:; /* "netCDF4/_netCDF4.pyx":1770 * else: * ierr = nc_open(path, NC_WRITE, &grpid) * elif mode == 'as' or mode == 'r+s': # <<<<<<<<<<<<<< * if diskless: * ierr = nc_open(path, NC_SHARE | NC_DISKLESS, &grpid) */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":1775 * else: * ierr = nc_open(path, NC_SHARE, &grpid) * elif mode == 'ws': # <<<<<<<<<<<<<< * if clobber: * if diskless: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_ws, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1776 * ierr = nc_open(path, NC_SHARE, &grpid) * elif mode == 'ws': * if clobber: # <<<<<<<<<<<<<< * if diskless: * if persist: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_clobber); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1777 * elif mode == 'ws': * if clobber: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1778 * if clobber: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1779 * if diskless: * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_6 = __Pyx_PyInt_From_int(((NC_WRITE | NC_SHARE) | NC_CLOBBER)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1778 * if clobber: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: */ goto __pyx_L21; } /* "netCDF4/_netCDF4.pyx":1781 * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_SHARE | NC_CLOBBER, &grpid) */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((NC_SHARE | NC_CLOBBER)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); } __pyx_L21:; /* "netCDF4/_netCDF4.pyx":1777 * elif mode == 'ws': * if clobber: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) */ goto __pyx_L20; } /* "netCDF4/_netCDF4.pyx":1783 * ierr = nc_create(path, NC_SHARE | NC_CLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_SHARE | NC_CLOBBER, &grpid) # <<<<<<<<<<<<<< * else: * if diskless: */ /*else*/ { __pyx_v_ierr = nc_create(__pyx_v_path, (NC_SHARE | NC_CLOBBER), (&__pyx_v_grpid)); } __pyx_L20:; /* "netCDF4/_netCDF4.pyx":1776 * ierr = nc_open(path, NC_SHARE, &grpid) * elif mode == 'ws': * if clobber: # <<<<<<<<<<<<<< * if diskless: * if persist: */ goto __pyx_L19; } /* "netCDF4/_netCDF4.pyx":1785 * ierr = nc_create(path, NC_SHARE | NC_CLOBBER, &grpid) * else: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_diskless); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1786 * else: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1787 * if diskless: * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) */ __pyx_t_6 = __Pyx_PyInt_From_int(((NC_WRITE | NC_SHARE) | NC_NOCLOBBER)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Or(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); /* "netCDF4/_netCDF4.pyx":1786 * else: * if diskless: * if persist: # <<<<<<<<<<<<<< * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: */ goto __pyx_L23; } /* "netCDF4/_netCDF4.pyx":1789 * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) # <<<<<<<<<<<<<< * else: * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER, &grpid) */ /*else*/ { __pyx_t_3 = __Pyx_PyInt_From_int((NC_SHARE | NC_NOCLOBBER)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NC_DISKLESS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_ierr = nc_create(__pyx_v_path, __pyx_t_7, (&__pyx_v_grpid)); } __pyx_L23:; /* "netCDF4/_netCDF4.pyx":1785 * ierr = nc_create(path, NC_SHARE | NC_CLOBBER, &grpid) * else: * if diskless: # <<<<<<<<<<<<<< * if persist: * ierr = nc_create(path, NC_WRITE | NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) */ goto __pyx_L22; } /* "netCDF4/_netCDF4.pyx":1791 * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER | NC_DISKLESS , &grpid) * else: * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER, &grpid) # <<<<<<<<<<<<<< * else: * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode) */ /*else*/ { __pyx_v_ierr = nc_create(__pyx_v_path, (NC_SHARE | NC_NOCLOBBER), (&__pyx_v_grpid)); } __pyx_L22:; } __pyx_L19:; /* "netCDF4/_netCDF4.pyx":1775 * else: * ierr = nc_open(path, NC_SHARE, &grpid) * elif mode == 'ws': # <<<<<<<<<<<<<< * if clobber: * if diskless: */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":1793 * ierr = nc_create(path, NC_SHARE | NC_NOCLOBBER, &grpid) * else: * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ /*else*/ { __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_mode_must_be_w_r_a_or_r_got_s, __pyx_v_mode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; /* "netCDF4/_netCDF4.pyx":1794 * else: * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # data model and file format attributes */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1795 * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # data model and file format attributes * self.data_model = _get_format(grpid) */ __pyx_t_5 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1794 * else: * raise ValueError("mode must be 'w', 'r', 'a' or 'r+', got '%s'" % mode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # data model and file format attributes */ } /* "netCDF4/_netCDF4.pyx":1797 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # data model and file format attributes * self.data_model = _get_format(grpid) # <<<<<<<<<<<<<< * # data_model attribute used to be file_format (versions < 1.0.8), retain * # file_format for backwards compatibility. */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_format(__pyx_v_grpid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->data_model); __Pyx_DECREF(__pyx_v_self->data_model); __pyx_v_self->data_model = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1800 * # data_model attribute used to be file_format (versions < 1.0.8), retain * # file_format for backwards compatibility. * self.file_format = self.data_model # <<<<<<<<<<<<<< * self.disk_format = _get_full_format(grpid) * # diskless read access only works with NETCDF_CLASSIC (for now) */ __pyx_t_6 = __pyx_v_self->data_model; __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->file_format); __Pyx_DECREF(__pyx_v_self->file_format); __pyx_v_self->file_format = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1801 * # file_format for backwards compatibility. * self.file_format = self.data_model * self.disk_format = _get_full_format(grpid) # <<<<<<<<<<<<<< * # diskless read access only works with NETCDF_CLASSIC (for now) * #ncopen = mode.startswith('a') or mode.startswith('r') */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_full_format(__pyx_v_grpid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->disk_format); __Pyx_DECREF(__pyx_v_self->disk_format); __pyx_v_self->disk_format = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1806 * #if diskless and self.data_model != 'NETCDF3_CLASSIC' and ncopen: * # raise ValueError("diskless access only supported for NETCDF3_CLASSIC format") * self._grpid = grpid # <<<<<<<<<<<<<< * self._isopen = 1 * self.path = '/' */ __pyx_v_self->_grpid = __pyx_v_grpid; /* "netCDF4/_netCDF4.pyx":1807 * # raise ValueError("diskless access only supported for NETCDF3_CLASSIC format") * self._grpid = grpid * self._isopen = 1 # <<<<<<<<<<<<<< * self.path = '/' * self.parent = None */ __pyx_v_self->_isopen = 1; /* "netCDF4/_netCDF4.pyx":1808 * self._grpid = grpid * self._isopen = 1 * self.path = '/' # <<<<<<<<<<<<<< * self.parent = None * self.keepweakref = keepweakref */ __Pyx_INCREF(__pyx_kp_s__16); __Pyx_GIVEREF(__pyx_kp_s__16); __Pyx_GOTREF(__pyx_v_self->path); __Pyx_DECREF(__pyx_v_self->path); __pyx_v_self->path = __pyx_kp_s__16; /* "netCDF4/_netCDF4.pyx":1809 * self._isopen = 1 * self.path = '/' * self.parent = None # <<<<<<<<<<<<<< * self.keepweakref = keepweakref * # get compound, vlen and enum types in the root Group. */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->parent); __Pyx_DECREF(__pyx_v_self->parent); __pyx_v_self->parent = Py_None; /* "netCDF4/_netCDF4.pyx":1810 * self.path = '/' * self.parent = None * self.keepweakref = keepweakref # <<<<<<<<<<<<<< * # get compound, vlen and enum types in the root Group. * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) */ __Pyx_INCREF(__pyx_v_keepweakref); __Pyx_GIVEREF(__pyx_v_keepweakref); __Pyx_GOTREF(__pyx_v_self->keepweakref); __Pyx_DECREF(__pyx_v_self->keepweakref); __pyx_v_self->keepweakref = __pyx_v_keepweakref; /* "netCDF4/_netCDF4.pyx":1812 * self.keepweakref = keepweakref * # get compound, vlen and enum types in the root Group. * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) # <<<<<<<<<<<<<< * # get dimensions in the root group. * self.dimensions = _get_dims(self) */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_types(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L25_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L26_unpacking_done; __pyx_L25_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L26_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->cmptypes); __Pyx_DECREF(__pyx_v_self->cmptypes); __pyx_v_self->cmptypes = __pyx_t_4; __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->vltypes); __Pyx_DECREF(__pyx_v_self->vltypes); __pyx_v_self->vltypes = __pyx_t_3; __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->enumtypes); __Pyx_DECREF(__pyx_v_self->enumtypes); __pyx_v_self->enumtypes = __pyx_t_8; __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1814 * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) * # get dimensions in the root group. * self.dimensions = _get_dims(self) # <<<<<<<<<<<<<< * # get variables in the root Group. * self.variables = _get_vars(self) */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_dims(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->dimensions); __Pyx_DECREF(__pyx_v_self->dimensions); __pyx_v_self->dimensions = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1816 * self.dimensions = _get_dims(self) * # get variables in the root Group. * self.variables = _get_vars(self) # <<<<<<<<<<<<<< * # get groups in the root Group. * if self.data_model == 'NETCDF4': */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_vars(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->variables); __Pyx_DECREF(__pyx_v_self->variables); __pyx_v_self->variables = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1818 * self.variables = _get_vars(self) * # get groups in the root Group. * if self.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * self.groups = _get_grps(self) * else: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1819 * # get groups in the root Group. * if self.data_model == 'NETCDF4': * self.groups = _get_grps(self) # <<<<<<<<<<<<<< * else: * self.groups = OrderedDict() */ __pyx_t_6 = __pyx_f_7netCDF4_8_netCDF4__get_grps(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->groups); __Pyx_DECREF(__pyx_v_self->groups); __pyx_v_self->groups = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":1818 * self.variables = _get_vars(self) * # get groups in the root Group. * if self.data_model == 'NETCDF4': # <<<<<<<<<<<<<< * self.groups = _get_grps(self) * else: */ goto __pyx_L27; } /* "netCDF4/_netCDF4.pyx":1821 * self.groups = _get_grps(self) * else: * self.groups = OrderedDict() # <<<<<<<<<<<<<< * * # these allow Dataset objects to be used via a "with" statement. */ /*else*/ { __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->groups); __Pyx_DECREF(__pyx_v_self->groups); __pyx_v_self->groups = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L27:; /* "netCDF4/_netCDF4.pyx":1662 * the parent Dataset or Group.""" * * def __init__(self, filename, mode='r', clobber=True, format='NETCDF4', # <<<<<<<<<<<<<< * diskless=False, persist=False, keepweakref=False, **kwargs): * """ */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1824 * * # these allow Dataset objects to be used via a "with" statement. * def __enter__(self): # <<<<<<<<<<<<<< * return self * def __exit__(self,atype,value,traceback): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_2__enter__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_2__enter__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__", 0); /* "netCDF4/_netCDF4.pyx":1825 * # these allow Dataset objects to be used via a "with" statement. * def __enter__(self): * return self # <<<<<<<<<<<<<< * def __exit__(self,atype,value,traceback): * self.close() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1824 * * # these allow Dataset objects to be used via a "with" statement. * def __enter__(self): # <<<<<<<<<<<<<< * return self * def __exit__(self,atype,value,traceback): */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1826 * def __enter__(self): * return self * def __exit__(self,atype,value,traceback): # <<<<<<<<<<<<<< * self.close() * */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_atype = 0; CYTHON_UNUSED PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_traceback = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_atype,&__pyx_n_s_value,&__pyx_n_s_traceback,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_atype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_atype = values[0]; __pyx_v_value = values[1]; __pyx_v_traceback = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4__exit__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_atype, __pyx_v_value, __pyx_v_traceback); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_4__exit__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_atype, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "netCDF4/_netCDF4.pyx":1827 * return self * def __exit__(self,atype,value,traceback): * self.close() # <<<<<<<<<<<<<< * * def __getitem__(self, elem): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1826 * def __enter__(self): * return self * def __exit__(self,atype,value,traceback): # <<<<<<<<<<<<<< * self.close() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1829 * self.close() * * def __getitem__(self, elem): # <<<<<<<<<<<<<< * # return variable or group defined in relative path. * # split out group names in unix path. */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6__getitem__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_elem)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6__getitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_elem) { PyObject *__pyx_v_dirname = NULL; PyObject *__pyx_v_lastname = NULL; PyObject *__pyx_v_nestedgroups = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); __Pyx_INCREF(__pyx_v_elem); /* "netCDF4/_netCDF4.pyx":1832 * # return variable or group defined in relative path. * # split out group names in unix path. * elem = posixpath.normpath(elem) # <<<<<<<<<<<<<< * # last name in path, could be a variable or group * dirname, lastname = posixpath.split(elem) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_elem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_elem); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_elem, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1834 * elem = posixpath.normpath(elem) * # last name in path, could be a variable or group * dirname, lastname = posixpath.split(elem) # <<<<<<<<<<<<<< * nestedgroups = dirname.split('/') * group = self */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_elem); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_elem); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_dirname = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_lastname = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":1835 * # last name in path, could be a variable or group * dirname, lastname = posixpath.split(elem) * nestedgroups = dirname.split('/') # <<<<<<<<<<<<<< * group = self * # iterate over groups in path. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dirname, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nestedgroups = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":1836 * dirname, lastname = posixpath.split(elem) * nestedgroups = dirname.split('/') * group = self # <<<<<<<<<<<<<< * # iterate over groups in path. * for g in nestedgroups: */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_group = ((PyObject *)__pyx_v_self); /* "netCDF4/_netCDF4.pyx":1838 * group = self * # iterate over groups in path. * for g in nestedgroups: # <<<<<<<<<<<<<< * if g: group = group.groups[g] * # return last one, either a group or a variable. */ if (likely(PyList_CheckExact(__pyx_v_nestedgroups)) || PyTuple_CheckExact(__pyx_v_nestedgroups)) { __pyx_t_2 = __pyx_v_nestedgroups; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_nestedgroups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1839 * # iterate over groups in path. * for g in nestedgroups: * if g: group = group.groups[g] # <<<<<<<<<<<<<< * # return last one, either a group or a variable. * if lastname in group.groups: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_g); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_g); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_group, __pyx_t_4); __pyx_t_4 = 0; } /* "netCDF4/_netCDF4.pyx":1838 * group = self * # iterate over groups in path. * for g in nestedgroups: # <<<<<<<<<<<<<< * if g: group = group.groups[g] * # return last one, either a group or a variable. */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":1841 * if g: group = group.groups[g] * # return last one, either a group or a variable. * if lastname in group.groups: # <<<<<<<<<<<<<< * return group.groups[lastname] * elif lastname in group.variables: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_lastname, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":1842 * # return last one, either a group or a variable. * if lastname in group.groups: * return group.groups[lastname] # <<<<<<<<<<<<<< * elif lastname in group.variables: * return group.variables[lastname] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_v_lastname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1841 * if g: group = group.groups[g] * # return last one, either a group or a variable. * if lastname in group.groups: # <<<<<<<<<<<<<< * return group.groups[lastname] * elif lastname in group.variables: */ } /* "netCDF4/_netCDF4.pyx":1843 * if lastname in group.groups: * return group.groups[lastname] * elif lastname in group.variables: # <<<<<<<<<<<<<< * return group.variables[lastname] * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_lastname, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (__pyx_t_9 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":1844 * return group.groups[lastname] * elif lastname in group.variables: * return group.variables[lastname] # <<<<<<<<<<<<<< * else: * raise IndexError('%s not found in %s' % (lastname,group.path)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetItem(__pyx_t_4, __pyx_v_lastname); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1843 * if lastname in group.groups: * return group.groups[lastname] * elif lastname in group.variables: # <<<<<<<<<<<<<< * return group.variables[lastname] * else: */ } /* "netCDF4/_netCDF4.pyx":1846 * return group.variables[lastname] * else: * raise IndexError('%s not found in %s' % (lastname,group.path)) # <<<<<<<<<<<<<< * * def filepath(self): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_lastname); __Pyx_GIVEREF(__pyx_v_lastname); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lastname); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_not_found_in_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":1829 * self.close() * * def __getitem__(self, elem): # <<<<<<<<<<<<<< * # return variable or group defined in relative path. * # split out group names in unix path. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirname); __Pyx_XDECREF(__pyx_v_lastname); __Pyx_XDECREF(__pyx_v_nestedgroups); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1848 * raise IndexError('%s not found in %s' % (lastname,group.path)) * * def filepath(self): # <<<<<<<<<<<<<< * """ * **`filepath(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9filepath(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_8filepath[] = "\n**`filepath(self)`**\n\nGet the file system path (or the opendap URL) which was used to\nopen/create the Dataset. Requires netcdf >= 4.1.2"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9filepath(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filepath (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8filepath(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_8filepath(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filepath", 0); /* "netCDF4/_netCDF4.pyx":1865 * return path.decode('ascii') * ELSE: * msg = """ # <<<<<<<<<<<<<< * filepath method not enabled. To enable, install Cython, make sure you have * version 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python.""" */ __Pyx_INCREF(__pyx_kp_s_filepath_method_not_enabled_To); __pyx_v_msg = __pyx_kp_s_filepath_method_not_enabled_To; /* "netCDF4/_netCDF4.pyx":1868 * filepath method not enabled. To enable, install Cython, make sure you have * version 4.1.2 or higher of the netcdf C lib, and rebuild netcdf4-python.""" * raise ValueError(msg) # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1848 * raise IndexError('%s not found in %s' % (lastname,group.path)) * * def filepath(self): # <<<<<<<<<<<<<< * """ * **`filepath(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.filepath", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1870 * raise ValueError(msg) * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":1871 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":1872 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1871 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":1874 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":1870 * raise ValueError(msg) * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1876 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_13__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_13__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_12__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_12__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_v_ncdump = NULL; PyObject *__pyx_v_dimnames = NULL; PyObject *__pyx_v_varnames = NULL; PyObject *__pyx_v_grpnames = NULL; PyObject *__pyx_v_attrs = NULL; PyObject *__pyx_v_dimname = NULL; PyObject *__pyx_v_varname = NULL; PyObject *__pyx_v_grpname = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":1877 * * def __unicode__(self): * ncdump = ['%r\n' % type(self)] # <<<<<<<<<<<<<< * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ * for dimname in self.dimensions.keys()]) */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_r_3, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_ncdump = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":1878 * def __unicode__(self): * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ # <<<<<<<<<<<<<< * for dimname in self.dimensions.keys()]) * varnames = tuple(\ */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); /* "netCDF4/_netCDF4.pyx":1879 * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ * for dimname in self.dimensions.keys()]) # <<<<<<<<<<<<<< * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dimensions, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":1878 * def __unicode__(self): * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ # <<<<<<<<<<<<<< * for dimname in self.dimensions.keys()]) * varnames = tuple(\ */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dimname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_dimname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetItem(__pyx_v_self->dimensions, __pyx_v_dimname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1879 * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ * for dimname in self.dimensions.keys()]) # <<<<<<<<<<<<<< * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1878 * def __unicode__(self): * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ # <<<<<<<<<<<<<< * for dimname in self.dimensions.keys()]) * varnames = tuple(\ */ __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dimnames = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1881 * for dimname in self.dimensions.keys()]) * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ # <<<<<<<<<<<<<< * (((_tostr(self.variables[varname].dimensions) * .replace("u'",""))\ */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "netCDF4/_netCDF4.pyx":1886 * .replace("'",""))\ * .replace(", ",","))\ * .replace(",)",")") for varname in self.variables.keys()]) # <<<<<<<<<<<<<< * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->variables, __pyx_n_s_keys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_8) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_varname, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":1881 * for dimname in self.dimensions.keys()]) * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ # <<<<<<<<<<<<<< * (((_tostr(self.variables[varname].dimensions) * .replace("u'",""))\ */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = PyObject_GetItem(__pyx_v_self->variables, __pyx_v_varname); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_4m); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_7) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_varname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_varname); __Pyx_GIVEREF(__pyx_v_varname); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_varname); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_10, __pyx_kp_s_0m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":1882 * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ * (((_tostr(self.variables[varname].dimensions) # <<<<<<<<<<<<<< * .replace("u'",""))\ * .replace("'",""))\ */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = PyObject_GetItem(__pyx_v_self->variables, __pyx_v_varname); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dimensions); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_1) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_10); } else { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1883 * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ * (((_tostr(self.variables[varname].dimensions) * .replace("u'",""))\ # <<<<<<<<<<<<<< * .replace("'",""))\ * .replace(", ",","))\ */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1884 * (((_tostr(self.variables[varname].dimensions) * .replace("u'",""))\ * .replace("'",""))\ # <<<<<<<<<<<<<< * .replace(", ",","))\ * .replace(",)",")") for varname in self.variables.keys()]) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1885 * .replace("u'",""))\ * .replace("'",""))\ * .replace(", ",","))\ # <<<<<<<<<<<<<< * .replace(",)",")") for varname in self.variables.keys()]) * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1886 * .replace("'",""))\ * .replace(", ",","))\ * .replace(",)",")") for varname in self.variables.keys()]) # <<<<<<<<<<<<<< * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_replace); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1881 * for dimname in self.dimensions.keys()]) * varnames = tuple(\ * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ # <<<<<<<<<<<<<< * (((_tostr(self.variables[varname].dimensions) * .replace("u'",""))\ */ __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1886 * .replace("'",""))\ * .replace(", ",","))\ * .replace(",)",")") for varname in self.variables.keys()]) # <<<<<<<<<<<<<< * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1880 * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ * for dimname in self.dimensions.keys()]) * varnames = tuple(\ # <<<<<<<<<<<<<< * [_tostr(self.variables[varname].dtype)+' \033[4m'+_tostr(varname)+'\033[0m'+ * (((_tostr(self.variables[varname].dimensions) */ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_varnames = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1887 * .replace(", ",","))\ * .replace(",)",")") for varname in self.variables.keys()]) * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) # <<<<<<<<<<<<<< * if self.path == '/': * ncdump.append('root group (%s data model, file format %s):\n' % */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->groups, __pyx_n_s_keys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_10) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_8); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_grpname, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_grpname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_grpname); __Pyx_GIVEREF(__pyx_v_grpname); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_grpname); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyList_AsTuple(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_grpnames = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1888 * .replace(",)",")") for varname in self.variables.keys()]) * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': # <<<<<<<<<<<<<< * ncdump.append('root group (%s data model, file format %s):\n' % * (self.data_model, self.disk_format)) */ __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_self->path, __pyx_kp_s__16, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":1890 * if self.path == '/': * ncdump.append('root group (%s data model, file format %s):\n' % * (self.data_model, self.disk_format)) # <<<<<<<<<<<<<< * else: * ncdump.append('group %s:\n' % self.path) */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_self->data_model); __Pyx_GIVEREF(__pyx_v_self->data_model); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self->data_model); __Pyx_INCREF(__pyx_v_self->disk_format); __Pyx_GIVEREF(__pyx_v_self->disk_format); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->disk_format); /* "netCDF4/_netCDF4.pyx":1889 * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': * ncdump.append('root group (%s data model, file format %s):\n' % # <<<<<<<<<<<<<< * (self.data_model, self.disk_format)) * else: */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_root_group_s_data_model_file_for, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1888 * .replace(",)",")") for varname in self.variables.keys()]) * grpnames = tuple([_tostr(grpname) for grpname in self.groups.keys()]) * if self.path == '/': # <<<<<<<<<<<<<< * ncdump.append('root group (%s data model, file format %s):\n' % * (self.data_model, self.disk_format)) */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":1892 * (self.data_model, self.disk_format)) * else: * ncdump.append('group %s:\n' % self.path) # <<<<<<<<<<<<<< * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] */ /*else*/ { __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_group_s, __pyx_v_self->path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":1893 * else: * ncdump.append('group %s:\n' % self.path) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ # <<<<<<<<<<<<<< * self.ncattrs()] * ncdump = ncdump + attrs */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); /* "netCDF4/_netCDF4.pyx":1894 * ncdump.append('group %s:\n' % self.path) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] # <<<<<<<<<<<<<< * ncdump = ncdump + attrs * ncdump.append(' dimensions(sizes): %s\n' % ', '.join(dimnames)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_10) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":1893 * else: * ncdump.append('group %s:\n' % self.path) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ # <<<<<<<<<<<<<< * self.ncattrs()] * ncdump = ncdump + attrs */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getncattr); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_11) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_name); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_name); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_attrs = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1895 * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] * ncdump = ncdump + attrs # <<<<<<<<<<<<<< * ncdump.append(' dimensions(sizes): %s\n' % ', '.join(dimnames)) * ncdump.append(' variables(dimensions): %s\n' % ', '.join(varnames)) */ __pyx_t_4 = PyNumber_Add(__pyx_v_ncdump, __pyx_v_attrs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ncdump, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1896 * self.ncattrs()] * ncdump = ncdump + attrs * ncdump.append(' dimensions(sizes): %s\n' % ', '.join(dimnames)) # <<<<<<<<<<<<<< * ncdump.append(' variables(dimensions): %s\n' % ', '.join(varnames)) * ncdump.append(' groups: %s\n' % ', '.join(grpnames)) */ __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_dimnames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_dimensions_sizes_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_3); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1897 * ncdump = ncdump + attrs * ncdump.append(' dimensions(sizes): %s\n' % ', '.join(dimnames)) * ncdump.append(' variables(dimensions): %s\n' % ', '.join(varnames)) # <<<<<<<<<<<<<< * ncdump.append(' groups: %s\n' % ', '.join(grpnames)) * return ''.join(ncdump) */ __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_varnames); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_variables_dimensions_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":1898 * ncdump.append(' dimensions(sizes): %s\n' % ', '.join(dimnames)) * ncdump.append(' variables(dimensions): %s\n' % ', '.join(varnames)) * ncdump.append(' groups: %s\n' % ', '.join(grpnames)) # <<<<<<<<<<<<<< * return ''.join(ncdump) * */ __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_grpnames); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_groups_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_ncdump, __pyx_t_3); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1899 * ncdump.append(' variables(dimensions): %s\n' % ', '.join(varnames)) * ncdump.append(' groups: %s\n' % ', '.join(grpnames)) * return ''.join(ncdump) # <<<<<<<<<<<<<< * * def close(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_ncdump); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1876 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * ncdump = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname)+'(%s)'%len(self.dimensions[dimname])\ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ncdump); __Pyx_XDECREF(__pyx_v_dimnames); __Pyx_XDECREF(__pyx_v_varnames); __Pyx_XDECREF(__pyx_v_grpnames); __Pyx_XDECREF(__pyx_v_attrs); __Pyx_XDECREF(__pyx_v_dimname); __Pyx_XDECREF(__pyx_v_varname); __Pyx_XDECREF(__pyx_v_grpname); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1901 * return ''.join(ncdump) * * def close(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_15close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_14close[] = "\n**`close(self)`**\n\nClose the Dataset.\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_15close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_14close(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_14close(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close", 0); /* "netCDF4/_netCDF4.pyx":1908 * """ * cdef int ierr * ierr = nc_close(self._grpid) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_close(__pyx_v_self->_grpid); /* "netCDF4/_netCDF4.pyx":1909 * cdef int ierr * ierr = nc_close(self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self._isopen = 0 # indicates file already closed, checked by __dealloc__ */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1910 * ierr = nc_close(self._grpid) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * self._isopen = 0 # indicates file already closed, checked by __dealloc__ * */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1909 * cdef int ierr * ierr = nc_close(self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self._isopen = 0 # indicates file already closed, checked by __dealloc__ */ } /* "netCDF4/_netCDF4.pyx":1911 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self._isopen = 0 # indicates file already closed, checked by __dealloc__ # <<<<<<<<<<<<<< * * def isopen(self): */ __pyx_v_self->_isopen = 0; /* "netCDF4/_netCDF4.pyx":1901 * return ''.join(ncdump) * * def close(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1913 * self._isopen = 0 # indicates file already closed, checked by __dealloc__ * * def isopen(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_17isopen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_16isopen[] = "\n**`close(self)`**\n\nis the Dataset open or closed?\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_17isopen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isopen (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_16isopen(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_16isopen(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isopen", 0); /* "netCDF4/_netCDF4.pyx":1919 * is the Dataset open or closed? * """ * return bool(self._isopen) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_isopen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1913 * self._isopen = 0 # indicates file already closed, checked by __dealloc__ * * def isopen(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.isopen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1921 * return bool(self._isopen) * * def __dealloc__(self): # <<<<<<<<<<<<<< * # close file when there are no references to object left * cdef int ierr */ /* Python wrapper */ static void __pyx_pw_7netCDF4_8_netCDF4_7Dataset_19__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7netCDF4_8_netCDF4_7Dataset_19__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7netCDF4_8_netCDF4_7Dataset_18__dealloc__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7netCDF4_8_netCDF4_7Dataset_18__dealloc__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { CYTHON_UNUSED int __pyx_v_ierr; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "netCDF4/_netCDF4.pyx":1924 * # close file when there are no references to object left * cdef int ierr * if self._isopen: # <<<<<<<<<<<<<< * ierr = nc_close(self._grpid) * */ __pyx_t_1 = (__pyx_v_self->_isopen != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1925 * cdef int ierr * if self._isopen: * ierr = nc_close(self._grpid) # <<<<<<<<<<<<<< * * def sync(self): */ __pyx_v_ierr = nc_close(__pyx_v_self->_grpid); /* "netCDF4/_netCDF4.pyx":1924 * # close file when there are no references to object left * cdef int ierr * if self._isopen: # <<<<<<<<<<<<<< * ierr = nc_close(self._grpid) * */ } /* "netCDF4/_netCDF4.pyx":1921 * return bool(self._isopen) * * def __dealloc__(self): # <<<<<<<<<<<<<< * # close file when there are no references to object left * cdef int ierr */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "netCDF4/_netCDF4.pyx":1927 * ierr = nc_close(self._grpid) * * def sync(self): # <<<<<<<<<<<<<< * """ * **`sync(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_21sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_20sync[] = "\n**`sync(self)`**\n\nWrites all buffered data in the `netCDF4.Dataset` to the disk file."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_21sync(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sync (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_20sync(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_20sync(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sync", 0); /* "netCDF4/_netCDF4.pyx":1933 * Writes all buffered data in the `netCDF4.Dataset` to the disk file.""" * cdef int ierr * ierr = nc_sync(self._grpid) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_sync(__pyx_v_self->_grpid); /* "netCDF4/_netCDF4.pyx":1934 * cdef int ierr * ierr = nc_sync(self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1935 * ierr = nc_sync(self._grpid) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def _redef(self): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1934 * cdef int ierr * ierr = nc_sync(self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":1927 * ierr = nc_close(self._grpid) * * def sync(self): # <<<<<<<<<<<<<< * """ * **`sync(self)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.sync", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1937 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def _redef(self): # <<<<<<<<<<<<<< * cdef int ierr * ierr = nc_redef(self._grpid) */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23_redef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23_redef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_redef (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_22_redef(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_22_redef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { CYTHON_UNUSED int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_redef", 0); /* "netCDF4/_netCDF4.pyx":1939 * def _redef(self): * cdef int ierr * ierr = nc_redef(self._grpid) # <<<<<<<<<<<<<< * * def _enddef(self): */ __pyx_v_ierr = nc_redef(__pyx_v_self->_grpid); /* "netCDF4/_netCDF4.pyx":1937 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def _redef(self): # <<<<<<<<<<<<<< * cdef int ierr * ierr = nc_redef(self._grpid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1941 * ierr = nc_redef(self._grpid) * * def _enddef(self): # <<<<<<<<<<<<<< * cdef int ierr * ierr = nc_enddef(self._grpid) */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_25_enddef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_25_enddef(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_enddef (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_24_enddef(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_24_enddef(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { CYTHON_UNUSED int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_enddef", 0); /* "netCDF4/_netCDF4.pyx":1943 * def _enddef(self): * cdef int ierr * ierr = nc_enddef(self._grpid) # <<<<<<<<<<<<<< * * def set_fill_on(self): */ __pyx_v_ierr = nc_enddef(__pyx_v_self->_grpid); /* "netCDF4/_netCDF4.pyx":1941 * ierr = nc_redef(self._grpid) * * def _enddef(self): # <<<<<<<<<<<<<< * cdef int ierr * ierr = nc_enddef(self._grpid) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1945 * ierr = nc_enddef(self._grpid) * * def set_fill_on(self): # <<<<<<<<<<<<<< * """ * **`set_fill_on(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_27set_fill_on(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_26set_fill_on[] = "\n**`set_fill_on(self)`**\n\nSets the fill mode for a `netCDF4.Dataset` open for writing to `on`.\n\nThis causes data to be pre-filled with fill values. The fill values can be\ncontrolled by the variable's `_Fill_Value` attribute, but is usually\nsufficient to the use the netCDF default `_Fill_Value` (defined\nseparately for each variable type). The default behavior of the netCDF\nlibrary correspongs to `set_fill_on`. Data which are equal to the\n`_Fill_Value` indicate that the variable was created, but never written\nto."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_27set_fill_on(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_fill_on (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_26set_fill_on(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_26set_fill_on(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_oldmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_fill_on", 0); /* "netCDF4/_netCDF4.pyx":1959 * to.""" * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_set_fill(__pyx_v_self->_grpid, NC_FILL, (&__pyx_v_oldmode)); /* "netCDF4/_netCDF4.pyx":1960 * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1961 * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def set_fill_off(self): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1960 * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_FILL, &oldmode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":1945 * ierr = nc_enddef(self._grpid) * * def set_fill_on(self): # <<<<<<<<<<<<<< * """ * **`set_fill_on(self)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_fill_on", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1963 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def set_fill_off(self): # <<<<<<<<<<<<<< * """ * **`set_fill_off(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_29set_fill_off(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_28set_fill_off[] = "\n**`set_fill_off(self)`**\n\nSets the fill mode for a `netCDF4.Dataset` open for writing to `off`.\n\nThis will prevent the data from being pre-filled with fill values, which\nmay result in some performance improvements. However, you must then make\nsure the data is actually written before being read."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_29set_fill_off(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_fill_off (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_28set_fill_off(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_28set_fill_off(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_oldmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_fill_off", 0); /* "netCDF4/_netCDF4.pyx":1973 * sure the data is actually written before being read.""" * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_set_fill(__pyx_v_self->_grpid, NC_NOFILL, (&__pyx_v_oldmode)); /* "netCDF4/_netCDF4.pyx":1974 * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":1975 * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def createDimension(self, dimname, size=None): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1974 * cdef int ierr, oldmode * ierr = nc_set_fill (self._grpid, NC_NOFILL, &oldmode) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":1963 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def set_fill_off(self): # <<<<<<<<<<<<<< * """ * **`set_fill_off(self)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_fill_off", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1977 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def createDimension(self, dimname, size=None): # <<<<<<<<<<<<<< * """ * **`createDimension(self, dimname, size=None)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_31createDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_30createDimension[] = "\n**`createDimension(self, dimname, size=None)`**\n\nCreates a new dimension with the given `dimname` and `size`.\n\n`size` must be a positive integer or `None`, which stands for\n\"unlimited\" (default is `None`). Specifying a size of 0 also\nresults in an unlimited dimension. The return value is the `netCDF4.Dimension`\nclass instance describing the new dimension. To determine the current\nmaximum size of the dimension, use the `len` function on the `netCDF4.Dimension`\ninstance. To determine if a dimension is 'unlimited', use the\n`netCDF4.Dimension.isunlimited` method of the `netCDF4.Dimension` instance."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_31createDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dimname = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDimension (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dimname,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDimension") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dimname = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDimension", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_30createDimension(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_dimname, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_30createDimension(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_dimname, PyObject *__pyx_v_size) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDimension", 0); /* "netCDF4/_netCDF4.pyx":1990 * instance. To determine if a dimension is 'unlimited', use the * `netCDF4.Dimension.isunlimited` method of the `netCDF4.Dimension` instance.""" * self.dimensions[dimname] = Dimension(self, dimname, size=size) # <<<<<<<<<<<<<< * return self.dimensions[dimname] * */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_dimname); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_size, __pyx_v_size) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Dimension), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyObject_SetItem(__pyx_v_self->dimensions, __pyx_v_dimname, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":1991 * `netCDF4.Dimension.isunlimited` method of the `netCDF4.Dimension` instance.""" * self.dimensions[dimname] = Dimension(self, dimname, size=size) * return self.dimensions[dimname] # <<<<<<<<<<<<<< * * def renameDimension(self, oldname, newname): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyObject_GetItem(__pyx_v_self->dimensions, __pyx_v_dimname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":1977 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def createDimension(self, dimname, size=None): # <<<<<<<<<<<<<< * """ * **`createDimension(self, dimname, size=None)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1993 * return self.dimensions[dimname] * * def renameDimension(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameDimension(self, oldname, newname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_33renameDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_32renameDimension[] = "\n**`renameDimension(self, oldname, newname)`**\n\nrename a `netCDF4.Dimension` named `oldname` to `newname`."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_33renameDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_oldname = 0; PyObject *__pyx_v_newname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renameDimension (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oldname,&__pyx_n_s_newname,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameDimension") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_oldname = values[0]; __pyx_v_newname = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renameDimension", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_32renameDimension(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_32renameDimension(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) { char *__pyx_v_namstring; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_dim = NULL; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renameDimension", 0); /* "netCDF4/_netCDF4.pyx":1999 * rename a `netCDF4.Dimension` named `oldname` to `newname`.""" * cdef char *namstring * bytestr = _strencode(newname) # <<<<<<<<<<<<<< * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_newname, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2000 * cdef char *namstring * bytestr = _strencode(newname) * namstring = bytestr # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._redef() * try: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2001 * bytestr = _strencode(newname) * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() # <<<<<<<<<<<<<< * try: * dim = self.dimensions[oldname] */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_redef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2002 * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() * try: # <<<<<<<<<<<<<< * dim = self.dimensions[oldname] * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); /*try:*/ { /* "netCDF4/_netCDF4.pyx":2003 * if self.data_model != 'NETCDF4': self._redef() * try: * dim = self.dimensions[oldname] # <<<<<<<<<<<<<< * except KeyError: * raise KeyError('%s not a valid dimension name' % oldname) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_self->dimensions, __pyx_v_oldname); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L4_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_dim = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2002 * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() * try: # <<<<<<<<<<<<<< * dim = self.dimensions[oldname] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2004 * try: * dim = self.dimensions[oldname] * except KeyError: # <<<<<<<<<<<<<< * raise KeyError('%s not a valid dimension name' % oldname) * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) */ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_9) { __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); /* "netCDF4/_netCDF4.pyx":2005 * dim = self.dimensions[oldname] * except KeyError: * raise KeyError('%s not a valid dimension name' % oldname) # <<<<<<<<<<<<<< * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) * if self.data_model != 'NETCDF4': self._enddef() */ __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_s_not_a_valid_dimension_name, __pyx_v_oldname); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "netCDF4/_netCDF4.pyx":2002 * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() * try: # <<<<<<<<<<<<<< * dim = self.dimensions[oldname] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8); goto __pyx_L1_error; __pyx_L11_try_end:; } /* "netCDF4/_netCDF4.pyx":2006 * except KeyError: * raise KeyError('%s not a valid dimension name' % oldname) * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_dimid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ierr = nc_rename_dim(__pyx_v_self->_grpid, __pyx_t_9, __pyx_v_namstring); /* "netCDF4/_netCDF4.pyx":2007 * raise KeyError('%s not a valid dimension name' % oldname) * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enddef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "netCDF4/_netCDF4.pyx":2008 * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2009 * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # remove old key from dimensions dict. * self.dimensions.pop(oldname) */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2008 * ierr = nc_rename_dim(self._grpid, dim._dimid, namstring) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. */ } /* "netCDF4/_netCDF4.pyx":2011 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. * self.dimensions.pop(oldname) # <<<<<<<<<<<<<< * # add new key. * self.dimensions[newname] = dim */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dimensions, __pyx_n_s_pop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_oldname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_oldname); __Pyx_GIVEREF(__pyx_v_oldname); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_oldname); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":2013 * self.dimensions.pop(oldname) * # add new key. * self.dimensions[newname] = dim # <<<<<<<<<<<<<< * # Variable.dimensions is determined by a method that * # looks in the file, so no need to manually update. */ if (unlikely(PyObject_SetItem(__pyx_v_self->dimensions, __pyx_v_newname, __pyx_v_dim) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":1993 * return self.dimensions[dimname] * * def renameDimension(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameDimension(self, oldname, newname)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2017 * # looks in the file, so no need to manually update. * * def createCompoundType(self, datatype, datatype_name): # <<<<<<<<<<<<<< * """ * **`createCompoundType(self, datatype, datatype_name)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_35createCompoundType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_34createCompoundType[] = "\n**`createCompoundType(self, datatype, datatype_name)`**\n\nCreates a new compound data type named `datatype_name` from the numpy\ndtype object `datatype`.\n\n***Note***: If the new compound data type contains other compound data types\n(i.e. it is a 'nested' compound type, where not all of the elements\nare homogeneous numeric data types), then the 'inner' compound types **must** be\ncreated first.\n\nThe return value is the `netCDF4.CompoundType` class instance describing the new\ndatatype."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_35createCompoundType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_datatype = 0; PyObject *__pyx_v_datatype_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCompoundType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_datatype,&__pyx_n_s_datatype_name,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createCompoundType", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCompoundType") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_datatype = values[0]; __pyx_v_datatype_name = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCompoundType", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createCompoundType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_34createCompoundType(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_datatype, __pyx_v_datatype_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_34createCompoundType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCompoundType", 0); /* "netCDF4/_netCDF4.pyx":2031 * The return value is the `netCDF4.CompoundType` class instance describing the new * datatype.""" * self.cmptypes[datatype_name] = CompoundType(self, datatype,\ # <<<<<<<<<<<<<< * datatype_name) * return self.cmptypes[datatype_name] */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_datatype_name); __Pyx_GIVEREF(__pyx_v_datatype_name); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_datatype_name); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_CompoundType), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_self->cmptypes, __pyx_v_datatype_name, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2033 * self.cmptypes[datatype_name] = CompoundType(self, datatype,\ * datatype_name) * return self.cmptypes[datatype_name] # <<<<<<<<<<<<<< * * def createVLType(self, datatype, datatype_name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_GetItem(__pyx_v_self->cmptypes, __pyx_v_datatype_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2017 * # looks in the file, so no need to manually update. * * def createCompoundType(self, datatype, datatype_name): # <<<<<<<<<<<<<< * """ * **`createCompoundType(self, datatype, datatype_name)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createCompoundType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2035 * return self.cmptypes[datatype_name] * * def createVLType(self, datatype, datatype_name): # <<<<<<<<<<<<<< * """ * **`createVLType(self, datatype, datatype_name)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_37createVLType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_36createVLType[] = "\n**`createVLType(self, datatype, datatype_name)`**\n\nCreates a new VLEN data type named `datatype_name` from a numpy\ndtype object `datatype`.\n\nThe return value is the `netCDF4.VLType` class instance describing the new\ndatatype."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_37createVLType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_datatype = 0; PyObject *__pyx_v_datatype_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVLType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_datatype,&__pyx_n_s_datatype_name,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createVLType", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVLType") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_datatype = values[0]; __pyx_v_datatype_name = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVLType", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createVLType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_36createVLType(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_datatype, __pyx_v_datatype_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_36createVLType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVLType", 0); /* "netCDF4/_netCDF4.pyx":2044 * The return value is the `netCDF4.VLType` class instance describing the new * datatype.""" * self.vltypes[datatype_name] = VLType(self, datatype, datatype_name) # <<<<<<<<<<<<<< * return self.vltypes[datatype_name] * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_datatype_name); __Pyx_GIVEREF(__pyx_v_datatype_name); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_datatype_name); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_VLType), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_self->vltypes, __pyx_v_datatype_name, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2045 * datatype.""" * self.vltypes[datatype_name] = VLType(self, datatype, datatype_name) * return self.vltypes[datatype_name] # <<<<<<<<<<<<<< * * def createEnumType(self, datatype, datatype_name, enum_dict): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_GetItem(__pyx_v_self->vltypes, __pyx_v_datatype_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2035 * return self.cmptypes[datatype_name] * * def createVLType(self, datatype, datatype_name): # <<<<<<<<<<<<<< * """ * **`createVLType(self, datatype, datatype_name)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createVLType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2047 * return self.vltypes[datatype_name] * * def createEnumType(self, datatype, datatype_name, enum_dict): # <<<<<<<<<<<<<< * """ * **`createEnumType(self, datatype, datatype_name, enum_dict)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_39createEnumType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_38createEnumType[] = "\n**`createEnumType(self, datatype, datatype_name, enum_dict)`**\n\nCreates a new Enum data type named `datatype_name` from a numpy\ninteger dtype object `datatype`, and a python dictionary\ndefining the enum fields and values.\n\nThe return value is the `netCDF4.EnumType` class instance describing the new\ndatatype."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_39createEnumType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_datatype = 0; PyObject *__pyx_v_datatype_name = 0; PyObject *__pyx_v_enum_dict = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createEnumType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_datatype,&__pyx_n_s_datatype_name,&__pyx_n_s_enum_dict,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createEnumType", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enum_dict)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createEnumType", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEnumType") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_datatype = values[0]; __pyx_v_datatype_name = values[1]; __pyx_v_enum_dict = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createEnumType", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createEnumType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_38createEnumType(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_datatype, __pyx_v_datatype_name, __pyx_v_enum_dict); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_38createEnumType(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_datatype, PyObject *__pyx_v_datatype_name, PyObject *__pyx_v_enum_dict) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createEnumType", 0); /* "netCDF4/_netCDF4.pyx":2057 * The return value is the `netCDF4.EnumType` class instance describing the new * datatype.""" * self.enumtypes[datatype_name] = EnumType(self, datatype, datatype_name, # <<<<<<<<<<<<<< * enum_dict) * return self.enumtypes[datatype_name] */ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_datatype); __Pyx_INCREF(__pyx_v_datatype_name); __Pyx_GIVEREF(__pyx_v_datatype_name); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_datatype_name); __Pyx_INCREF(__pyx_v_enum_dict); __Pyx_GIVEREF(__pyx_v_enum_dict); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_enum_dict); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_EnumType), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_self->enumtypes, __pyx_v_datatype_name, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2059 * self.enumtypes[datatype_name] = EnumType(self, datatype, datatype_name, * enum_dict) * return self.enumtypes[datatype_name] # <<<<<<<<<<<<<< * * def createVariable(self, varname, datatype, dimensions=(), zlib=False, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_GetItem(__pyx_v_self->enumtypes, __pyx_v_datatype_name); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2047 * return self.vltypes[datatype_name] * * def createEnumType(self, datatype, datatype_name, enum_dict): # <<<<<<<<<<<<<< * """ * **`createEnumType(self, datatype, datatype_name, enum_dict)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createEnumType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2061 * return self.enumtypes[datatype_name] * * def createVariable(self, varname, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_41createVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_40createVariable[] = "\n**`createVariable(self, varname, datatype, dimensions=(), zlib=False,\ncomplevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None,\nendian='native', least_significant_digit=None, fill_value=None)`**\n\nCreates a new variable with the given `varname`, `datatype`, and\n`dimensions`. If dimensions are not given, the variable is assumed to be\na scalar.\n\nIf `varname` is specified as a path, using forward slashes as in unix to\nseparate components, then intermediate groups will be created as necessary \nFor example, `createVariable('/GroupA/GroupB/VarC'),('x','y'),float)` will create groups `GroupA`\nand `GroupA/GroupB`, plus the variable `GroupA/GroupB/VarC`, if the preceding\ngroups don't already exist.\n\nThe `datatype` can be a numpy datatype object, or a string that describes\na numpy dtype object (like the `dtype.str` attribue of a numpy array).\nSupported specifiers include: `'S1' or 'c' (NC_CHAR), 'i1' or 'b' or 'B'\n(NC_BYTE), 'u1' (NC_UBYTE), 'i2' or 'h' or 's' (NC_SHORT), 'u2'\n(NC_USHORT), 'i4' or 'i' or 'l' (NC_INT), 'u4' (NC_UINT), 'i8' (NC_INT64),\n'u8' (NC_UINT64), 'f4' or 'f' (NC_FLOAT), 'f8' or 'd' (NC_DOUBLE)`.\n`datatype` can also be a `netCDF4.CompoundType` instance\n(for a structured, or compound array), a `netCDF4.VLType` instance\n(for a variable-length array), or the python `str` builtin\n(for a variable-length string array). Numpy string and unicode datatypes with\nlength greater than one are aliases for `str`.\n\nData from netCDF variables is presented to python as numpy arrays with\nthe corresponding data type.\n\n`dimensions` must be a tuple containing dimension names (strings) that\nhave been defined previously using `netCDF4.Dataset.createDimension`. The default value\nis an empty tuple, which means the variable is a scalar.\n\nIf the optional keyword `zlib` is `True`, the data will be compressed in\nthe netCDF file using gzip compression (default `False`).\n\nThe optional keyword `complevel` is an integer between 1 ""and 9 describing\nthe level of compression desired (default 4). Ignored if `zlib=False`.\n\nIf the optional keyword `shuffle` is `True`, the HDF5 shuffle filter\nwill be applied before compressing the data (default `True`). This\nsignificantly improves compression. Default is `True`. Ignored if\n`zlib=False`.\n\nIf the optional keyword `fletcher32` is `True`, the Fletcher32 HDF5\nchecksum algorithm is activated to detect errors. Default `False`.\n\nIf the optional keyword `contiguous` is `True`, the variable data is\nstored contiguously on disk. Default `False`. Setting to `True` for\na variable with an unlimited dimension will trigger an error.\n\nThe optional keyword `chunksizes` can be used to manually specify the\nHDF5 chunksizes for each dimension of the variable. A detailed\ndiscussion of HDF chunking and I/O performance is available\n[here](http://www.hdfgroup.org/HDF5/doc/H5.user/Chunking.html).\nBasically, you want the chunk size for each dimension to match as\nclosely as possible the size of the data block that users will read\nfrom the file. `chunksizes` cannot be set if `contiguous=True`.\n\nThe optional keyword `endian` can be used to control whether the\ndata is stored in little or big endian format on disk. Possible\nvalues are `little, big` or `native` (default). The library\nwill automatically handle endian conversions when the data is read,\nbut if the data is always going to be read on a computer with the\nopposite format as the one used to create the file, there may be\nsome performance advantage to be gained by setting the endian-ness.\n\nThe `zlib, complevel, shuffle, fletcher32, contiguous, chunksizes` and `endian`\nkeywords are silently ignored for netCDF 3 files that do not use HDF5.\n\nThe optional keyword `fill_value` can be used to override the default\nnetCDF `_FillValue` (the value that the variable gets filled with before\nany data is written to it, defaults given in `netCDF4.default_fillvals`).\nIf fill_value is set to `False`, the""n the variable is not pre-filled.\n\nIf the optional keyword parameter `least_significant_digit` is\nspecified, variable data will be truncated (quantized). In conjunction\nwith `zlib=True` this produces 'lossy', but significantly more\nefficient compression. For example, if `least_significant_digit=1`,\ndata will be quantized using `numpy.around(scale*data)/scale`, where\nscale = 2**bits, and bits is determined so that a precision of 0.1 is\nretained (in this case bits=4). From the \n[PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml):\n\"least_significant_digit -- power of ten of the smallest decimal place\nin unpacked data that is a reliable value.\" Default is `None`, or no\nquantization, or 'lossless' compression.\n\nWhen creating variables in a `NETCDF4` or `NETCDF4_CLASSIC` formatted file,\nHDF5 creates something called a 'chunk cache' for each variable. The\ndefault size of the chunk cache may be large enough to completely fill\navailable memory when creating thousands of variables. The optional\nkeyword `chunk_cache` allows you to reduce (or increase) the size of\nthe default chunk cache when creating a variable. The setting only\npersists as long as the Dataset is open - you can use the set_var_chunk_cache\nmethod to change it the next time the Dataset is opened.\nWarning - messing with this parameter can seriously degrade performance.\n\nThe return value is the `netCDF4.Variable` class instance describing the new\nvariable.\n\nA list of names corresponding to netCDF variable attributes can be\nobtained with the `netCDF4.Variable` method `netCDF4.Variable.ncattrs`. A dictionary\ncontaining all the netCDF attribute name/value pairs is provided by\nthe `__dict__` attribute of a `netCDF4.Variable` instance.\n\n`netCDF4.Variable` instances behave much like array objects. Data can be\nassigned to or retrieved from a variable with indexing and slicing\noperations on the `netCDF4.Variable` instance. A `ne""tCDF4.Variable` instance has six\nDataset standard attributes: `dimensions, dtype, shape, ndim, name` and\n`least_significant_digit`. Application programs should never modify\nthese attributes. The `dimensions` attribute is a tuple containing the\nnames of the dimensions associated with this variable. The `dtype`\nattribute is a string describing the variable's data type (`i4, f8,\nS1,` etc). The `shape` attribute is a tuple describing the current\nsizes of all the variable's dimensions. The `name` attribute is a\nstring containing the name of the Variable instance.\nThe `least_significant_digit`\nattributes describes the power of ten of the smallest decimal place in\nthe data the contains a reliable value. assigned to the `netCDF4.Variable`\ninstance. If `None`, the data is not truncated. The `ndim` attribute\nis the number of variable dimensions."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_41createVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_varname = 0; PyObject *__pyx_v_datatype = 0; PyObject *__pyx_v_dimensions = 0; PyObject *__pyx_v_zlib = 0; PyObject *__pyx_v_complevel = 0; PyObject *__pyx_v_shuffle = 0; PyObject *__pyx_v_fletcher32 = 0; PyObject *__pyx_v_contiguous = 0; PyObject *__pyx_v_chunksizes = 0; PyObject *__pyx_v_endian = 0; PyObject *__pyx_v_least_significant_digit = 0; PyObject *__pyx_v_fill_value = 0; PyObject *__pyx_v_chunk_cache = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVariable (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_varname,&__pyx_n_s_datatype,&__pyx_n_s_dimensions,&__pyx_n_s_zlib,&__pyx_n_s_complevel,&__pyx_n_s_shuffle,&__pyx_n_s_fletcher32,&__pyx_n_s_contiguous,&__pyx_n_s_chunksizes,&__pyx_n_s_endian,&__pyx_n_s_least_significant_digit,&__pyx_n_s_fill_value,&__pyx_n_s_chunk_cache,0}; PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; values[2] = ((PyObject *)__pyx_empty_tuple); values[3] = ((PyObject *)Py_False); values[4] = ((PyObject *)__pyx_int_4); /* "netCDF4/_netCDF4.pyx":2062 * * def createVariable(self, varname, datatype, dimensions=(), zlib=False, * complevel=4, shuffle=True, fletcher32=False, contiguous=False, # <<<<<<<<<<<<<< * chunksizes=None, endian='native', least_significant_digit=None, * fill_value=None, chunk_cache=None): */ values[5] = ((PyObject *)Py_True); values[6] = ((PyObject *)Py_False); values[7] = ((PyObject *)Py_False); /* "netCDF4/_netCDF4.pyx":2063 * def createVariable(self, varname, datatype, dimensions=(), zlib=False, * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, # <<<<<<<<<<<<<< * fill_value=None, chunk_cache=None): * """ */ values[8] = ((PyObject *)Py_None); values[9] = ((PyObject *)__pyx_n_s_native); values[10] = ((PyObject *)Py_None); /* "netCDF4/_netCDF4.pyx":2064 * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, * fill_value=None, chunk_cache=None): # <<<<<<<<<<<<<< * """ * **`createVariable(self, varname, datatype, dimensions=(), zlib=False, */ values[11] = ((PyObject *)Py_None); values[12] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_varname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createVariable", 0, 2, 13, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions); if (value) { values[2] = value; kw_args--; } } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zlib); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_complevel); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shuffle); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fletcher32); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_contiguous); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunksizes); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endian); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_least_significant_digit); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_cache); if (value) { values[12] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVariable") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_varname = values[0]; __pyx_v_datatype = values[1]; __pyx_v_dimensions = values[2]; __pyx_v_zlib = values[3]; __pyx_v_complevel = values[4]; __pyx_v_shuffle = values[5]; __pyx_v_fletcher32 = values[6]; __pyx_v_contiguous = values[7]; __pyx_v_chunksizes = values[8]; __pyx_v_endian = values[9]; __pyx_v_least_significant_digit = values[10]; __pyx_v_fill_value = values[11]; __pyx_v_chunk_cache = values[12]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVariable", 0, 2, 13, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_40createVariable(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_varname, __pyx_v_datatype, __pyx_v_dimensions, __pyx_v_zlib, __pyx_v_complevel, __pyx_v_shuffle, __pyx_v_fletcher32, __pyx_v_contiguous, __pyx_v_chunksizes, __pyx_v_endian, __pyx_v_least_significant_digit, __pyx_v_fill_value, __pyx_v_chunk_cache); /* "netCDF4/_netCDF4.pyx":2061 * return self.enumtypes[datatype_name] * * def createVariable(self, varname, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_40createVariable(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_varname, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache) { PyObject *__pyx_v_dirname = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVariable", 0); __Pyx_INCREF(__pyx_v_varname); /* "netCDF4/_netCDF4.pyx":2188 * is the number of variable dimensions.""" * # if varname specified as a path, split out group names. * varname = posixpath.normpath(varname) # <<<<<<<<<<<<<< * dirname, varname = posixpath.split(varname) # varname is last. * # create parent groups (like mkdir -p). */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_varname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_varname); __Pyx_GIVEREF(__pyx_v_varname); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_varname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_varname, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2189 * # if varname specified as a path, split out group names. * varname = posixpath.normpath(varname) * dirname, varname = posixpath.split(varname) # varname is last. # <<<<<<<<<<<<<< * # create parent groups (like mkdir -p). * if not dirname: */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_varname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_varname); __Pyx_GIVEREF(__pyx_v_varname); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_varname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_dirname = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_varname, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2191 * dirname, varname = posixpath.split(varname) # varname is last. * # create parent groups (like mkdir -p). * if not dirname: # <<<<<<<<<<<<<< * group = self * else: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_dirname); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((!__pyx_t_6) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":2192 * # create parent groups (like mkdir -p). * if not dirname: * group = self # <<<<<<<<<<<<<< * else: * group = self.createGroup(dirname) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_group = ((PyObject *)__pyx_v_self); /* "netCDF4/_netCDF4.pyx":2191 * dirname, varname = posixpath.split(varname) # varname is last. * # create parent groups (like mkdir -p). * if not dirname: # <<<<<<<<<<<<<< * group = self * else: */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":2194 * group = self * else: * group = self.createGroup(dirname) # <<<<<<<<<<<<<< * # create variable. * group.variables[varname] = Variable(group, varname, datatype, */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createGroup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dirname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_dirname); __Pyx_GIVEREF(__pyx_v_dirname); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_dirname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_group = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":2196 * group = self.createGroup(dirname) * # create variable. * group.variables[varname] = Variable(group, varname, datatype, # <<<<<<<<<<<<<< * dimensions=dimensions, zlib=zlib, complevel=complevel, shuffle=shuffle, * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_varname); __Pyx_GIVEREF(__pyx_v_varname); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_varname); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_datatype); /* "netCDF4/_netCDF4.pyx":2197 * # create variable. * group.variables[varname] = Variable(group, varname, datatype, * dimensions=dimensions, zlib=zlib, complevel=complevel, shuffle=shuffle, # <<<<<<<<<<<<<< * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, * endian=endian, least_significant_digit=least_significant_digit, */ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dimensions, __pyx_v_dimensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_zlib, __pyx_v_zlib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_complevel, __pyx_v_complevel) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shuffle, __pyx_v_shuffle) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2198 * group.variables[varname] = Variable(group, varname, datatype, * dimensions=dimensions, zlib=zlib, complevel=complevel, shuffle=shuffle, * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, # <<<<<<<<<<<<<< * endian=endian, least_significant_digit=least_significant_digit, * fill_value=fill_value, chunk_cache=chunk_cache) */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fletcher32, __pyx_v_fletcher32) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_contiguous, __pyx_v_contiguous) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunksizes, __pyx_v_chunksizes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2199 * dimensions=dimensions, zlib=zlib, complevel=complevel, shuffle=shuffle, * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, * endian=endian, least_significant_digit=least_significant_digit, # <<<<<<<<<<<<<< * fill_value=fill_value, chunk_cache=chunk_cache) * return group.variables[varname] */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_endian, __pyx_v_endian) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2200 * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, * endian=endian, least_significant_digit=least_significant_digit, * fill_value=fill_value, chunk_cache=chunk_cache) # <<<<<<<<<<<<<< * return group.variables[varname] * */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chunk_cache, __pyx_v_chunk_cache) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2196 * group = self.createGroup(dirname) * # create variable. * group.variables[varname] = Variable(group, varname, datatype, # <<<<<<<<<<<<<< * dimensions=dimensions, zlib=zlib, complevel=complevel, shuffle=shuffle, * fletcher32=fletcher32, contiguous=contiguous, chunksizes=chunksizes, */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Variable), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_varname, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2201 * endian=endian, least_significant_digit=least_significant_digit, * fill_value=fill_value, chunk_cache=chunk_cache) * return group.variables[varname] # <<<<<<<<<<<<<< * * def renameVariable(self, oldname, newname): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_v_varname); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2061 * return self.enumtypes[datatype_name] * * def createVariable(self, varname, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dirname); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_varname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2203 * return group.variables[varname] * * def renameVariable(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameVariable(self, oldname, newname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_43renameVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_42renameVariable[] = "\n**`renameVariable(self, oldname, newname)`**\n\nrename a `netCDF4.Variable` named `oldname` to `newname`"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_43renameVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_oldname = 0; PyObject *__pyx_v_newname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renameVariable (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oldname,&__pyx_n_s_newname,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameVariable") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_oldname = values[0]; __pyx_v_newname = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renameVariable", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_42renameVariable(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_42renameVariable(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) { char *__pyx_v_namstring; PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_bytestr = NULL; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; char *__pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renameVariable", 0); /* "netCDF4/_netCDF4.pyx":2209 * rename a `netCDF4.Variable` named `oldname` to `newname`""" * cdef char *namstring * try: # <<<<<<<<<<<<<< * var = self.variables[oldname] * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "netCDF4/_netCDF4.pyx":2210 * cdef char *namstring * try: * var = self.variables[oldname] # <<<<<<<<<<<<<< * except KeyError: * raise KeyError('%s not a valid variable name' % oldname) */ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->variables, __pyx_v_oldname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L3_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_v_var = __pyx_t_4; __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2209 * rename a `netCDF4.Variable` named `oldname` to `newname`""" * cdef char *namstring * try: # <<<<<<<<<<<<<< * var = self.variables[oldname] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2211 * try: * var = self.variables[oldname] * except KeyError: # <<<<<<<<<<<<<< * raise KeyError('%s not a valid variable name' % oldname) * bytestr = _strencode(newname) */ __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":2212 * var = self.variables[oldname] * except KeyError: * raise KeyError('%s not a valid variable name' % oldname) # <<<<<<<<<<<<<< * bytestr = _strencode(newname) * namstring = bytestr */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_s_not_a_valid_variable_name, __pyx_v_oldname); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "netCDF4/_netCDF4.pyx":2209 * rename a `netCDF4.Variable` named `oldname` to `newname`""" * cdef char *namstring * try: # <<<<<<<<<<<<<< * var = self.variables[oldname] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L10_try_end:; } /* "netCDF4/_netCDF4.pyx":2213 * except KeyError: * raise KeyError('%s not a valid variable name' % oldname) * bytestr = _strencode(newname) # <<<<<<<<<<<<<< * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() */ __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_newname, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_v_bytestr = __pyx_t_7; __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2214 * raise KeyError('%s not a valid variable name' % oldname) * bytestr = _strencode(newname) * namstring = bytestr # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_rename_var(self._grpid, var._varid, namstring) */ __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_10; /* "netCDF4/_netCDF4.pyx":2215 * bytestr = _strencode(newname) * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() # <<<<<<<<<<<<<< * ierr = nc_rename_var(self._grpid, var._varid, namstring) * if self.data_model != 'NETCDF4': self._enddef() */ __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_redef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "netCDF4/_netCDF4.pyx":2216 * namstring = bytestr * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_rename_var(self._grpid, var._varid, namstring) # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_varid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_ierr = nc_rename_var(__pyx_v_self->_grpid, __pyx_t_5, __pyx_v_namstring); /* "netCDF4/_netCDF4.pyx":2217 * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_rename_var(self._grpid, var._varid, namstring) * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "netCDF4/_netCDF4.pyx":2218 * ierr = nc_rename_var(self._grpid, var._varid, namstring) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. */ __pyx_t_11 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_11) { /* "netCDF4/_netCDF4.pyx":2219 * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # remove old key from dimensions dict. * self.variables.pop(oldname) */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2218 * ierr = nc_rename_var(self._grpid, var._varid, namstring) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. */ } /* "netCDF4/_netCDF4.pyx":2221 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # remove old key from dimensions dict. * self.variables.pop(oldname) # <<<<<<<<<<<<<< * # add new key. * self.variables[newname] = var */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->variables, __pyx_n_s_pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_oldname); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_oldname); __Pyx_GIVEREF(__pyx_v_oldname); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_oldname); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2223 * self.variables.pop(oldname) * # add new key. * self.variables[newname] = var # <<<<<<<<<<<<<< * * def createGroup(self, groupname): */ if (unlikely(PyObject_SetItem(__pyx_v_self->variables, __pyx_v_newname, __pyx_v_var) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2203 * return group.variables[varname] * * def renameVariable(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameVariable(self, oldname, newname)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2225 * self.variables[newname] = var * * def createGroup(self, groupname): # <<<<<<<<<<<<<< * """ * **`createGroup(self, groupname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_45createGroup(PyObject *__pyx_v_self, PyObject *__pyx_v_groupname); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_44createGroup[] = "\n**`createGroup(self, groupname)`**\n\nCreates a new `netCDF4.Group` with the given `groupname`.\n\nIf `groupname` is specified as a path, using forward slashes as in unix to\nseparate components, then intermediate groups will be created as necessary \n(analagous to `mkdir -p` in unix). For example,\n`createGroup('/GroupA/GroupB/GroupC')` will create `GroupA`,\n`GroupA/GroupB`, and `GroupA/GroupB/GroupC`, if they don't already exist.\nIf the specified path describes a group that already exists, no error is\nraised.\n\nThe return value is a `netCDF4.Group` class instance."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_45createGroup(PyObject *__pyx_v_self, PyObject *__pyx_v_groupname) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGroup (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_44createGroup(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_groupname)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_44createGroup(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_groupname) { PyObject *__pyx_v_nestedgroups = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGroup", 0); __Pyx_INCREF(__pyx_v_groupname); /* "netCDF4/_netCDF4.pyx":2241 * The return value is a `netCDF4.Group` class instance.""" * # if group specified as a path, split out group names * groupname = posixpath.normpath(groupname) # <<<<<<<<<<<<<< * nestedgroups = groupname.split('/') * group = self */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normpath); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_groupname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_groupname); __Pyx_GIVEREF(__pyx_v_groupname); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_groupname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_groupname, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2242 * # if group specified as a path, split out group names * groupname = posixpath.normpath(groupname) * nestedgroups = groupname.split('/') # <<<<<<<<<<<<<< * group = self * # loop over group names, create parent groups if they do not already */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_groupname, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_nestedgroups = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2243 * groupname = posixpath.normpath(groupname) * nestedgroups = groupname.split('/') * group = self # <<<<<<<<<<<<<< * # loop over group names, create parent groups if they do not already * # exist. */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_group = ((PyObject *)__pyx_v_self); /* "netCDF4/_netCDF4.pyx":2246 * # loop over group names, create parent groups if they do not already * # exist. * for g in nestedgroups: # <<<<<<<<<<<<<< * if not g: continue * if g not in group.groups: */ if (likely(PyList_CheckExact(__pyx_v_nestedgroups)) || PyTuple_CheckExact(__pyx_v_nestedgroups)) { __pyx_t_3 = __pyx_v_nestedgroups; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nestedgroups); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2247 * # exist. * for g in nestedgroups: * if not g: continue # <<<<<<<<<<<<<< * if g not in group.groups: * group.groups[g] = Group(group, g) */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_g); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((!__pyx_t_7) != 0); if (__pyx_t_8) { goto __pyx_L3_continue; } /* "netCDF4/_netCDF4.pyx":2248 * for g in nestedgroups: * if not g: continue * if g not in group.groups: # <<<<<<<<<<<<<< * group.groups[g] = Group(group, g) * group = group.groups[g] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_g, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":2249 * if not g: continue * if g not in group.groups: * group.groups[g] = Group(group, g) # <<<<<<<<<<<<<< * group = group.groups[g] * # if group already exists, just return the group */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_g); __Pyx_GIVEREF(__pyx_v_g); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_g); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_Group), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_g, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2248 * for g in nestedgroups: * if not g: continue * if g not in group.groups: # <<<<<<<<<<<<<< * group.groups[g] = Group(group, g) * group = group.groups[g] */ } /* "netCDF4/_netCDF4.pyx":2250 * if g not in group.groups: * group.groups[g] = Group(group, g) * group = group.groups[g] # <<<<<<<<<<<<<< * # if group already exists, just return the group * # (prior to 1.1.8, this would have raised an error) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_groups); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_v_g); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_group, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2246 * # loop over group names, create parent groups if they do not already * # exist. * for g in nestedgroups: # <<<<<<<<<<<<<< * if not g: continue * if g not in group.groups: */ __pyx_L3_continue:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2253 * # if group already exists, just return the group * # (prior to 1.1.8, this would have raised an error) * return group # <<<<<<<<<<<<<< * * def ncattrs(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_group); __pyx_r = __pyx_v_group; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2225 * self.variables[newname] = var * * def createGroup(self, groupname): # <<<<<<<<<<<<<< * """ * **`createGroup(self, groupname)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.createGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_nestedgroups); __Pyx_XDECREF(__pyx_v_group); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_groupname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2255 * return group * * def ncattrs(self): # <<<<<<<<<<<<<< * """ * **`ncattrs(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_47ncattrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_46ncattrs[] = "\n**`ncattrs(self)`**\n\nreturn netCDF global attribute names for this `netCDF4.Dataset` or `netCDF4.Group` in a list."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_47ncattrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_46ncattrs(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_46ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ncattrs", 0); /* "netCDF4/_netCDF4.pyx":2260 * * return netCDF global attribute names for this `netCDF4.Dataset` or `netCDF4.Group` in a list.""" * return _get_att_names(self._grpid, NC_GLOBAL) # <<<<<<<<<<<<<< * * def setncattr(self,name,value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_att_names(__pyx_v_self->_grpid, NC_GLOBAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2255 * return group * * def ncattrs(self): # <<<<<<<<<<<<<< * """ * **`ncattrs(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2262 * return _get_att_names(self._grpid, NC_GLOBAL) * * def setncattr(self,name,value): # <<<<<<<<<<<<<< * """ * **`setncattr(self,name,value)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_49setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_48setncattr[] = "\n**`setncattr(self,name,value)`**\n\nset a netCDF dataset or group attribute using name,value pair.\nUse if you need to set a netCDF attribute with the\nwith the same name as one of the reserved python attributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_49setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setncattr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setncattr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_48setncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_48setncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setncattr", 0); /* "netCDF4/_netCDF4.pyx":2269 * Use if you need to set a netCDF attribute with the * with the same name as one of the reserved python attributes.""" * if self.data_model != 'NETCDF4': self._redef() # <<<<<<<<<<<<<< * _set_att(self, NC_GLOBAL, name, value) * if self.data_model != 'NETCDF4': self._enddef() */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_redef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "netCDF4/_netCDF4.pyx":2270 * with the same name as one of the reserved python attributes.""" * if self.data_model != 'NETCDF4': self._redef() * _set_att(self, NC_GLOBAL, name, value) # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._enddef() * */ __pyx_t_2 = __pyx_f_7netCDF4_8_netCDF4__set_att(((PyObject *)__pyx_v_self), NC_GLOBAL, __pyx_v_name, __pyx_v_value, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2271 * if self.data_model != 'NETCDF4': self._redef() * _set_att(self, NC_GLOBAL, name, value) * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<< * * def setncatts(self,attdict): */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enddef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "netCDF4/_netCDF4.pyx":2262 * return _get_att_names(self._grpid, NC_GLOBAL) * * def setncattr(self,name,value): # <<<<<<<<<<<<<< * """ * **`setncattr(self,name,value)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2273 * if self.data_model != 'NETCDF4': self._enddef() * * def setncatts(self,attdict): # <<<<<<<<<<<<<< * """ * **`setncatts(self,attdict)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_51setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_50setncatts[] = "\n**`setncatts(self,attdict)`**\n\nset a bunch of netCDF dataset or group attributes at once using a python dictionary.\nThis may be faster when setting a lot of attributes for a `NETCDF3`\nformatted file, since nc_redef/nc_enddef is not called in between setting\neach attribute"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_51setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setncatts (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_50setncatts(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_attdict)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_50setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_attdict) { PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setncatts", 0); /* "netCDF4/_netCDF4.pyx":2281 * formatted file, since nc_redef/nc_enddef is not called in between setting * each attribute""" * if self.data_model != 'NETCDF4': self._redef() # <<<<<<<<<<<<<< * for name, value in attdict.items(): * _set_att(self, NC_GLOBAL, name, value) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_redef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "netCDF4/_netCDF4.pyx":2282 * each attribute""" * if self.data_model != 'NETCDF4': self._redef() * for name, value in attdict.items(): # <<<<<<<<<<<<<< * _set_att(self, NC_GLOBAL, name, value) * if self.data_model != 'NETCDF4': self._enddef() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_attdict, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2283 * if self.data_model != 'NETCDF4': self._redef() * for name, value in attdict.items(): * _set_att(self, NC_GLOBAL, name, value) # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._enddef() * */ __pyx_t_2 = __pyx_f_7netCDF4_8_netCDF4__set_att(((PyObject *)__pyx_v_self), NC_GLOBAL, __pyx_v_name, __pyx_v_value, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2282 * each attribute""" * if self.data_model != 'NETCDF4': self._redef() * for name, value in attdict.items(): # <<<<<<<<<<<<<< * _set_att(self, NC_GLOBAL, name, value) * if self.data_model != 'NETCDF4': self._enddef() */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2284 * for name, value in attdict.items(): * _set_att(self, NC_GLOBAL, name, value) * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<< * * def getncattr(self,name): */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enddef); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":2273 * if self.data_model != 'NETCDF4': self._enddef() * * def setncatts(self,attdict): # <<<<<<<<<<<<<< * """ * **`setncatts(self,attdict)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2286 * if self.data_model != 'NETCDF4': self._enddef() * * def getncattr(self,name): # <<<<<<<<<<<<<< * """ * **`getncattr(self,name)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_53getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_52getncattr[] = "\n**`getncattr(self,name)`**\n\nretrievel a netCDF dataset or group attribute.\nUse if you need to get a netCDF attribute with the same \nname as one of the reserved python attributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_53getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getncattr (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_52getncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_52getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getncattr", 0); /* "netCDF4/_netCDF4.pyx":2293 * Use if you need to get a netCDF attribute with the same * name as one of the reserved python attributes.""" * return _get_att(self, NC_GLOBAL, name) # <<<<<<<<<<<<<< * * def __delattr__(self,name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_att(((PyObject *)__pyx_v_self), NC_GLOBAL, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2286 * if self.data_model != 'NETCDF4': self._enddef() * * def getncattr(self,name): # <<<<<<<<<<<<<< * """ * **`getncattr(self,name)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2295 * return _get_att(self, NC_GLOBAL, name) * * def __delattr__(self,name): # <<<<<<<<<<<<<< * # if it's a netCDF attribute, remove it * if name not in _private_atts: */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_55__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_55__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_54__delattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_54__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delattr__", 0); /* "netCDF4/_netCDF4.pyx":2297 * def __delattr__(self,name): * # if it's a netCDF attribute, remove it * if name not in _private_atts: # <<<<<<<<<<<<<< * self.delncattr(name) * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2298 * # if it's a netCDF attribute, remove it * if name not in _private_atts: * self.delncattr(name) # <<<<<<<<<<<<<< * else: * raise AttributeError( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delncattr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_name); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2297 * def __delattr__(self,name): * # if it's a netCDF attribute, remove it * if name not in _private_atts: # <<<<<<<<<<<<<< * self.delncattr(name) * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":2300 * self.delncattr(name) * else: * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * */ /*else*/ { /* "netCDF4/_netCDF4.pyx":2301 * else: * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) # <<<<<<<<<<<<<< * * def delncattr(self, name): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_is_one_of_the_reserved_attrib, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2300 * self.delncattr(name) * else: * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":2295 * return _get_att(self, NC_GLOBAL, name) * * def __delattr__(self,name): # <<<<<<<<<<<<<< * # if it's a netCDF attribute, remove it * if name not in _private_atts: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2303 * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * * def delncattr(self, name): # <<<<<<<<<<<<<< * """ * **`delncattr(self,name,value)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_57delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_56delncattr[] = "\n**`delncattr(self,name,value)`**\n\ndelete a netCDF dataset or group attribute. Use if you need to delete a\nnetCDF attribute with the same name as one of the reserved python\nattributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_57delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delncattr (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_56delncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_56delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name) { char *__pyx_v_attname; int __pyx_v_ierr; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delncattr", 0); /* "netCDF4/_netCDF4.pyx":2312 * cdef char *attname * cdef int ierr * bytestr = _strencode(name) # <<<<<<<<<<<<<< * attname = bytestr * if self.data_model != 'NETCDF4': self._redef() */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2313 * cdef int ierr * bytestr = _strencode(name) * attname = bytestr # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_attname = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2314 * bytestr = _strencode(name) * attname = bytestr * if self.data_model != 'NETCDF4': self._redef() # <<<<<<<<<<<<<< * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) * if self.data_model != 'NETCDF4': self._enddef() */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_redef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2315 * attname = bytestr * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) # <<<<<<<<<<<<<< * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_del_att(__pyx_v_self->_grpid, NC_GLOBAL, __pyx_v_attname); /* "netCDF4/_netCDF4.pyx":2316 * if self.data_model != 'NETCDF4': self._redef() * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) * if self.data_model != 'NETCDF4': self._enddef() # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->data_model, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_enddef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2317 * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2318 * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def __setattr__(self,name,value): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2317 * ierr = nc_del_att(self._grpid, NC_GLOBAL, attname) * if self.data_model != 'NETCDF4': self._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":2303 * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * * def delncattr(self, name): # <<<<<<<<<<<<<< * """ * **`delncattr(self,name,value)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2320 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __setattr__(self,name,value): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_59__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_59__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_58__setattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_58__setattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setattr__", 0); /* "netCDF4/_netCDF4.pyx":2323 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name not in _private_atts: # <<<<<<<<<<<<<< * self.setncattr(name, value) * elif not name.endswith('__'): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2324 * # level and not in the netCDF file. * if name not in _private_atts: * self.setncattr(name, value) # <<<<<<<<<<<<<< * elif not name.endswith('__'): * if hasattr(self,name): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setncattr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_name); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2323 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name not in _private_atts: # <<<<<<<<<<<<<< * self.setncattr(name, value) * elif not name.endswith('__'): */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":2325 * if name not in _private_atts: * self.setncattr(name, value) * elif not name.endswith('__'): # <<<<<<<<<<<<<< * if hasattr(self,name): * raise AttributeError( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2326 * self.setncattr(name, value) * elif not name.endswith('__'): * if hasattr(self,name): # <<<<<<<<<<<<<< * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) */ __pyx_t_2 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_v_name); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2328 * if hasattr(self,name): * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) # <<<<<<<<<<<<<< * else: * self.__dict__[name]=value */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_is_one_of_the_reserved_attrib_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2327 * elif not name.endswith('__'): * if hasattr(self,name): * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) * else: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2326 * self.setncattr(name, value) * elif not name.endswith('__'): * if hasattr(self,name): # <<<<<<<<<<<<<< * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) */ } /* "netCDF4/_netCDF4.pyx":2330 * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) * else: * self.__dict__[name]=value # <<<<<<<<<<<<<< * * def __getattr__(self,name): */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2325 * if name not in _private_atts: * self.setncattr(name, value) * elif not name.endswith('__'): # <<<<<<<<<<<<<< * if hasattr(self,name): * raise AttributeError( */ } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":2320 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __setattr__(self,name,value): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2332 * self.__dict__[name]=value * * def __getattr__(self,name): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_61__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_61__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_60__getattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_60__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_values = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); __Pyx_INCREF(__pyx_v_name); /* "netCDF4/_netCDF4.pyx":2335 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<< * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2337 * if name.startswith('__') and name.endswith('__'): * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': # <<<<<<<<<<<<<< * names = self.ncattrs() * values = [] */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2338 * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': * names = self.ncattrs() # <<<<<<<<<<<<<< * values = [] * for name in names: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_names = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2339 * if name == '__dict__': * names = self.ncattrs() * values = [] # <<<<<<<<<<<<<< * for name in names: * values.append(_get_att(self, NC_GLOBAL, name)) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_values = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2340 * names = self.ncattrs() * values = [] * for name in names: # <<<<<<<<<<<<<< * values.append(_get_att(self, NC_GLOBAL, name)) * return OrderedDict(zip(names,values)) */ if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) { __pyx_t_2 = __pyx_v_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2341 * values = [] * for name in names: * values.append(_get_att(self, NC_GLOBAL, name)) # <<<<<<<<<<<<<< * return OrderedDict(zip(names,values)) * else: */ __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__get_att(((PyObject *)__pyx_v_self), NC_GLOBAL, __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2340 * names = self.ncattrs() * values = [] * for name in names: # <<<<<<<<<<<<<< * values.append(_get_att(self, NC_GLOBAL, name)) * return OrderedDict(zip(names,values)) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2342 * for name in names: * values.append(_get_att(self, NC_GLOBAL, name)) * return OrderedDict(zip(names,values)) # <<<<<<<<<<<<<< * else: * raise AttributeError */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_names); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_v_values); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2337 * if name.startswith('__') and name.endswith('__'): * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': # <<<<<<<<<<<<<< * names = self.ncattrs() * values = [] */ } /* "netCDF4/_netCDF4.pyx":2344 * return OrderedDict(zip(names,values)) * else: * raise AttributeError # <<<<<<<<<<<<<< * elif name in _private_atts: * return self.__dict__[name] */ /*else*/ { __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":2335 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<< * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': */ } /* "netCDF4/_netCDF4.pyx":2345 * else: * raise AttributeError * elif name in _private_atts: # <<<<<<<<<<<<<< * return self.__dict__[name] * else: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":2346 * raise AttributeError * elif name in _private_atts: * return self.__dict__[name] # <<<<<<<<<<<<<< * else: * return self.getncattr(name) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2345 * else: * raise AttributeError * elif name in _private_atts: # <<<<<<<<<<<<<< * return self.__dict__[name] * else: */ } /* "netCDF4/_netCDF4.pyx":2348 * return self.__dict__[name] * else: * return self.getncattr(name) # <<<<<<<<<<<<<< * * def renameAttribute(self, oldname, newname): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getncattr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_11) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_name); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":2332 * self.__dict__[name]=value * * def __getattr__(self,name): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_values); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2350 * return self.getncattr(name) * * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameAttribute(self, oldname, newname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_63renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_62renameAttribute[] = "\n**`renameAttribute(self, oldname, newname)`**\n\nrename a `netCDF4.Dataset` or `netCDF4.Group` attribute named `oldname` to `newname`."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_63renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_oldname = 0; PyObject *__pyx_v_newname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renameAttribute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oldname,&__pyx_n_s_newname,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("renameAttribute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameAttribute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_oldname = values[0]; __pyx_v_newname = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renameAttribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_62renameAttribute(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_62renameAttribute(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) { int __pyx_v_ierr; char *__pyx_v_oldnamec; char *__pyx_v_newnamec; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renameAttribute", 0); /* "netCDF4/_netCDF4.pyx":2358 * cdef char *oldnamec * cdef char *newnamec * bytestr = _strencode(oldname) # <<<<<<<<<<<<<< * oldnamec = bytestr * bytestr = _strencode(newname) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_oldname, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2359 * cdef char *newnamec * bytestr = _strencode(oldname) * oldnamec = bytestr # <<<<<<<<<<<<<< * bytestr = _strencode(newname) * newnamec = bytestr */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_oldnamec = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2360 * bytestr = _strencode(oldname) * oldnamec = bytestr * bytestr = _strencode(newname) # <<<<<<<<<<<<<< * newnamec = bytestr * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_newname, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2361 * oldnamec = bytestr * bytestr = _strencode(newname) * newnamec = bytestr # <<<<<<<<<<<<<< * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) * if ierr != NC_NOERR: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_newnamec = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2362 * bytestr = _strencode(newname) * newnamec = bytestr * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_rename_att(__pyx_v_self->_grpid, NC_GLOBAL, __pyx_v_oldnamec, __pyx_v_newnamec); /* "netCDF4/_netCDF4.pyx":2363 * newnamec = bytestr * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2364 * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def renameGroup(self, oldname, newname): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2363 * newnamec = bytestr * ierr = nc_rename_att(self._grpid, NC_GLOBAL, oldnamec, newnamec) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":2350 * return self.getncattr(name) * * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameAttribute(self, oldname, newname)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2366 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def renameGroup(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameGroup(self, oldname, newname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_65renameGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_64renameGroup[] = "\n**`renameGroup(self, oldname, newname)`**\n\nrename a `netCDF4.Group` named `oldname` to `newname` (requires netcdf >= 4.3.1)."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_65renameGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_oldname = 0; CYTHON_UNUSED PyObject *__pyx_v_newname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renameGroup (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oldname,&__pyx_n_s_newname,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("renameGroup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameGroup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_oldname = values[0]; __pyx_v_newname = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renameGroup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_64renameGroup(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_64renameGroup(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_oldname, CYTHON_UNUSED PyObject *__pyx_v_newname) { PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renameGroup", 0); /* "netCDF4/_netCDF4.pyx":2388 * self.groups[newname] = grp * ELSE: * msg = """ # <<<<<<<<<<<<<< * renameGroup method not enabled. To enable, install Cython, make sure you have * version 4.3.1 or higher of the netcdf C lib, and rebuild netcdf4-python.""" */ __Pyx_INCREF(__pyx_kp_s_renameGroup_method_not_enabled); __pyx_v_msg = __pyx_kp_s_renameGroup_method_not_enabled; /* "netCDF4/_netCDF4.pyx":2391 * renameGroup method not enabled. To enable, install Cython, make sure you have * version 4.3.1 or higher of the netcdf C lib, and rebuild netcdf4-python.""" * raise ValueError(msg) # <<<<<<<<<<<<<< * * def set_auto_maskandscale(self, value): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2366 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def renameGroup(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameGroup(self, oldname, newname)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.renameGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2393 * raise ValueError(msg) * * def set_auto_maskandscale(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_maskandscale(self, True_or_False)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_67set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_66set_auto_maskandscale[] = "\n**`set_auto_maskandscale(self, True_or_False)`**\n\nCall `netCDF4.Variable.set_auto_maskandscale` for all variables contained in this `netCDF4.Dataset` or\n`netCDF4.Group`, as well as for all variables in all its subgroups.\n\n**`True_or_False`**: Boolean determining if automatic conversion to masked arrays\nand variable scaling shall be applied for all variables.\n\n***Note***: Calling this function only affects existing variables. Variables created\nafter calling this function will follow the default behaviour.\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_67set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_maskandscale (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_66set_auto_maskandscale(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_66set_auto_maskandscale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_groups = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_maskandscale", 0); /* "netCDF4/_netCDF4.pyx":2407 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_maskandscale(value) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->variables, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2408 * * for var in self.variables.values(): * var.set_auto_maskandscale(value) # <<<<<<<<<<<<<< * * for groups in _walk_grps(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_maskandscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2407 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_maskandscale(value) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2410 * var.set_auto_maskandscale(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_walk_grps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_groups, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2411 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_maskandscale(value) */ if (likely(PyList_CheckExact(__pyx_v_groups)) || PyTuple_CheckExact(__pyx_v_groups)) { __pyx_t_2 = __pyx_v_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2412 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_maskandscale(value) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_3) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2413 * for group in groups: * for var in group.variables.values(): * var.set_auto_maskandscale(value) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_maskandscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_12) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_value); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2412 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_maskandscale(value) * */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":2411 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_maskandscale(value) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2410 * var.set_auto_maskandscale(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2393 * raise ValueError(msg) * * def set_auto_maskandscale(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_maskandscale(self, True_or_False)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_auto_maskandscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_groups); __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2416 * * * def set_auto_mask(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_mask(self, True_or_False)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_69set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_68set_auto_mask[] = "\n**`set_auto_mask(self, True_or_False)`**\n\nCall `netCDF4.Variable.set_auto_mask` for all variables contained in this `netCDF4.Dataset` or\n`netCDF4.Group`, as well as for all variables in all its subgroups.\n\n**`True_or_False`**: Boolean determining if automatic conversion to masked arrays\nshall be applied for all variables.\n\n***Note***: Calling this function only affects existing variables. Variables created\nafter calling this function will follow the default behaviour.\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_69set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_mask (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_68set_auto_mask(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_68set_auto_mask(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_groups = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_mask", 0); /* "netCDF4/_netCDF4.pyx":2430 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_mask(value) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->variables, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2431 * * for var in self.variables.values(): * var.set_auto_mask(value) # <<<<<<<<<<<<<< * * for groups in _walk_grps(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_mask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2430 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_mask(value) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2433 * var.set_auto_mask(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_walk_grps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_groups, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2434 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_mask(value) */ if (likely(PyList_CheckExact(__pyx_v_groups)) || PyTuple_CheckExact(__pyx_v_groups)) { __pyx_t_2 = __pyx_v_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2435 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_mask(value) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_3) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2436 * for group in groups: * for var in group.variables.values(): * var.set_auto_mask(value) # <<<<<<<<<<<<<< * * def set_auto_scale(self, value): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_mask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_12) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_value); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2435 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_mask(value) * */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":2434 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_mask(value) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2433 * var.set_auto_mask(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2416 * * * def set_auto_mask(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_mask(self, True_or_False)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_auto_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_groups); __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2438 * var.set_auto_mask(value) * * def set_auto_scale(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_scale(self, True_or_False)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_71set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_70set_auto_scale[] = "\n**`set_auto_scale(self, True_or_False)`**\n\nCall `netCDF4.Variable.set_auto_scale` for all variables contained in this `netCDF4.Dataset` or\n`netCDF4.Group`, as well as for all variables in all its subgroups.\n\n**`True_or_False`**: Boolean determining if automatic variable scaling\nshall be applied for all variables.\n\n***Note***: Calling this function only affects existing variables. Variables created\nafter calling this function will follow the default behaviour.\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_71set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_scale (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_70set_auto_scale(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_70set_auto_scale(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_groups = NULL; PyObject *__pyx_v_group = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_scale", 0); /* "netCDF4/_netCDF4.pyx":2452 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_scale(value) * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->variables, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2453 * * for var in self.variables.values(): * var.set_auto_scale(value) # <<<<<<<<<<<<<< * * for groups in _walk_grps(self): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2452 * """ * * for var in self.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_scale(value) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2455 * var.set_auto_scale(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_walk_grps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_self)); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_groups, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2456 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_scale(value) */ if (likely(PyList_CheckExact(__pyx_v_groups)) || PyTuple_CheckExact(__pyx_v_groups)) { __pyx_t_2 = __pyx_v_groups; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_groups); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2457 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_scale(value) * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_variables); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_3) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2458 * for group in groups: * for var in group.variables.values(): * var.set_auto_scale(value) # <<<<<<<<<<<<<< * * def get_variables_by_attributes(self, **kwargs): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_var, __pyx_n_s_set_auto_scale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_12) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_value); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":2457 * for groups in _walk_grps(self): * for group in groups: * for var in group.variables.values(): # <<<<<<<<<<<<<< * var.set_auto_scale(value) * */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":2456 * * for groups in _walk_grps(self): * for group in groups: # <<<<<<<<<<<<<< * for var in group.variables.values(): * var.set_auto_scale(value) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2455 * var.set_auto_scale(value) * * for groups in _walk_grps(self): # <<<<<<<<<<<<<< * for group in groups: * for var in group.variables.values(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2438 * var.set_auto_mask(value) * * def set_auto_scale(self, value): # <<<<<<<<<<<<<< * """ * **`set_auto_scale(self, True_or_False)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.set_auto_scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_groups); __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2460 * var.set_auto_scale(value) * * def get_variables_by_attributes(self, **kwargs): # <<<<<<<<<<<<<< * """ * **`get_variables_by_attribute(self, **kwargs)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_73get_variables_by_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_7Dataset_72get_variables_by_attributes[] = "\n**`get_variables_by_attribute(self, **kwargs)`**\n\nReturns a list of variables that match specific conditions.\n\nCan pass in key=value parameters and variables are returned that\ncontain all of the matches. For example, \n\n :::python\n >>> # Get variables with x-axis attribute.\n >>> vs = nc.get_variables_by_attributes(axis='X')\n >>> # Get variables with matching \"standard_name\" attribute\n >>> vs = nc.get_variables_by_attributes(standard_name='northward_sea_water_velocity')\n\nCan pass in key=callable parameter and variables are returned if the\ncallable returns True. The callable should accept a single parameter,\nthe attribute value. None is given as the attribute value when the\nattribute does not exist on the variable. For example,\n\n :::python\n >>> # Get Axis variables\n >>> vs = nc.get_variables_by_attributes(axis=lambda v: v in ['X', 'Y', 'Z', 'T'])\n >>> # Get variables that don't have an \"axis\" attribute\n >>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None)\n >>> # Get variables that have a \"grid_mapping\" attribute\n >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)\n"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_73get_variables_by_attributes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_variables_by_attributes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("get_variables_by_attributes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_variables_by_attributes", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_72get_variables_by_attributes(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_72get_variables_by_attributes(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_vs = NULL; PyObject *__pyx_v_has_value_flag = NULL; PyObject *__pyx_v_vname = NULL; PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_k = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_variables_by_attributes", 0); /* "netCDF4/_netCDF4.pyx":2488 * >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None) * """ * vs = [] # <<<<<<<<<<<<<< * * has_value_flag = False */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_vs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2490 * vs = [] * * has_value_flag = False # <<<<<<<<<<<<<< * for vname in self.variables: * var = self.variables[vname] */ __Pyx_INCREF(Py_False); __pyx_v_has_value_flag = Py_False; /* "netCDF4/_netCDF4.pyx":2491 * * has_value_flag = False * for vname in self.variables: # <<<<<<<<<<<<<< * var = self.variables[vname] * for k, v in kwargs.items(): */ if (likely(PyList_CheckExact(__pyx_v_self->variables)) || PyTuple_CheckExact(__pyx_v_self->variables)) { __pyx_t_1 = __pyx_v_self->variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_vname, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2492 * has_value_flag = False * for vname in self.variables: * var = self.variables[vname] # <<<<<<<<<<<<<< * for k, v in kwargs.items(): * if callable(v): */ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->variables, __pyx_v_vname); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2493 * for vname in self.variables: * var = self.variables[vname] * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * if callable(v): * has_value_flag = v(getattr(var, k, None)) */ __pyx_t_4 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_9 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":2494 * var = self.variables[vname] * for k, v in kwargs.items(): * if callable(v): # <<<<<<<<<<<<<< * has_value_flag = v(getattr(var, k, None)) * if has_value_flag is False: */ __pyx_t_12 = __Pyx_PyCallable_Check(__pyx_v_v); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = (__pyx_t_12 != 0); if (__pyx_t_13) { /* "netCDF4/_netCDF4.pyx":2495 * for k, v in kwargs.items(): * if callable(v): * has_value_flag = v(getattr(var, k, None)) # <<<<<<<<<<<<<< * if has_value_flag is False: * break */ __pyx_t_9 = __Pyx_GetAttr3(__pyx_v_var, __pyx_v_k, Py_None); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_v); __pyx_t_8 = __pyx_v_v; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_10) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_has_value_flag, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":2496 * if callable(v): * has_value_flag = v(getattr(var, k, None)) * if has_value_flag is False: # <<<<<<<<<<<<<< * break * elif hasattr(var, k) and getattr(var, k) == v: */ __pyx_t_13 = (__pyx_v_has_value_flag == Py_False); __pyx_t_12 = (__pyx_t_13 != 0); if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":2497 * has_value_flag = v(getattr(var, k, None)) * if has_value_flag is False: * break # <<<<<<<<<<<<<< * elif hasattr(var, k) and getattr(var, k) == v: * has_value_flag = True */ goto __pyx_L6_break; /* "netCDF4/_netCDF4.pyx":2496 * if callable(v): * has_value_flag = v(getattr(var, k, None)) * if has_value_flag is False: # <<<<<<<<<<<<<< * break * elif hasattr(var, k) and getattr(var, k) == v: */ } /* "netCDF4/_netCDF4.pyx":2494 * var = self.variables[vname] * for k, v in kwargs.items(): * if callable(v): # <<<<<<<<<<<<<< * has_value_flag = v(getattr(var, k, None)) * if has_value_flag is False: */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":2498 * if has_value_flag is False: * break * elif hasattr(var, k) and getattr(var, k) == v: # <<<<<<<<<<<<<< * has_value_flag = True * else: */ __pyx_t_13 = PyObject_HasAttr(__pyx_v_var, __pyx_v_k); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = (__pyx_t_13 != 0); if (__pyx_t_15) { } else { __pyx_t_12 = __pyx_t_15; goto __pyx_L11_bool_binop_done; } __pyx_t_4 = __Pyx_GetAttr(__pyx_v_var, __pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_v_v, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_12 = __pyx_t_15; __pyx_L11_bool_binop_done:; if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":2499 * break * elif hasattr(var, k) and getattr(var, k) == v: * has_value_flag = True # <<<<<<<<<<<<<< * else: * has_value_flag = False */ __Pyx_INCREF(Py_True); __Pyx_DECREF_SET(__pyx_v_has_value_flag, Py_True); /* "netCDF4/_netCDF4.pyx":2498 * if has_value_flag is False: * break * elif hasattr(var, k) and getattr(var, k) == v: # <<<<<<<<<<<<<< * has_value_flag = True * else: */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":2501 * has_value_flag = True * else: * has_value_flag = False # <<<<<<<<<<<<<< * break * */ /*else*/ { __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_has_value_flag, Py_False); /* "netCDF4/_netCDF4.pyx":2502 * else: * has_value_flag = False * break # <<<<<<<<<<<<<< * * if has_value_flag is True: */ goto __pyx_L6_break; } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":2493 * for vname in self.variables: * var = self.variables[vname] * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * if callable(v): * has_value_flag = v(getattr(var, k, None)) */ } __pyx_L6_break:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":2504 * break * * if has_value_flag is True: # <<<<<<<<<<<<<< * vs.append(self.variables[vname]) * */ __pyx_t_12 = (__pyx_v_has_value_flag == Py_True); __pyx_t_15 = (__pyx_t_12 != 0); if (__pyx_t_15) { /* "netCDF4/_netCDF4.pyx":2505 * * if has_value_flag is True: * vs.append(self.variables[vname]) # <<<<<<<<<<<<<< * * return vs */ __pyx_t_5 = PyObject_GetItem(__pyx_v_self->variables, __pyx_v_vname); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_vs, __pyx_t_5); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":2504 * break * * if has_value_flag is True: # <<<<<<<<<<<<<< * vs.append(self.variables[vname]) * */ } /* "netCDF4/_netCDF4.pyx":2491 * * has_value_flag = False * for vname in self.variables: # <<<<<<<<<<<<<< * var = self.variables[vname] * for k, v in kwargs.items(): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2507 * vs.append(self.variables[vname]) * * return vs # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vs); __pyx_r = __pyx_v_vs; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2460 * var.set_auto_scale(value) * * def get_variables_by_attributes(self, **kwargs): # <<<<<<<<<<<<<< * """ * **`get_variables_by_attribute(self, **kwargs)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset.get_variables_by_attributes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vs); __Pyx_XDECREF(__pyx_v_has_value_flag); __Pyx_XDECREF(__pyx_v_vname); __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1607 * """ * cdef object __weakref__ * cdef public int _grpid # <<<<<<<<<<<<<< * cdef public int _isopen * cdef public groups, dimensions, variables, disk_format, path, parent,\ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset._grpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_grpid = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset._grpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1608 * cdef object __weakref__ * cdef public int _grpid * cdef public int _isopen # <<<<<<<<<<<<<< * cdef public groups, dimensions, variables, disk_format, path, parent,\ * file_format, data_model, cmptypes, vltypes, enumtypes, __orthogonal_indexing__, \ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_isopen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dataset._isopen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7_isopen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7_isopen_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_isopen = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dataset._isopen.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1609 * cdef public int _grpid * cdef public int _isopen * cdef public groups, dimensions, variables, disk_format, path, parent,\ # <<<<<<<<<<<<<< * file_format, data_model, cmptypes, vltypes, enumtypes, __orthogonal_indexing__, \ * keepweakref */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->groups); __pyx_r = __pyx_v_self->groups; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->groups); __Pyx_DECREF(__pyx_v_self->groups); __pyx_v_self->groups = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6groups_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6groups_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->groups); __Pyx_DECREF(__pyx_v_self->groups); __pyx_v_self->groups = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dimensions); __pyx_r = __pyx_v_self->dimensions; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->dimensions); __Pyx_DECREF(__pyx_v_self->dimensions); __pyx_v_self->dimensions = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10dimensions_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10dimensions_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->dimensions); __Pyx_DECREF(__pyx_v_self->dimensions); __pyx_v_self->dimensions = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->variables); __pyx_r = __pyx_v_self->variables; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->variables); __Pyx_DECREF(__pyx_v_self->variables); __pyx_v_self->variables = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9variables_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9variables_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->variables); __Pyx_DECREF(__pyx_v_self->variables); __pyx_v_self->variables = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->disk_format); __pyx_r = __pyx_v_self->disk_format; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->disk_format); __Pyx_DECREF(__pyx_v_self->disk_format); __pyx_v_self->disk_format = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11disk_format_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11disk_format_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->disk_format); __Pyx_DECREF(__pyx_v_self->disk_format); __pyx_v_self->disk_format = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->path); __pyx_r = __pyx_v_self->path; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->path); __Pyx_DECREF(__pyx_v_self->path); __pyx_v_self->path = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_4path_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_4path_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->path); __Pyx_DECREF(__pyx_v_self->path); __pyx_v_self->path = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->parent); __pyx_r = __pyx_v_self->parent; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->parent); __Pyx_DECREF(__pyx_v_self->parent); __pyx_v_self->parent = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_6parent_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_6parent_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->parent); __Pyx_DECREF(__pyx_v_self->parent); __pyx_v_self->parent = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1610 * cdef public int _isopen * cdef public groups, dimensions, variables, disk_format, path, parent,\ * file_format, data_model, cmptypes, vltypes, enumtypes, __orthogonal_indexing__, \ # <<<<<<<<<<<<<< * keepweakref * # Docstrings for class variables (used by pdoc). */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->file_format); __pyx_r = __pyx_v_self->file_format; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->file_format); __Pyx_DECREF(__pyx_v_self->file_format); __pyx_v_self->file_format = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11file_format_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11file_format_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->file_format); __Pyx_DECREF(__pyx_v_self->file_format); __pyx_v_self->file_format = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->data_model); __pyx_r = __pyx_v_self->data_model; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->data_model); __Pyx_DECREF(__pyx_v_self->data_model); __pyx_v_self->data_model = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_10data_model_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_10data_model_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->data_model); __Pyx_DECREF(__pyx_v_self->data_model); __pyx_v_self->data_model = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->cmptypes); __pyx_r = __pyx_v_self->cmptypes; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->cmptypes); __Pyx_DECREF(__pyx_v_self->cmptypes); __pyx_v_self->cmptypes = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_8cmptypes_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_8cmptypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cmptypes); __Pyx_DECREF(__pyx_v_self->cmptypes); __pyx_v_self->cmptypes = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->vltypes); __pyx_r = __pyx_v_self->vltypes; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->vltypes); __Pyx_DECREF(__pyx_v_self->vltypes); __pyx_v_self->vltypes = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_7vltypes_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_7vltypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->vltypes); __Pyx_DECREF(__pyx_v_self->vltypes); __pyx_v_self->vltypes = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->enumtypes); __pyx_r = __pyx_v_self->enumtypes; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->enumtypes); __Pyx_DECREF(__pyx_v_self->enumtypes); __pyx_v_self->enumtypes = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_9enumtypes_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_9enumtypes_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->enumtypes); __Pyx_DECREF(__pyx_v_self->enumtypes); __pyx_v_self->enumtypes = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing_____get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing_____get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__orthogonal_indexing__); __pyx_r = __pyx_v_self->__orthogonal_indexing__; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_23__orthogonal_indexing___4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":1611 * cdef public groups, dimensions, variables, disk_format, path, parent,\ * file_format, data_model, cmptypes, vltypes, enumtypes, __orthogonal_indexing__, \ * keepweakref # <<<<<<<<<<<<<< * # Docstrings for class variables (used by pdoc). * __pdoc__['Dataset.dimensions']=\ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->keepweakref); __pyx_r = __pyx_v_self->keepweakref; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->keepweakref); __Pyx_DECREF(__pyx_v_self->keepweakref); __pyx_v_self->keepweakref = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_7Dataset_11keepweakref_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_7Dataset_11keepweakref_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dataset *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->keepweakref); __Pyx_DECREF(__pyx_v_self->keepweakref); __pyx_v_self->keepweakref = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2529 * __pdoc__['Group.name']=\ * """A string describing the name of the `netCDF4.Group`.""" * def __init__(self, parent, name, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, parent, name)`** */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_5Group_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_5Group___init__[] = "\n **`__init__(self, parent, name)`**\n `netCDF4.Group` constructor.\n\n **`parent`**: `netCDF4.Group` instance for the parent group. If being created\n in the root group, use a `netCDF4.Dataset` instance.\n\n **`name`**: - Name of the group.\n\n ***Note***: `netCDF4.Group` instances should be created using the\n `netCDF4.Dataset.createGroup` method of a `netCDF4.Dataset` instance, or\n another `netCDF4.Group` instance, not using this class directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_5Group___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_5Group_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_parent = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parent,&__pyx_n_s_name,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parent)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_parent = values[0]; __pyx_v_name = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.Group.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_5Group___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_Group *)__pyx_v_self), __pyx_v_parent, __pyx_v_name, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_5Group___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self, PyObject *__pyx_v_parent, PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs) { int __pyx_v_ierr; char *__pyx_v_groupname; PyObject *__pyx_v_bytestr = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); char *__pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "netCDF4/_netCDF4.pyx":2546 * cdef char *groupname * # flag to indicate that Variables in this Group support orthogonal indexing. * self.__orthogonal_indexing__ = True # <<<<<<<<<<<<<< * # set data_model and file_format attributes. * self.data_model = parent.data_model */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->__pyx_base.__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__pyx_base.__orthogonal_indexing__); __pyx_v_self->__pyx_base.__orthogonal_indexing__ = Py_True; /* "netCDF4/_netCDF4.pyx":2548 * self.__orthogonal_indexing__ = True * # set data_model and file_format attributes. * self.data_model = parent.data_model # <<<<<<<<<<<<<< * self.file_format = parent.file_format * # full path to Group. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.data_model); __Pyx_DECREF(__pyx_v_self->__pyx_base.data_model); __pyx_v_self->__pyx_base.data_model = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2549 * # set data_model and file_format attributes. * self.data_model = parent.data_model * self.file_format = parent.file_format # <<<<<<<<<<<<<< * # full path to Group. * self.path = posixpath.join(parent.path, name) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_file_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.file_format); __Pyx_DECREF(__pyx_v_self->__pyx_base.file_format); __pyx_v_self->__pyx_base.file_format = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2551 * self.file_format = parent.file_format * # full path to Group. * self.path = posixpath.join(parent.path, name) # <<<<<<<<<<<<<< * # parent group. * self.parent = parent */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_posixpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_name); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.path); __Pyx_DECREF(__pyx_v_self->__pyx_base.path); __pyx_v_self->__pyx_base.path = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2553 * self.path = posixpath.join(parent.path, name) * # parent group. * self.parent = parent # <<<<<<<<<<<<<< * # propagate weak reference setting from parent. * self.keepweakref = parent.keepweakref */ __Pyx_INCREF(__pyx_v_parent); __Pyx_GIVEREF(__pyx_v_parent); __Pyx_GOTREF(__pyx_v_self->__pyx_base.parent); __Pyx_DECREF(__pyx_v_self->__pyx_base.parent); __pyx_v_self->__pyx_base.parent = __pyx_v_parent; /* "netCDF4/_netCDF4.pyx":2555 * self.parent = parent * # propagate weak reference setting from parent. * self.keepweakref = parent.keepweakref # <<<<<<<<<<<<<< * if 'id' in kwargs: * self._grpid = kwargs['id'] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_keepweakref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.keepweakref); __Pyx_DECREF(__pyx_v_self->__pyx_base.keepweakref); __pyx_v_self->__pyx_base.keepweakref = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2556 * # propagate weak reference setting from parent. * self.keepweakref = parent.keepweakref * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._grpid = kwargs['id'] * # get compound, vlen and enum types in this Group. */ __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_id, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":2557 * self.keepweakref = parent.keepweakref * if 'id' in kwargs: * self._grpid = kwargs['id'] # <<<<<<<<<<<<<< * # get compound, vlen and enum types in this Group. * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) */ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_id); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx_base._grpid = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":2559 * self._grpid = kwargs['id'] * # get compound, vlen and enum types in this Group. * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) # <<<<<<<<<<<<<< * # get dimensions in this Group. * self.dimensions = _get_dims(self) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_types(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_2 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_2 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.cmptypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.cmptypes); __pyx_v_self->__pyx_base.cmptypes = __pyx_t_3; __pyx_t_3 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->__pyx_base.vltypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.vltypes); __pyx_v_self->__pyx_base.vltypes = __pyx_t_6; __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->__pyx_base.enumtypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.enumtypes); __pyx_v_self->__pyx_base.enumtypes = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":2561 * self.cmptypes, self.vltypes, self.enumtypes = _get_types(self) * # get dimensions in this Group. * self.dimensions = _get_dims(self) # <<<<<<<<<<<<<< * # get variables in this Group. * self.variables = _get_vars(self) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_dims(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.dimensions); __Pyx_DECREF(__pyx_v_self->__pyx_base.dimensions); __pyx_v_self->__pyx_base.dimensions = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2563 * self.dimensions = _get_dims(self) * # get variables in this Group. * self.variables = _get_vars(self) # <<<<<<<<<<<<<< * # get groups in this Group. * self.groups = _get_grps(self) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_vars(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.variables); __Pyx_DECREF(__pyx_v_self->__pyx_base.variables); __pyx_v_self->__pyx_base.variables = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2565 * self.variables = _get_vars(self) * # get groups in this Group. * self.groups = _get_grps(self) # <<<<<<<<<<<<<< * else: * bytestr = _strencode(name) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_grps(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.groups); __Pyx_DECREF(__pyx_v_self->__pyx_base.groups); __pyx_v_self->__pyx_base.groups = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2556 * # propagate weak reference setting from parent. * self.keepweakref = parent.keepweakref * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._grpid = kwargs['id'] * # get compound, vlen and enum types in this Group. */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":2567 * self.groups = _get_grps(self) * else: * bytestr = _strencode(name) # <<<<<<<<<<<<<< * groupname = bytestr * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) */ /*else*/ { __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2568 * else: * bytestr = _strencode(name) * groupname = bytestr # <<<<<<<<<<<<<< * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) * if ierr != NC_NOERR: */ __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_groupname = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":2569 * bytestr = _strencode(name) * groupname = bytestr * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_def_grp(__pyx_t_9, __pyx_v_groupname, (&__pyx_v_self->__pyx_base._grpid)); /* "netCDF4/_netCDF4.pyx":2570 * groupname = bytestr * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.cmptypes = OrderedDict() */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":2571 * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * self.cmptypes = OrderedDict() * self.vltypes = OrderedDict() */ __pyx_t_11 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_11, 0, strlen(__pyx_t_11), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2570 * groupname = bytestr * ierr = nc_def_grp(parent._grpid, groupname, &self._grpid) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.cmptypes = OrderedDict() */ } /* "netCDF4/_netCDF4.pyx":2572 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.cmptypes = OrderedDict() # <<<<<<<<<<<<<< * self.vltypes = OrderedDict() * self.enumtypes = OrderedDict() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.cmptypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.cmptypes); __pyx_v_self->__pyx_base.cmptypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2573 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.cmptypes = OrderedDict() * self.vltypes = OrderedDict() # <<<<<<<<<<<<<< * self.enumtypes = OrderedDict() * self.dimensions = OrderedDict() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.vltypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.vltypes); __pyx_v_self->__pyx_base.vltypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2574 * self.cmptypes = OrderedDict() * self.vltypes = OrderedDict() * self.enumtypes = OrderedDict() # <<<<<<<<<<<<<< * self.dimensions = OrderedDict() * self.variables = OrderedDict() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.enumtypes); __Pyx_DECREF(__pyx_v_self->__pyx_base.enumtypes); __pyx_v_self->__pyx_base.enumtypes = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2575 * self.vltypes = OrderedDict() * self.enumtypes = OrderedDict() * self.dimensions = OrderedDict() # <<<<<<<<<<<<<< * self.variables = OrderedDict() * self.groups = OrderedDict() */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.dimensions); __Pyx_DECREF(__pyx_v_self->__pyx_base.dimensions); __pyx_v_self->__pyx_base.dimensions = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2576 * self.enumtypes = OrderedDict() * self.dimensions = OrderedDict() * self.variables = OrderedDict() # <<<<<<<<<<<<<< * self.groups = OrderedDict() * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.variables); __Pyx_DECREF(__pyx_v_self->__pyx_base.variables); __pyx_v_self->__pyx_base.variables = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2577 * self.dimensions = OrderedDict() * self.variables = OrderedDict() * self.groups = OrderedDict() # <<<<<<<<<<<<<< * * def close(self): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.groups); __Pyx_DECREF(__pyx_v_self->__pyx_base.groups); __pyx_v_self->__pyx_base.groups = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":2529 * __pdoc__['Group.name']=\ * """A string describing the name of the `netCDF4.Group`.""" * def __init__(self, parent, name, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, parent, name)`** */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Group.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2579 * self.groups = OrderedDict() * * def close(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_5Group_2close[] = "\n**`close(self)`**\n\noverrides `netCDF4.Dataset` close method which does not apply to `netCDF4.Group`\ninstances, raises IOError."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_5Group_2close(((struct __pyx_obj_7netCDF4_8_netCDF4_Group *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_2close(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close", 0); /* "netCDF4/_netCDF4.pyx":2585 * overrides `netCDF4.Dataset` close method which does not apply to `netCDF4.Group` * instances, raises IOError.""" * raise IOError('cannot close a `netCDF4.Group` (only applies to Dataset)') # <<<<<<<<<<<<<< * * def _getname(self): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2579 * self.groups = OrderedDict() * * def close(self): # <<<<<<<<<<<<<< * """ * **`close(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Group.close", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2587 * raise IOError('cannot close a `netCDF4.Group` (only applies to Dataset)') * * def _getname(self): # <<<<<<<<<<<<<< * # private method to get name associated with instance. * cdef int err */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_5_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_5_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getname (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_5Group_4_getname(((struct __pyx_obj_7netCDF4_8_netCDF4_Group *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_4_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self) { char __pyx_v_namstring[(NC_MAX_NAME + 1)]; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getname", 0); /* "netCDF4/_netCDF4.pyx":2591 * cdef int err * cdef char namstring[NC_MAX_NAME+1] * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grpname(self._grpid, namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":2592 * cdef char namstring[NC_MAX_NAME+1] * with nogil: * ierr = nc_inq_grpname(self._grpid, namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_grpname(__pyx_v_self->__pyx_base._grpid, __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":2591 * cdef int err * cdef char namstring[NC_MAX_NAME+1] * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_grpname(self._grpid, namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":2593 * with nogil: * ierr = nc_inq_grpname(self._grpid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2594 * ierr = nc_inq_grpname(self._grpid, namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * return namstring.decode(default_encoding,unicode_error) * */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2593 * with nogil: * ierr = nc_inq_grpname(self._grpid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":2595 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2587 * raise IOError('cannot close a `netCDF4.Group` (only applies to Dataset)') * * def _getname(self): # <<<<<<<<<<<<<< * # private method to get name associated with instance. * cdef int err */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("netCDF4._netCDF4.Group._getname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2599 * property name: * """string name of Group instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_5Group_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_5Group_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Group *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_5Group_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":2600 * """string name of Group instance""" * def __get__(self): * return self._getname() # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("name cannot be altered") */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2599 * property name: * """string name of Group instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Group.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2601 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_5Group_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_5Group_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_5Group_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Group *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_5Group_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Group *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":2602 * return self._getname() * def __set__(self,value): * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2601 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Group.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2630 * `netCDF4.Variable` instance with `netCDF4.Dataset.createVariable`.""" * * def __init__(self, grp, name, size=None, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, group, name, size=None)`** */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_9Dimension___init__[] = "\n **`__init__(self, group, name, size=None)`**\n\n `netCDF4.Dimension` constructor.\n\n **`group`**: `netCDF4.Group` instance to associate with dimension.\n\n **`name`**: Name of the dimension.\n\n **`size`**: Size of the dimension. `None` or 0 means unlimited. (Default `None`).\n\n ***Note***: `netCDF4.Dimension` instances should be created using the\n `netCDF4.Dataset.createDimension` method of a `netCDF4.Group` or\n `netCDF4.Dataset` instance, not using `netCDF4.Dimension.__init__` directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_9Dimension___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grp = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grp,&__pyx_n_s_name,&__pyx_n_s_size,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_grp = values[0]; __pyx_v_name = values[1]; __pyx_v_size = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), __pyx_v_grp, __pyx_v_name, __pyx_v_size, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_name, PyObject *__pyx_v_size, PyObject *__pyx_v_kwargs) { int __pyx_v_ierr; char *__pyx_v_dimname; size_t __pyx_v_lendim; PyObject *__pyx_v_bytestr = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; char *__pyx_t_8; size_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "netCDF4/_netCDF4.pyx":2649 * cdef char *dimname * cdef size_t lendim * self._grpid = grp._grpid # <<<<<<<<<<<<<< * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2652 * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: # <<<<<<<<<<<<<< * self._grp = weakref.proxy(grp) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_keepweakref); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2653 * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: * self._grp = weakref.proxy(grp) # <<<<<<<<<<<<<< * else: * self._grp = grp */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_weakref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_proxy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_grp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_grp); __Pyx_GIVEREF(__pyx_v_grp); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_grp); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2652 * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: # <<<<<<<<<<<<<< * self._grp = weakref.proxy(grp) * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":2655 * self._grp = weakref.proxy(grp) * else: * self._grp = grp # <<<<<<<<<<<<<< * self._data_model = grp.data_model * self._name = name */ /*else*/ { __Pyx_INCREF(__pyx_v_grp); __Pyx_GIVEREF(__pyx_v_grp); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_v_grp; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":2656 * else: * self._grp = grp * self._data_model = grp.data_model # <<<<<<<<<<<<<< * self._name = name * if 'id' in kwargs: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2656; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_data_model); __Pyx_DECREF(__pyx_v_self->_data_model); __pyx_v_self->_data_model = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2657 * self._grp = grp * self._data_model = grp.data_model * self._name = name # <<<<<<<<<<<<<< * if 'id' in kwargs: * self._dimid = kwargs['id'] */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_name; /* "netCDF4/_netCDF4.pyx":2658 * self._data_model = grp.data_model * self._name = name * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._dimid = kwargs['id'] * else: */ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_id, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_t_3 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":2659 * self._name = name * if 'id' in kwargs: * self._dimid = kwargs['id'] # <<<<<<<<<<<<<< * else: * bytestr = _strencode(name) */ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_id); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->_dimid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2658 * self._data_model = grp.data_model * self._name = name * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._dimid = kwargs['id'] * else: */ goto __pyx_L4; } /* "netCDF4/_netCDF4.pyx":2661 * self._dimid = kwargs['id'] * else: * bytestr = _strencode(name) # <<<<<<<<<<<<<< * dimname = bytestr * if size is not None: */ /*else*/ { __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":2662 * else: * bytestr = _strencode(name) * dimname = bytestr # <<<<<<<<<<<<<< * if size is not None: * lendim = size */ __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_dimname = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":2663 * bytestr = _strencode(name) * dimname = bytestr * if size is not None: # <<<<<<<<<<<<<< * lendim = size * else: */ __pyx_t_7 = (__pyx_v_size != Py_None); __pyx_t_3 = (__pyx_t_7 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2664 * dimname = bytestr * if size is not None: * lendim = size # <<<<<<<<<<<<<< * else: * lendim = NC_UNLIMITED */ __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_lendim = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":2663 * bytestr = _strencode(name) * dimname = bytestr * if size is not None: # <<<<<<<<<<<<<< * lendim = size * else: */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":2666 * lendim = size * else: * lendim = NC_UNLIMITED # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._redef() * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) */ /*else*/ { __pyx_v_lendim = NC_UNLIMITED; } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":2667 * else: * lendim = NC_UNLIMITED * if grp.data_model != 'NETCDF4': grp._redef() # <<<<<<<<<<<<<< * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) * if grp.data_model != 'NETCDF4': grp._enddef() */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_redef); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2668 * lendim = NC_UNLIMITED * if grp.data_model != 'NETCDF4': grp._redef() * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_def_dim(__pyx_v_self->_grpid, __pyx_v_dimname, __pyx_v_lendim, (&__pyx_v_self->_dimid)); /* "netCDF4/_netCDF4.pyx":2669 * if grp.data_model != 'NETCDF4': grp._redef() * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":2670 * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) * if grp.data_model != 'NETCDF4': grp._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2671 * if grp.data_model != 'NETCDF4': grp._enddef() * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def _getname(self): */ __pyx_t_8 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2670 * ierr = nc_def_dim(self._grpid, dimname, lendim, &self._dimid) * if grp.data_model != 'NETCDF4': grp._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } } __pyx_L4:; /* "netCDF4/_netCDF4.pyx":2630 * `netCDF4.Variable` instance with `netCDF4.Dataset.createVariable`.""" * * def __init__(self, grp, name, size=None, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, group, name, size=None)`** */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2673 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def _getname(self): # <<<<<<<<<<<<<< * # private method to get name associated with instance. * cdef int err, _grpid */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_3_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_3_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getname (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_2_getname(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_2_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_v__grpid; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getname", 0); /* "netCDF4/_netCDF4.pyx":2677 * cdef int err, _grpid * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":2678 * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":2679 * _grpid = self._grp._grpid * with nogil: * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_dimname(__pyx_v__grpid, __pyx_v_self->_dimid, __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":2678 * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":2680 * with nogil: * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":2681 * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * return namstring.decode(default_encoding,unicode_error) * */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2680 * with nogil: * ierr = nc_inq_dimname(_grpid, self._dimid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":2682 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2673 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def _getname(self): # <<<<<<<<<<<<<< * # private method to get name associated with instance. * cdef int err, _grpid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension._getname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2686 * property name: * """string name of Dimension instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":2687 * """string name of Dimension instance""" * def __get__(self): * return self._getname() # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("name cannot be altered") */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2686 * property name: * """string name of Dimension instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2688 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":2689 * return self._getname() * def __set__(self,value): * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2688 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2693 * property size: * """current size of Dimension (calls `len` on Dimension instance)""" * def __get__(self): # <<<<<<<<<<<<<< * return len(self) * def __set__(self,value): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":2694 * """current size of Dimension (calls `len` on Dimension instance)""" * def __get__(self): * return len(self) # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("size cannot be altered") */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2693 * property size: * """current size of Dimension (calls `len` on Dimension instance)""" * def __get__(self): # <<<<<<<<<<<<<< * return len(self) * def __set__(self,value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2695 * def __get__(self): * return len(self) * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("size cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4size_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":2696 * return len(self) * def __set__(self,value): * raise AttributeError("size cannot be altered") # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2695 * def __get__(self): * return len(self) * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("size cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2698 * raise AttributeError("size cannot be altered") * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":2699 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2700 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2699 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":2702 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":2698 * raise AttributeError("size cannot be altered") * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2704 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * if not dir(self._grp): * return 'Dimension object no longer valid' */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_7__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_7__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":2705 * * def __unicode__(self): * if not dir(self._grp): # <<<<<<<<<<<<<< * return 'Dimension object no longer valid' * if self.isunlimited(): */ __pyx_t_1 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Dir(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":2706 * def __unicode__(self): * if not dir(self._grp): * return 'Dimension object no longer valid' # <<<<<<<<<<<<<< * if self.isunlimited(): * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self)) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_Dimension_object_no_longer_valid); __pyx_r = __pyx_kp_s_Dimension_object_no_longer_valid; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2705 * * def __unicode__(self): * if not dir(self._grp): # <<<<<<<<<<<<<< * return 'Dimension object no longer valid' * if self.isunlimited(): */ } /* "netCDF4/_netCDF4.pyx":2707 * if not dir(self._grp): * return 'Dimension object no longer valid' * if self.isunlimited(): # <<<<<<<<<<<<<< * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self)) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":2708 * return 'Dimension object no longer valid' * if self.isunlimited(): * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self)) # <<<<<<<<<<<<<< * else: * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_unlimited_name_s_size_s, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2707 * if not dir(self._grp): * return 'Dimension object no longer valid' * if self.isunlimited(): # <<<<<<<<<<<<<< * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self)) * else: */ } /* "netCDF4/_netCDF4.pyx":2710 * return repr(type(self))+" (unlimited): name = '%s', size = %s\n" % (self._name,len(self)) * else: * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self)) # <<<<<<<<<<<<<< * * def __len__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_name_s_size_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":2704 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * if not dir(self._grp): * return 'Dimension object no longer valid' */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2712 * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self)) * * def __len__(self): # <<<<<<<<<<<<<< * # len(`netCDF4.Dimension` instance) returns current size of dimension * cdef int ierr */ /* Python wrapper */ static Py_ssize_t __pyx_pw_7netCDF4_8_netCDF4_9Dimension_9__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_7netCDF4_8_netCDF4_9Dimension_9__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_8__len__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_7netCDF4_8_netCDF4_9Dimension_8__len__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_v_ierr; size_t __pyx_v_lengthp; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "netCDF4/_netCDF4.pyx":2716 * cdef int ierr * cdef size_t lengthp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":2717 * cdef size_t lengthp * with nogil: * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_dimlen(__pyx_v_self->_grpid, __pyx_v_self->_dimid, (&__pyx_v_lengthp)); } /* "netCDF4/_netCDF4.pyx":2716 * cdef int ierr * cdef size_t lengthp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":2718 * with nogil: * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return lengthp */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2719 * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * return lengthp * */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2718 * with nogil: * ierr = nc_inq_dimlen(self._grpid, self._dimid, &lengthp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return lengthp */ } /* "netCDF4/_netCDF4.pyx":2720 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return lengthp # <<<<<<<<<<<<<< * * def group(self): */ __pyx_r = __pyx_v_lengthp; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2712 * return repr(type(self))+": name = '%s', size = %s\n" % (self._name,len(self)) * * def __len__(self): # <<<<<<<<<<<<<< * # len(`netCDF4.Dimension` instance) returns current size of dimension * cdef int ierr */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2722 * return lengthp * * def group(self): # <<<<<<<<<<<<<< * """ * **`group(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_11group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_9Dimension_10group[] = "\n**`group(self)`**\n\nreturn the group that this `netCDF4.Dimension` is a member of."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_11group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_10group(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_10group(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group", 0); /* "netCDF4/_netCDF4.pyx":2727 * * return the group that this `netCDF4.Dimension` is a member of.""" * return self._grp # <<<<<<<<<<<<<< * * def isunlimited(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_grp); __pyx_r = __pyx_v_self->_grp; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2722 * return lengthp * * def group(self): # <<<<<<<<<<<<<< * """ * **`group(self)`** */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2729 * return self._grp * * def isunlimited(self): # <<<<<<<<<<<<<< * """ * **`isunlimited(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_13isunlimited(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_9Dimension_12isunlimited[] = "\n**`isunlimited(self)`**\n\nreturns `True` if the `netCDF4.Dimension` instance is unlimited, `False` otherwise."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_13isunlimited(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isunlimited (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_12isunlimited(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_12isunlimited(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_n; int __pyx_v_numunlimdims; int __pyx_v_ndims; int __pyx_v_nvars; int __pyx_v_ngatts; int __pyx_v_xdimid; int *__pyx_v_unlimdimids; int __pyx_v_dimid; PyObject *__pyx_v_unlimdim_ids = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isunlimited", 0); /* "netCDF4/_netCDF4.pyx":2736 * cdef int ierr, n, numunlimdims, ndims, nvars, ngatts, xdimid * cdef int *unlimdimids * if self._data_model == 'NETCDF4': # <<<<<<<<<<<<<< * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) * if ierr != NC_NOERR: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->_data_model, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2737 * cdef int *unlimdimids * if self._data_model == 'NETCDF4': * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_unlimdims(__pyx_v_self->_grpid, (&__pyx_v_numunlimdims), NULL); /* "netCDF4/_netCDF4.pyx":2738 * if self._data_model == 'NETCDF4': * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if numunlimdims == 0: */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2739 * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if numunlimdims == 0: * return False */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2738 * if self._data_model == 'NETCDF4': * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if numunlimdims == 0: */ } /* "netCDF4/_netCDF4.pyx":2740 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if numunlimdims == 0: # <<<<<<<<<<<<<< * return False * else: */ __pyx_t_1 = ((__pyx_v_numunlimdims == 0) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2741 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if numunlimdims == 0: * return False # <<<<<<<<<<<<<< * else: * unlimdimids = malloc(sizeof(int) * numunlimdims) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2740 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if numunlimdims == 0: # <<<<<<<<<<<<<< * return False * else: */ } /* "netCDF4/_netCDF4.pyx":2743 * return False * else: * unlimdimids = malloc(sizeof(int) * numunlimdims) # <<<<<<<<<<<<<< * dimid = self._dimid * with nogil: */ /*else*/ { __pyx_v_unlimdimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numunlimdims))); /* "netCDF4/_netCDF4.pyx":2744 * else: * unlimdimids = malloc(sizeof(int) * numunlimdims) * dimid = self._dimid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) */ __pyx_t_5 = __pyx_v_self->_dimid; __pyx_v_dimid = __pyx_t_5; /* "netCDF4/_netCDF4.pyx":2745 * unlimdimids = malloc(sizeof(int) * numunlimdims) * dimid = self._dimid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":2746 * dimid = self._dimid * with nogil: * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_unlimdims(__pyx_v_self->_grpid, (&__pyx_v_numunlimdims), __pyx_v_unlimdimids); } /* "netCDF4/_netCDF4.pyx":2745 * unlimdimids = malloc(sizeof(int) * numunlimdims) * dimid = self._dimid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "netCDF4/_netCDF4.pyx":2747 * with nogil: * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * unlimdim_ids = [] */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":2748 * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * unlimdim_ids = [] * for n from 0 <= n < numunlimdims: */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":2747 * with nogil: * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, unlimdimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * unlimdim_ids = [] */ } /* "netCDF4/_netCDF4.pyx":2749 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * unlimdim_ids = [] # <<<<<<<<<<<<<< * for n from 0 <= n < numunlimdims: * unlimdim_ids.append(unlimdimids[n]) */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_unlimdim_ids = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2750 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * unlimdim_ids = [] * for n from 0 <= n < numunlimdims: # <<<<<<<<<<<<<< * unlimdim_ids.append(unlimdimids[n]) * free(unlimdimids) */ __pyx_t_5 = __pyx_v_numunlimdims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_5; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":2751 * unlimdim_ids = [] * for n from 0 <= n < numunlimdims: * unlimdim_ids.append(unlimdimids[n]) # <<<<<<<<<<<<<< * free(unlimdimids) * if dimid in unlimdim_ids: */ __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_unlimdimids[__pyx_v_n])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_unlimdim_ids, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":2752 * for n from 0 <= n < numunlimdims: * unlimdim_ids.append(unlimdimids[n]) * free(unlimdimids) # <<<<<<<<<<<<<< * if dimid in unlimdim_ids: * return True */ free(__pyx_v_unlimdimids); /* "netCDF4/_netCDF4.pyx":2753 * unlimdim_ids.append(unlimdimids[n]) * free(unlimdimids) * if dimid in unlimdim_ids: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dimid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_v_unlimdim_ids, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (__pyx_t_1 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":2754 * free(unlimdimids) * if dimid in unlimdim_ids: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2753 * unlimdim_ids.append(unlimdimids[n]) * free(unlimdimids) * if dimid in unlimdim_ids: # <<<<<<<<<<<<<< * return True * else: */ } /* "netCDF4/_netCDF4.pyx":2756 * return True * else: * return False # <<<<<<<<<<<<<< * else: # if not NETCDF4, there is only one unlimited dimension. * # nc_inq_unlimdims only works for NETCDF4. */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } } /* "netCDF4/_netCDF4.pyx":2736 * cdef int ierr, n, numunlimdims, ndims, nvars, ngatts, xdimid * cdef int *unlimdimids * if self._data_model == 'NETCDF4': # <<<<<<<<<<<<<< * ierr = nc_inq_unlimdims(self._grpid, &numunlimdims, NULL) * if ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":2759 * else: # if not NETCDF4, there is only one unlimited dimension. * # nc_inq_unlimdims only works for NETCDF4. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) * if self._dimid == xdimid: */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":2760 * # nc_inq_unlimdims only works for NETCDF4. * with nogil: * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) # <<<<<<<<<<<<<< * if self._dimid == xdimid: * return True */ __pyx_v_ierr = nc_inq(__pyx_v_self->_grpid, (&__pyx_v_ndims), (&__pyx_v_nvars), (&__pyx_v_ngatts), (&__pyx_v_xdimid)); } /* "netCDF4/_netCDF4.pyx":2759 * else: # if not NETCDF4, there is only one unlimited dimension. * # nc_inq_unlimdims only works for NETCDF4. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) * if self._dimid == xdimid: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L15; } __pyx_L15:; } } /* "netCDF4/_netCDF4.pyx":2761 * with nogil: * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) * if self._dimid == xdimid: # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_7 = ((__pyx_v_self->_dimid == __pyx_v_xdimid) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":2762 * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) * if self._dimid == xdimid: * return True # <<<<<<<<<<<<<< * else: * return False */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":2761 * with nogil: * ierr = nc_inq(self._grpid, &ndims, &nvars, &ngatts, &xdimid) * if self._dimid == xdimid: # <<<<<<<<<<<<<< * return True * else: */ } /* "netCDF4/_netCDF4.pyx":2764 * return True * else: * return False # <<<<<<<<<<<<<< * * cdef class Variable: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } } /* "netCDF4/_netCDF4.pyx":2729 * return self._grp * * def isunlimited(self): # <<<<<<<<<<<<<< * """ * **`isunlimited(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension.isunlimited", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_unlimdim_ids); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2623 * `netCDF4.Dimension` instance). * """ * cdef public int _dimid, _grpid # <<<<<<<<<<<<<< * cdef public _data_model, _name, _grp * # Docstrings for class variables (used by pdoc). */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_dimid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension._dimid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_dimid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_dimid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_dimid = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dimension._dimid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Dimension._grpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_grpid = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Dimension._grpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2624 * """ * cdef public int _dimid, _grpid * cdef public _data_model, _name, _grp # <<<<<<<<<<<<<< * # Docstrings for class variables (used by pdoc). * __pdoc__['Dimension.name']=\ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_data_model); __pyx_r = __pyx_v_self->_data_model; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_data_model); __Pyx_DECREF(__pyx_v_self->_data_model); __pyx_v_self->_data_model = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_11_data_model_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_11_data_model_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_data_model); __Pyx_DECREF(__pyx_v_self->_data_model); __pyx_v_self->_data_model = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_name); __pyx_r = __pyx_v_self->_name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_5_name_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_5_name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_grp); __pyx_r = __pyx_v_self->_grp; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_9Dimension_4_grp_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_9Dimension_4_grp_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Dimension *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2859 * """The number of stored elements.""" * * def __init__(self, grp, name, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable___init__[] = "\n **`__init__(self, group, name, datatype, dimensions=(), zlib=False,\n complevel=4, shuffle=True, fletcher32=False, contiguous=False,\n chunksizes=None, endian='native',\n least_significant_digit=None,fill_value=None)`**\n\n `netCDF4.Variable` constructor.\n\n **`group`**: `netCDF4.Group` or `netCDF4.Dataset` instance to associate with variable.\n\n **`name`**: Name of the variable.\n\n **`datatype`**: `netCDF4.Variable` data type. Can be specified by providing a\n numpy dtype object, or a string that describes a numpy dtype object.\n Supported values, corresponding to `str` attribute of numpy dtype\n objects, include `'f4'` (32-bit floating point), `'f8'` (64-bit floating\n point), `'i4'` (32-bit signed integer), `'i2'` (16-bit signed integer),\n `'i8'` (64-bit singed integer), `'i4'` (8-bit singed integer), `'i1'`\n (8-bit signed integer), `'u1'` (8-bit unsigned integer), `'u2'` (16-bit\n unsigned integer), `'u4'` (32-bit unsigned integer), `'u8'` (64-bit\n unsigned integer), or `'S1'` (single-character string). From\n compatibility with Scientific.IO.NetCDF, the old Numeric single character\n typecodes can also be used (`'f'` instead of `'f4'`, `'d'` instead of\n `'f8'`, `'h'` or `'s'` instead of `'i2'`, `'b'` or `'B'` instead of\n `'i1'`, `'c'` instead of `'S1'`, and `'i'` or `'l'` instead of\n `'i4'`). `datatype` can also be a `netCDF4.CompoundType` instance\n (for a structured, or compound array), a `netCDF4.VLType` instance\n (for a variable-length array), or the python `str` builtin\n (for a variable-length string array). Numpy string and unicode datatypes with\n length greater than one are aliases for `str`.\n \n **`dimensions`**: a tuple containing the variable's dimension names\n (defined previously with `createDimension`). Default is an empty tuple\n w""hich means the variable is a scalar (and therefore has no dimensions).\n \n **`zlib`**: if `True`, data assigned to the `netCDF4.Variable`\n instance is compressed on disk. Default `False`.\n \n **`complevel`**: the level of zlib compression to use (1 is the fastest,\n but poorest compression, 9 is the slowest but best compression). Default 4.\n Ignored if `zlib=False`.\n \n **`shuffle`**: if `True`, the HDF5 shuffle filter is applied\n to improve compression. Default `True`. Ignored if `zlib=False`.\n \n **`fletcher32`**: if `True` (default `False`), the Fletcher32 checksum\n algorithm is used for error detection.\n \n **`contiguous`**: if `True` (default `False`), the variable data is\n stored contiguously on disk. Default `False`. Setting to `True` for\n a variable with an unlimited dimension will trigger an error.\n \n **`chunksizes`**: Can be used to specify the HDF5 chunksizes for each\n dimension of the variable. A detailed discussion of HDF chunking and I/O\n performance is available\n [here](http://www.hdfgroup.org/HDF5/doc/H5.user/Chunking.html).\n Basically, you want the chunk size for each dimension to match as\n closely as possible the size of the data block that users will read\n from the file. `chunksizes` cannot be set if `contiguous=True`.\n \n **`endian`**: Can be used to control whether the\n data is stored in little or big endian format on disk. Possible\n values are `little, big` or `native` (default). The library\n will automatically handle endian conversions when the data is read,\n but if the data is always going to be read on a computer with the\n opposite format as the one used to create the file, there may be\n some performance advantage to be gained by setting the endian-ness.\n For netCDF 3 files (that ""don't use HDF5), only `endian='native'` is allowed.\n \n The `zlib, complevel, shuffle, fletcher32, contiguous` and `chunksizes`\n keywords are silently ignored for netCDF 3 files that do not use HDF5.\n \n **`least_significant_digit`**: If specified, variable data will be\n truncated (quantized). In conjunction with `zlib=True` this produces\n 'lossy', but significantly more efficient compression. For example, if\n `least_significant_digit=1`, data will be quantized using\n around(scale*data)/scale, where scale = 2**bits, and bits is determined\n so that a precision of 0.1 is retained (in this case bits=4). Default is\n `None`, or no quantization.\n \n **`fill_value`**: If specified, the default netCDF `_FillValue` (the\n value that the variable gets filled with before any data is written to it)\n is replaced with this value. If fill_value is set to `False`, then\n the variable is not pre-filled. The default netCDF fill values can be found\n in `netCDF4.default_fillvals`.\n\n ***Note***: `netCDF4.Variable` instances should be created using the\n `netCDF4.Dataset.createVariable` method of a `netCDF4.Dataset` or\n `netCDF4.Group` instance, not using this class directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_8Variable___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grp = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_datatype = 0; PyObject *__pyx_v_dimensions = 0; PyObject *__pyx_v_zlib = 0; PyObject *__pyx_v_complevel = 0; PyObject *__pyx_v_shuffle = 0; PyObject *__pyx_v_fletcher32 = 0; PyObject *__pyx_v_contiguous = 0; PyObject *__pyx_v_chunksizes = 0; PyObject *__pyx_v_endian = 0; PyObject *__pyx_v_least_significant_digit = 0; PyObject *__pyx_v_fill_value = 0; PyObject *__pyx_v_chunk_cache = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grp,&__pyx_n_s_name,&__pyx_n_s_datatype,&__pyx_n_s_dimensions,&__pyx_n_s_zlib,&__pyx_n_s_complevel,&__pyx_n_s_shuffle,&__pyx_n_s_fletcher32,&__pyx_n_s_contiguous,&__pyx_n_s_chunksizes,&__pyx_n_s_endian,&__pyx_n_s_least_significant_digit,&__pyx_n_s_fill_value,&__pyx_n_s_chunk_cache,0}; PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0}; values[3] = ((PyObject *)__pyx_empty_tuple); values[4] = ((PyObject *)Py_False); values[5] = ((PyObject *)__pyx_int_4); /* "netCDF4/_netCDF4.pyx":2860 * * def __init__(self, grp, name, datatype, dimensions=(), zlib=False, * complevel=4, shuffle=True, fletcher32=False, contiguous=False, # <<<<<<<<<<<<<< * chunksizes=None, endian='native', least_significant_digit=None, * fill_value=None, chunk_cache=None, **kwargs): */ values[6] = ((PyObject *)Py_True); values[7] = ((PyObject *)Py_False); values[8] = ((PyObject *)Py_False); /* "netCDF4/_netCDF4.pyx":2861 * def __init__(self, grp, name, datatype, dimensions=(), zlib=False, * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, # <<<<<<<<<<<<<< * fill_value=None, chunk_cache=None, **kwargs): * """ */ values[9] = ((PyObject *)Py_None); values[10] = ((PyObject *)__pyx_n_s_native); values[11] = ((PyObject *)Py_None); /* "netCDF4/_netCDF4.pyx":2862 * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, * fill_value=None, chunk_cache=None, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(self, group, name, datatype, dimensions=(), zlib=False, */ values[12] = ((PyObject *)Py_None); values[13] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 14, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datatype)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 14, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimensions); if (value) { values[3] = value; kw_args--; } } case 4: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zlib); if (value) { values[4] = value; kw_args--; } } case 5: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_complevel); if (value) { values[5] = value; kw_args--; } } case 6: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shuffle); if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fletcher32); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_contiguous); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunksizes); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endian); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_least_significant_digit); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_value); if (value) { values[12] = value; kw_args--; } } case 13: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chunk_cache); if (value) { values[13] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12); case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11); case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10); case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_grp = values[0]; __pyx_v_name = values[1]; __pyx_v_datatype = values[2]; __pyx_v_dimensions = values[3]; __pyx_v_zlib = values[4]; __pyx_v_complevel = values[5]; __pyx_v_shuffle = values[6]; __pyx_v_fletcher32 = values[7]; __pyx_v_contiguous = values[8]; __pyx_v_chunksizes = values[9]; __pyx_v_endian = values[10]; __pyx_v_least_significant_digit = values[11]; __pyx_v_fill_value = values[12]; __pyx_v_chunk_cache = values[13]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 14, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_grp, __pyx_v_name, __pyx_v_datatype, __pyx_v_dimensions, __pyx_v_zlib, __pyx_v_complevel, __pyx_v_shuffle, __pyx_v_fletcher32, __pyx_v_contiguous, __pyx_v_chunksizes, __pyx_v_endian, __pyx_v_least_significant_digit, __pyx_v_fill_value, __pyx_v_chunk_cache, __pyx_v_kwargs); /* "netCDF4/_netCDF4.pyx":2859 * """The number of stored elements.""" * * def __init__(self, grp, name, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable___init__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_name, PyObject *__pyx_v_datatype, PyObject *__pyx_v_dimensions, PyObject *__pyx_v_zlib, PyObject *__pyx_v_complevel, PyObject *__pyx_v_shuffle, PyObject *__pyx_v_fletcher32, PyObject *__pyx_v_contiguous, PyObject *__pyx_v_chunksizes, PyObject *__pyx_v_endian, PyObject *__pyx_v_least_significant_digit, PyObject *__pyx_v_fill_value, PyObject *__pyx_v_chunk_cache, PyObject *__pyx_v_kwargs) { int __pyx_v_ierr; int __pyx_v_ndims; int __pyx_v_icontiguous; int __pyx_v_ideflate_level; int __pyx_v_numdims; char *__pyx_v_varname; nc_type __pyx_v_xtype; int *__pyx_v_dimids; size_t __pyx_v_sizep; size_t __pyx_v_nelemsp; size_t *__pyx_v_chunksizesp; float __pyx_v_preemptionp; PyObject *__pyx_v_user_type = NULL; PyObject *__pyx_v_dtype_endian = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_dims = NULL; long __pyx_v_n; PyObject *__pyx_v_dimname = NULL; PyObject *__pyx_v_dim = NULL; PyObject *__pyx_v_fillval = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; nc_type __pyx_t_9; char *__pyx_t_10; Py_ssize_t __pyx_t_11; int __pyx_t_12; int __pyx_t_13; size_t __pyx_t_14; Py_ssize_t __pyx_t_15; struct __pyx_opt_args_7netCDF4_8_netCDF4__set_att __pyx_t_16; PyObject *(*__pyx_t_17)(PyObject *); PyObject *__pyx_t_18 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_datatype); __Pyx_INCREF(__pyx_v_dimensions); __Pyx_INCREF(__pyx_v_zlib); /* "netCDF4/_netCDF4.pyx":2961 * cdef float preemptionp * # flag to indicate that orthogonal indexing is supported * self.__orthogonal_indexing__ = True # <<<<<<<<<<<<<< * # if complevel is set to zero, set zlib to False. * if not complevel: */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = Py_True; /* "netCDF4/_netCDF4.pyx":2963 * self.__orthogonal_indexing__ = True * # if complevel is set to zero, set zlib to False. * if not complevel: # <<<<<<<<<<<<<< * zlib = False * # if dimensions is a string, convert to a tuple */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_complevel); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2963; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2964 * # if complevel is set to zero, set zlib to False. * if not complevel: * zlib = False # <<<<<<<<<<<<<< * # if dimensions is a string, convert to a tuple * # this prevents a common error that occurs when */ __Pyx_INCREF(Py_False); __Pyx_DECREF_SET(__pyx_v_zlib, Py_False); /* "netCDF4/_netCDF4.pyx":2963 * self.__orthogonal_indexing__ = True * # if complevel is set to zero, set zlib to False. * if not complevel: # <<<<<<<<<<<<<< * zlib = False * # if dimensions is a string, convert to a tuple */ } /* "netCDF4/_netCDF4.pyx":2968 * # this prevents a common error that occurs when * # dimensions = 'lat' instead of ('lat',) * if type(dimensions) == str or type(dimensions) == bytes or type(dimensions) == unicode: # <<<<<<<<<<<<<< * dimensions = dimensions, * self._grpid = grp._grpid */ __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_dimensions)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_dimensions)), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_dimensions)), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2969 * # dimensions = 'lat' instead of ('lat',) * if type(dimensions) == str or type(dimensions) == bytes or type(dimensions) == unicode: * dimensions = dimensions, # <<<<<<<<<<<<<< * self._grpid = grp._grpid * # make a weakref to group to avoid circular ref (issue 218) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_dimensions); __Pyx_GIVEREF(__pyx_v_dimensions); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_dimensions); __Pyx_DECREF_SET(__pyx_v_dimensions, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2968 * # this prevents a common error that occurs when * # dimensions = 'lat' instead of ('lat',) * if type(dimensions) == str or type(dimensions) == bytes or type(dimensions) == unicode: # <<<<<<<<<<<<<< * dimensions = dimensions, * self._grpid = grp._grpid */ } /* "netCDF4/_netCDF4.pyx":2970 * if type(dimensions) == str or type(dimensions) == bytes or type(dimensions) == unicode: * dimensions = dimensions, * self._grpid = grp._grpid # <<<<<<<<<<<<<< * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_grpid = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":2973 * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: # <<<<<<<<<<<<<< * self._grp = weakref.proxy(grp) * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_keepweakref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2974 * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: * self._grp = weakref.proxy(grp) # <<<<<<<<<<<<<< * else: * self._grp = grp */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_weakref); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_proxy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_grp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_grp); __Pyx_GIVEREF(__pyx_v_grp); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_grp); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2973 * # make a weakref to group to avoid circular ref (issue 218) * # keep strong reference the default behaviour (issue 251) * if grp.keepweakref: # <<<<<<<<<<<<<< * self._grp = weakref.proxy(grp) * else: */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":2976 * self._grp = weakref.proxy(grp) * else: * self._grp = grp # <<<<<<<<<<<<<< * user_type = isinstance(datatype, CompoundType) or \ * isinstance(datatype, VLType) or \ */ /*else*/ { __Pyx_INCREF(__pyx_v_grp); __Pyx_GIVEREF(__pyx_v_grp); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_v_grp; } __pyx_L8:; /* "netCDF4/_netCDF4.pyx":2977 * else: * self._grp = grp * user_type = isinstance(datatype, CompoundType) or \ # <<<<<<<<<<<<<< * isinstance(datatype, VLType) or \ * isinstance(datatype, EnumType) or \ */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_CompoundType); if (!__pyx_t_2) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L9_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":2978 * self._grp = grp * user_type = isinstance(datatype, CompoundType) or \ * isinstance(datatype, VLType) or \ # <<<<<<<<<<<<<< * isinstance(datatype, EnumType) or \ * datatype == str */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_VLType); if (!__pyx_t_2) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L9_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":2979 * user_type = isinstance(datatype, CompoundType) or \ * isinstance(datatype, VLType) or \ * isinstance(datatype, EnumType) or \ # <<<<<<<<<<<<<< * datatype == str * # convert to a real numpy datatype object if necessary. */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_EnumType); if (!__pyx_t_2) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L9_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":2980 * isinstance(datatype, VLType) or \ * isinstance(datatype, EnumType) or \ * datatype == str # <<<<<<<<<<<<<< * # convert to a real numpy datatype object if necessary. * if not user_type and type(datatype) != numpy.dtype: */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_datatype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_L9_bool_binop_done:; __pyx_v_user_type = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2982 * datatype == str * # convert to a real numpy datatype object if necessary. * if not user_type and type(datatype) != numpy.dtype: # <<<<<<<<<<<<<< * datatype = numpy.dtype(datatype) * # convert numpy string dtype with length > 1 */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_user_type); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((!__pyx_t_1) != 0); if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L14_bool_binop_done; } __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_datatype)), __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_8; __pyx_L14_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2983 * # convert to a real numpy datatype object if necessary. * if not user_type and type(datatype) != numpy.dtype: * datatype = numpy.dtype(datatype) # <<<<<<<<<<<<<< * # convert numpy string dtype with length > 1 * # or any numpy unicode dtype into str */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_datatype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_datatype); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2982 * datatype == str * # convert to a real numpy datatype object if necessary. * if not user_type and type(datatype) != numpy.dtype: # <<<<<<<<<<<<<< * datatype = numpy.dtype(datatype) * # convert numpy string dtype with length > 1 */ } /* "netCDF4/_netCDF4.pyx":2986 * # convert numpy string dtype with length > 1 * # or any numpy unicode dtype into str * if (isinstance(datatype, numpy.dtype) and # <<<<<<<<<<<<<< * ((datatype.kind == 'S' and datatype.itemsize > 1) or * datatype.kind == 'U')): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = PyObject_IsInstance(__pyx_v_datatype, __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (__pyx_t_8 != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L17_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":2987 * # or any numpy unicode dtype into str * if (isinstance(datatype, numpy.dtype) and * ((datatype.kind == 'S' and datatype.itemsize > 1) or # <<<<<<<<<<<<<< * datatype.kind == 'U')): * datatype = str */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_1) { goto __pyx_L19_next_or; } else { } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L17_bool_binop_done; } __pyx_L19_next_or:; /* "netCDF4/_netCDF4.pyx":2988 * if (isinstance(datatype, numpy.dtype) and * ((datatype.kind == 'S' and datatype.itemsize > 1) or * datatype.kind == 'U')): # <<<<<<<<<<<<<< * datatype = str * user_type = True */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L17_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":2986 * # convert numpy string dtype with length > 1 * # or any numpy unicode dtype into str * if (isinstance(datatype, numpy.dtype) and # <<<<<<<<<<<<<< * ((datatype.kind == 'S' and datatype.itemsize > 1) or * datatype.kind == 'U')): */ if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2989 * ((datatype.kind == 'S' and datatype.itemsize > 1) or * datatype.kind == 'U')): * datatype = str # <<<<<<<<<<<<<< * user_type = True * # check if endian keyword consistent with datatype specification. */ __Pyx_INCREF(((PyObject *)(&PyString_Type))); __Pyx_DECREF_SET(__pyx_v_datatype, ((PyObject *)(&PyString_Type))); /* "netCDF4/_netCDF4.pyx":2990 * datatype.kind == 'U')): * datatype = str * user_type = True # <<<<<<<<<<<<<< * # check if endian keyword consistent with datatype specification. * dtype_endian = getattr(datatype,'byteorder',None) */ __Pyx_INCREF(Py_True); __Pyx_DECREF_SET(__pyx_v_user_type, Py_True); /* "netCDF4/_netCDF4.pyx":2986 * # convert numpy string dtype with length > 1 * # or any numpy unicode dtype into str * if (isinstance(datatype, numpy.dtype) and # <<<<<<<<<<<<<< * ((datatype.kind == 'S' and datatype.itemsize > 1) or * datatype.kind == 'U')): */ } /* "netCDF4/_netCDF4.pyx":2992 * user_type = True * # check if endian keyword consistent with datatype specification. * dtype_endian = getattr(datatype,'byteorder',None) # <<<<<<<<<<<<<< * if dtype_endian == '=': dtype_endian='native' * if dtype_endian == '>': dtype_endian='big' */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_datatype, __pyx_n_s_byteorder, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_dtype_endian = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":2993 * # check if endian keyword consistent with datatype specification. * dtype_endian = getattr(datatype,'byteorder',None) * if dtype_endian == '=': dtype_endian='native' # <<<<<<<<<<<<<< * if dtype_endian == '>': dtype_endian='big' * if dtype_endian == '<': dtype_endian='little' */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_dtype_endian, __pyx_kp_s__36, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_INCREF(__pyx_n_s_native); __Pyx_DECREF_SET(__pyx_v_dtype_endian, __pyx_n_s_native); } /* "netCDF4/_netCDF4.pyx":2994 * dtype_endian = getattr(datatype,'byteorder',None) * if dtype_endian == '=': dtype_endian='native' * if dtype_endian == '>': dtype_endian='big' # <<<<<<<<<<<<<< * if dtype_endian == '<': dtype_endian='little' * if dtype_endian == '|': dtype_endian=None */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_dtype_endian, __pyx_kp_s__15, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_INCREF(__pyx_n_s_big); __Pyx_DECREF_SET(__pyx_v_dtype_endian, __pyx_n_s_big); } /* "netCDF4/_netCDF4.pyx":2995 * if dtype_endian == '=': dtype_endian='native' * if dtype_endian == '>': dtype_endian='big' * if dtype_endian == '<': dtype_endian='little' # <<<<<<<<<<<<<< * if dtype_endian == '|': dtype_endian=None * if dtype_endian is not None and dtype_endian != endian: */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_dtype_endian, __pyx_kp_s__14, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_INCREF(__pyx_n_s_little); __Pyx_DECREF_SET(__pyx_v_dtype_endian, __pyx_n_s_little); } /* "netCDF4/_netCDF4.pyx":2996 * if dtype_endian == '>': dtype_endian='big' * if dtype_endian == '<': dtype_endian='little' * if dtype_endian == '|': dtype_endian=None # <<<<<<<<<<<<<< * if dtype_endian is not None and dtype_endian != endian: * if dtype_endian == 'native' and endian == sys.byteorder: */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_dtype_endian, __pyx_kp_s__37, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_dtype_endian, Py_None); } /* "netCDF4/_netCDF4.pyx":2997 * if dtype_endian == '<': dtype_endian='little' * if dtype_endian == '|': dtype_endian=None * if dtype_endian is not None and dtype_endian != endian: # <<<<<<<<<<<<<< * if dtype_endian == 'native' and endian == sys.byteorder: * pass */ __pyx_t_1 = (__pyx_v_dtype_endian != Py_None); __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L26_bool_binop_done; } __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype_endian, __pyx_v_endian, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_8; __pyx_L26_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":2998 * if dtype_endian == '|': dtype_endian=None * if dtype_endian is not None and dtype_endian != endian: * if dtype_endian == 'native' and endian == sys.byteorder: # <<<<<<<<<<<<<< * pass * else: */ __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_dtype_endian, __pyx_n_s_native, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L29_bool_binop_done; } __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_v_endian, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_8; __pyx_L29_bool_binop_done:; if (__pyx_t_2) { goto __pyx_L28; } /* "netCDF4/_netCDF4.pyx":3002 * else: * # endian keyword prevails, issue warning * msg = 'endian-ness of dtype and endian kwarg do not match, using endian kwarg' # <<<<<<<<<<<<<< * #msg = 'endian-ness of dtype and endian kwarg do not match, dtype over-riding endian kwarg' * warnings.warn(msg) */ /*else*/ { __Pyx_INCREF(__pyx_kp_s_endian_ness_of_dtype_and_endian); __pyx_v_msg = __pyx_kp_s_endian_ness_of_dtype_and_endian; /* "netCDF4/_netCDF4.pyx":3004 * msg = 'endian-ness of dtype and endian kwarg do not match, using endian kwarg' * #msg = 'endian-ness of dtype and endian kwarg do not match, dtype over-riding endian kwarg' * warnings.warn(msg) # <<<<<<<<<<<<<< * #endian = dtype_endian # dtype prevails * # check validity of datatype. */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_msg); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L28:; /* "netCDF4/_netCDF4.pyx":2997 * if dtype_endian == '<': dtype_endian='little' * if dtype_endian == '|': dtype_endian=None * if dtype_endian is not None and dtype_endian != endian: # <<<<<<<<<<<<<< * if dtype_endian == 'native' and endian == sys.byteorder: * pass */ } /* "netCDF4/_netCDF4.pyx":3007 * #endian = dtype_endian # dtype prevails * # check validity of datatype. * self._isprimitive = False # <<<<<<<<<<<<<< * self._iscompound = False * self._isvlen = False */ __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->_isprimitive); __Pyx_DECREF(__pyx_v_self->_isprimitive); __pyx_v_self->_isprimitive = Py_False; /* "netCDF4/_netCDF4.pyx":3008 * # check validity of datatype. * self._isprimitive = False * self._iscompound = False # <<<<<<<<<<<<<< * self._isvlen = False * self._isenum = False */ __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->_iscompound); __Pyx_DECREF(__pyx_v_self->_iscompound); __pyx_v_self->_iscompound = Py_False; /* "netCDF4/_netCDF4.pyx":3009 * self._isprimitive = False * self._iscompound = False * self._isvlen = False # <<<<<<<<<<<<<< * self._isenum = False * if user_type: */ __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->_isvlen); __Pyx_DECREF(__pyx_v_self->_isvlen); __pyx_v_self->_isvlen = Py_False; /* "netCDF4/_netCDF4.pyx":3010 * self._iscompound = False * self._isvlen = False * self._isenum = False # <<<<<<<<<<<<<< * if user_type: * if isinstance(datatype, CompoundType): */ __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->_isenum); __Pyx_DECREF(__pyx_v_self->_isenum); __pyx_v_self->_isenum = Py_False; /* "netCDF4/_netCDF4.pyx":3011 * self._isvlen = False * self._isenum = False * if user_type: # <<<<<<<<<<<<<< * if isinstance(datatype, CompoundType): * self._iscompound = True */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_user_type); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3012 * self._isenum = False * if user_type: * if isinstance(datatype, CompoundType): # <<<<<<<<<<<<<< * self._iscompound = True * self._cmptype = datatype */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_CompoundType); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3013 * if user_type: * if isinstance(datatype, CompoundType): * self._iscompound = True # <<<<<<<<<<<<<< * self._cmptype = datatype * if isinstance(datatype, VLType) or datatype==str: */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->_iscompound); __Pyx_DECREF(__pyx_v_self->_iscompound); __pyx_v_self->_iscompound = Py_True; /* "netCDF4/_netCDF4.pyx":3014 * if isinstance(datatype, CompoundType): * self._iscompound = True * self._cmptype = datatype # <<<<<<<<<<<<<< * if isinstance(datatype, VLType) or datatype==str: * self._isvlen = True */ __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); __Pyx_GOTREF(__pyx_v_self->_cmptype); __Pyx_DECREF(__pyx_v_self->_cmptype); __pyx_v_self->_cmptype = __pyx_v_datatype; /* "netCDF4/_netCDF4.pyx":3012 * self._isenum = False * if user_type: * if isinstance(datatype, CompoundType): # <<<<<<<<<<<<<< * self._iscompound = True * self._cmptype = datatype */ } /* "netCDF4/_netCDF4.pyx":3015 * self._iscompound = True * self._cmptype = datatype * if isinstance(datatype, VLType) or datatype==str: # <<<<<<<<<<<<<< * self._isvlen = True * self._vltype = datatype */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_VLType); __pyx_t_1 = (__pyx_t_2 != 0); if (!__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L34_bool_binop_done; } __pyx_t_3 = PyObject_RichCompare(__pyx_v_datatype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __pyx_t_1; __pyx_L34_bool_binop_done:; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3016 * self._cmptype = datatype * if isinstance(datatype, VLType) or datatype==str: * self._isvlen = True # <<<<<<<<<<<<<< * self._vltype = datatype * if isinstance(datatype, EnumType): */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->_isvlen); __Pyx_DECREF(__pyx_v_self->_isvlen); __pyx_v_self->_isvlen = Py_True; /* "netCDF4/_netCDF4.pyx":3017 * if isinstance(datatype, VLType) or datatype==str: * self._isvlen = True * self._vltype = datatype # <<<<<<<<<<<<<< * if isinstance(datatype, EnumType): * self._isenum = True */ __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); __Pyx_GOTREF(__pyx_v_self->_vltype); __Pyx_DECREF(__pyx_v_self->_vltype); __pyx_v_self->_vltype = __pyx_v_datatype; /* "netCDF4/_netCDF4.pyx":3015 * self._iscompound = True * self._cmptype = datatype * if isinstance(datatype, VLType) or datatype==str: # <<<<<<<<<<<<<< * self._isvlen = True * self._vltype = datatype */ } /* "netCDF4/_netCDF4.pyx":3018 * self._isvlen = True * self._vltype = datatype * if isinstance(datatype, EnumType): # <<<<<<<<<<<<<< * self._isenum = True * self._enumtype = datatype */ __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_datatype, __pyx_ptype_7netCDF4_8_netCDF4_EnumType); __pyx_t_1 = (__pyx_t_8 != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3019 * self._vltype = datatype * if isinstance(datatype, EnumType): * self._isenum = True # <<<<<<<<<<<<<< * self._enumtype = datatype * if datatype==str: */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->_isenum); __Pyx_DECREF(__pyx_v_self->_isenum); __pyx_v_self->_isenum = Py_True; /* "netCDF4/_netCDF4.pyx":3020 * if isinstance(datatype, EnumType): * self._isenum = True * self._enumtype = datatype # <<<<<<<<<<<<<< * if datatype==str: * if grp.data_model != 'NETCDF4': */ __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); __Pyx_GOTREF(__pyx_v_self->_enumtype); __Pyx_DECREF(__pyx_v_self->_enumtype); __pyx_v_self->_enumtype = __pyx_v_datatype; /* "netCDF4/_netCDF4.pyx":3018 * self._isvlen = True * self._vltype = datatype * if isinstance(datatype, EnumType): # <<<<<<<<<<<<<< * self._isenum = True * self._enumtype = datatype */ } /* "netCDF4/_netCDF4.pyx":3021 * self._isenum = True * self._enumtype = datatype * if datatype==str: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': * raise ValueError( */ __pyx_t_3 = PyObject_RichCompare(__pyx_v_datatype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3022 * self._enumtype = datatype * if datatype==str: * if grp.data_model != 'NETCDF4': # <<<<<<<<<<<<<< * raise ValueError( * 'Variable length strings are only supported for the ' */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3023 * if datatype==str: * if grp.data_model != 'NETCDF4': * raise ValueError( # <<<<<<<<<<<<<< * 'Variable length strings are only supported for the ' * 'NETCDF4 format. For other formats, consider using ' */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3022 * self._enumtype = datatype * if datatype==str: * if grp.data_model != 'NETCDF4': # <<<<<<<<<<<<<< * raise ValueError( * 'Variable length strings are only supported for the ' */ } /* "netCDF4/_netCDF4.pyx":3028 * 'netCDF4.stringtochar to convert string arrays into ' * 'character arrays with an additional dimension.') * datatype = VLType(self._grp, str, None) # <<<<<<<<<<<<<< * self._vltype = datatype * xtype = datatype._nc_type */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->_grp); __Pyx_GIVEREF(__pyx_v_self->_grp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_grp); __Pyx_INCREF(((PyObject *)(&PyString_Type))); __Pyx_GIVEREF(((PyObject *)(&PyString_Type))); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)(&PyString_Type))); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_VLType), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3029 * 'character arrays with an additional dimension.') * datatype = VLType(self._grp, str, None) * self._vltype = datatype # <<<<<<<<<<<<<< * xtype = datatype._nc_type * # dtype variable attribute is a numpy datatype object. */ __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); __Pyx_GOTREF(__pyx_v_self->_vltype); __Pyx_DECREF(__pyx_v_self->_vltype); __pyx_v_self->_vltype = __pyx_v_datatype; /* "netCDF4/_netCDF4.pyx":3021 * self._isenum = True * self._enumtype = datatype * if datatype==str: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': * raise ValueError( */ } /* "netCDF4/_netCDF4.pyx":3030 * datatype = VLType(self._grp, str, None) * self._vltype = datatype * xtype = datatype._nc_type # <<<<<<<<<<<<<< * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype.dtype */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_nc_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_As_nc_type(__pyx_t_5); if (unlikely((__pyx_t_9 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_xtype = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":3032 * xtype = datatype._nc_type * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype.dtype # <<<<<<<<<<<<<< * elif datatype.str[1:] in _supportedtypes: * self._isprimitive = True */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3011 * self._isvlen = False * self._isenum = False * if user_type: # <<<<<<<<<<<<<< * if isinstance(datatype, CompoundType): * self._iscompound = True */ goto __pyx_L31; } /* "netCDF4/_netCDF4.pyx":3033 * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype.dtype * elif datatype.str[1:] in _supportedtypes: # <<<<<<<<<<<<<< * self._isprimitive = True * # find netCDF primitive data type corresponding to */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__39, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3034 * self.dtype = datatype.dtype * elif datatype.str[1:] in _supportedtypes: * self._isprimitive = True # <<<<<<<<<<<<<< * # find netCDF primitive data type corresponding to * # specified numpy data type. */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->_isprimitive); __Pyx_DECREF(__pyx_v_self->_isprimitive); __pyx_v_self->_isprimitive = Py_True; /* "netCDF4/_netCDF4.pyx":3037 * # find netCDF primitive data type corresponding to * # specified numpy data type. * xtype = _nptonctype[datatype.str[1:]] # <<<<<<<<<<<<<< * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_3, 1, 0, NULL, NULL, &__pyx_slice__40, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyInt_As_nc_type(__pyx_t_3); if (unlikely((__pyx_t_9 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_xtype = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":3039 * xtype = _nptonctype[datatype.str[1:]] * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype # <<<<<<<<<<<<<< * else: * raise TypeError('illegal primitive data type, must be one of %s, got %s' % (_supportedtypes,datatype)) */ __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_datatype; /* "netCDF4/_netCDF4.pyx":3033 * # dtype variable attribute is a numpy datatype object. * self.dtype = datatype.dtype * elif datatype.str[1:] in _supportedtypes: # <<<<<<<<<<<<<< * self._isprimitive = True * # find netCDF primitive data type corresponding to */ goto __pyx_L31; } /* "netCDF4/_netCDF4.pyx":3041 * self.dtype = datatype * else: * raise TypeError('illegal primitive data type, must be one of %s, got %s' % (_supportedtypes,datatype)) # <<<<<<<<<<<<<< * if 'id' in kwargs: * self._varid = kwargs['id'] */ /*else*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_datatype); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_primitive_data_type_must, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L31:; /* "netCDF4/_netCDF4.pyx":3042 * else: * raise TypeError('illegal primitive data type, must be one of %s, got %s' % (_supportedtypes,datatype)) * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._varid = kwargs['id'] * else: */ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_id, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_8 != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3043 * raise TypeError('illegal primitive data type, must be one of %s, got %s' % (_supportedtypes,datatype)) * if 'id' in kwargs: * self._varid = kwargs['id'] # <<<<<<<<<<<<<< * else: * bytestr = _strencode(name) */ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_id); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->_varid = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":3042 * else: * raise TypeError('illegal primitive data type, must be one of %s, got %s' % (_supportedtypes,datatype)) * if 'id' in kwargs: # <<<<<<<<<<<<<< * self._varid = kwargs['id'] * else: */ goto __pyx_L39; } /* "netCDF4/_netCDF4.pyx":3045 * self._varid = kwargs['id'] * else: * bytestr = _strencode(name) # <<<<<<<<<<<<<< * varname = bytestr * ndims = len(dimensions) */ /*else*/ { __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_bytestr = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3046 * else: * bytestr = _strencode(name) * varname = bytestr # <<<<<<<<<<<<<< * ndims = len(dimensions) * # find dimension ids. */ __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_varname = __pyx_t_10; /* "netCDF4/_netCDF4.pyx":3047 * bytestr = _strencode(name) * varname = bytestr * ndims = len(dimensions) # <<<<<<<<<<<<<< * # find dimension ids. * if ndims: */ __pyx_t_11 = PyObject_Length(__pyx_v_dimensions); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ndims = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":3049 * ndims = len(dimensions) * # find dimension ids. * if ndims: # <<<<<<<<<<<<<< * dims = [] * dimids = malloc(sizeof(int) * ndims) */ __pyx_t_1 = (__pyx_v_ndims != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3050 * # find dimension ids. * if ndims: * dims = [] # <<<<<<<<<<<<<< * dimids = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_dims = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3051 * if ndims: * dims = [] * dimids = malloc(sizeof(int) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * dimname = dimensions[n] */ __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":3052 * dims = [] * dimids = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * dimname = dimensions[n] * # look for dimension in this group, and if not */ __pyx_t_4 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":3053 * dimids = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: * dimname = dimensions[n] # <<<<<<<<<<<<<< * # look for dimension in this group, and if not * # found there, look in parent (and it's parent, etc, back to root). */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_dimensions, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3056 * # look for dimension in this group, and if not * # found there, look in parent (and it's parent, etc, back to root). * dim = _find_dim(grp, dimname) # <<<<<<<<<<<<<< * if dim is None: * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_find_dim); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_11 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_grp); __Pyx_GIVEREF(__pyx_v_grp); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_v_grp); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_v_dimname); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3056; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3057 * # found there, look in parent (and it's parent, etc, back to root). * dim = _find_dim(grp, dimname) * if dim is None: # <<<<<<<<<<<<<< * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) * dimids[n] = dim._dimid */ __pyx_t_1 = (__pyx_v_dim == Py_None); __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3058 * dim = _find_dim(grp, dimname) * if dim is None: * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) # <<<<<<<<<<<<<< * dimids[n] = dim._dimid * dims.append(dim) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dimname); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_dimension_s_not_defined_in_group, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3057 * # found there, look in parent (and it's parent, etc, back to root). * dim = _find_dim(grp, dimname) * if dim is None: # <<<<<<<<<<<<<< * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) * dimids[n] = dim._dimid */ } /* "netCDF4/_netCDF4.pyx":3059 * if dim is None: * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) * dimids[n] = dim._dimid # <<<<<<<<<<<<<< * dims.append(dim) * # go into define mode if it's a netCDF 3 compatible */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_dimid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_dimids[__pyx_v_n]) = __pyx_t_12; /* "netCDF4/_netCDF4.pyx":3060 * raise KeyError("dimension %s not defined in group %s or any group in it's family tree" % (dimname, grp.path)) * dimids[n] = dim._dimid * dims.append(dim) # <<<<<<<<<<<<<< * # go into define mode if it's a netCDF 3 compatible * # file format. Be careful to exit define mode before */ __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_dims, __pyx_v_dim); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":3049 * ndims = len(dimensions) * # find dimension ids. * if ndims: # <<<<<<<<<<<<<< * dims = [] * dimids = malloc(sizeof(int) * ndims) */ } /* "netCDF4/_netCDF4.pyx":3064 * # file format. Be careful to exit define mode before * # any exceptions are raised. * if grp.data_model != 'NETCDF4': grp._redef() # <<<<<<<<<<<<<< * # define variable. * if ndims: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_redef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3066 * if grp.data_model != 'NETCDF4': grp._redef() * # define variable. * if ndims: # <<<<<<<<<<<<<< * ierr = nc_def_var(self._grpid, varname, xtype, ndims, * dimids, &self._varid) */ __pyx_t_8 = (__pyx_v_ndims != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3067 * # define variable. * if ndims: * ierr = nc_def_var(self._grpid, varname, xtype, ndims, # <<<<<<<<<<<<<< * dimids, &self._varid) * free(dimids) */ __pyx_v_ierr = nc_def_var(__pyx_v_self->_grpid, __pyx_v_varname, __pyx_v_xtype, __pyx_v_ndims, __pyx_v_dimids, (&__pyx_v_self->_varid)); /* "netCDF4/_netCDF4.pyx":3069 * ierr = nc_def_var(self._grpid, varname, xtype, ndims, * dimids, &self._varid) * free(dimids) # <<<<<<<<<<<<<< * else: # a scalar variable. * ierr = nc_def_var(self._grpid, varname, xtype, ndims, */ free(__pyx_v_dimids); /* "netCDF4/_netCDF4.pyx":3066 * if grp.data_model != 'NETCDF4': grp._redef() * # define variable. * if ndims: # <<<<<<<<<<<<<< * ierr = nc_def_var(self._grpid, varname, xtype, ndims, * dimids, &self._varid) */ goto __pyx_L45; } /* "netCDF4/_netCDF4.pyx":3071 * free(dimids) * else: # a scalar variable. * ierr = nc_def_var(self._grpid, varname, xtype, ndims, # <<<<<<<<<<<<<< * NULL, &self._varid) * # set chunk cache size if desired */ /*else*/ { /* "netCDF4/_netCDF4.pyx":3072 * else: # a scalar variable. * ierr = nc_def_var(self._grpid, varname, xtype, ndims, * NULL, &self._varid) # <<<<<<<<<<<<<< * # set chunk cache size if desired * # default is 1mb per var, can cause problems when many (1000's) */ __pyx_v_ierr = nc_def_var(__pyx_v_self->_grpid, __pyx_v_varname, __pyx_v_xtype, __pyx_v_ndims, NULL, (&__pyx_v_self->_varid)); } __pyx_L45:; /* "netCDF4/_netCDF4.pyx":3077 * # of vars are created. This change only lasts as long as file is * # open. * if grp.data_model.startswith('NETCDF4') and chunk_cache is not None: # <<<<<<<<<<<<<< * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3077; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L47_bool_binop_done; } __pyx_t_1 = (__pyx_v_chunk_cache != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); __pyx_t_8 = __pyx_t_2; __pyx_L47_bool_binop_done:; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3078 * # open. * if grp.data_model.startswith('NETCDF4') and chunk_cache is not None: * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, # <<<<<<<<<<<<<< * &nelemsp, &preemptionp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_get_var_chunk_cache(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_sizep), (&__pyx_v_nelemsp), (&__pyx_v_preemptionp)); /* "netCDF4/_netCDF4.pyx":3080 * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # reset chunk cache size, leave other parameters unchanged. */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3081 * &nelemsp, &preemptionp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # reset chunk cache size, leave other parameters unchanged. * sizep = chunk_cache */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3080 * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # reset chunk cache size, leave other parameters unchanged. */ } /* "netCDF4/_netCDF4.pyx":3083 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # reset chunk cache size, leave other parameters unchanged. * sizep = chunk_cache # <<<<<<<<<<<<<< * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) */ __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_v_chunk_cache); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sizep = __pyx_t_14; /* "netCDF4/_netCDF4.pyx":3084 * # reset chunk cache size, leave other parameters unchanged. * sizep = chunk_cache * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, # <<<<<<<<<<<<<< * nelemsp, preemptionp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_set_var_chunk_cache(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_sizep, __pyx_v_nelemsp, __pyx_v_preemptionp); /* "netCDF4/_netCDF4.pyx":3086 * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ierr != NC_NOERR: */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3087 * nelemsp, preemptionp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3086 * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":3077 * # of vars are created. This change only lasts as long as file is * # open. * if grp.data_model.startswith('NETCDF4') and chunk_cache is not None: # <<<<<<<<<<<<<< * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) */ } /* "netCDF4/_netCDF4.pyx":3088 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3089 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set zlib, shuffle, chunking, fletcher32 and endian */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3090 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # set zlib, shuffle, chunking, fletcher32 and endian * # variable settings. */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3090; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3088 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3097 * # and fletcher32 are silently ignored. Only * # endian='native' allowed for NETCDF3. * if grp.data_model in ['NETCDF4','NETCDF4_CLASSIC']: # <<<<<<<<<<<<<< * # set zlib and shuffle parameters. * if zlib and ndims: # don't bother for scalar variable */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { } else { __pyx_t_8 = __pyx_t_2; goto __pyx_L54_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4_CLASSIC, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3097; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __pyx_t_2; __pyx_L54_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_8 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3099 * if grp.data_model in ['NETCDF4','NETCDF4_CLASSIC']: * # set zlib and shuffle parameters. * if zlib and ndims: # don't bother for scalar variable # <<<<<<<<<<<<<< * ideflate_level = complevel * if shuffle: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_zlib); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L57_bool_binop_done; } __pyx_t_8 = (__pyx_v_ndims != 0); __pyx_t_2 = __pyx_t_8; __pyx_L57_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3100 * # set zlib and shuffle parameters. * if zlib and ndims: # don't bother for scalar variable * ideflate_level = complevel # <<<<<<<<<<<<<< * if shuffle: * ierr = nc_def_var_deflate(self._grpid, self._varid, 1, 1, ideflate_level) */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_complevel); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ideflate_level = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":3101 * if zlib and ndims: # don't bother for scalar variable * ideflate_level = complevel * if shuffle: # <<<<<<<<<<<<<< * ierr = nc_def_var_deflate(self._grpid, self._varid, 1, 1, ideflate_level) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_shuffle); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3102 * ideflate_level = complevel * if shuffle: * ierr = nc_def_var_deflate(self._grpid, self._varid, 1, 1, ideflate_level) # <<<<<<<<<<<<<< * else: * ierr = nc_def_var_deflate(self._grpid, self._varid, 0, 1, ideflate_level) */ __pyx_v_ierr = nc_def_var_deflate(__pyx_v_self->_grpid, __pyx_v_self->_varid, 1, 1, __pyx_v_ideflate_level); /* "netCDF4/_netCDF4.pyx":3101 * if zlib and ndims: # don't bother for scalar variable * ideflate_level = complevel * if shuffle: # <<<<<<<<<<<<<< * ierr = nc_def_var_deflate(self._grpid, self._varid, 1, 1, ideflate_level) * else: */ goto __pyx_L59; } /* "netCDF4/_netCDF4.pyx":3104 * ierr = nc_def_var_deflate(self._grpid, self._varid, 1, 1, ideflate_level) * else: * ierr = nc_def_var_deflate(self._grpid, self._varid, 0, 1, ideflate_level) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ /*else*/ { __pyx_v_ierr = nc_def_var_deflate(__pyx_v_self->_grpid, __pyx_v_self->_varid, 0, 1, __pyx_v_ideflate_level); } __pyx_L59:; /* "netCDF4/_netCDF4.pyx":3105 * else: * ierr = nc_def_var_deflate(self._grpid, self._varid, 0, 1, ideflate_level) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3106 * ierr = nc_def_var_deflate(self._grpid, self._varid, 0, 1, ideflate_level) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set checksum. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3107 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # set checksum. * if fletcher32 and ndims: # don't bother for scalar variable */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3105 * else: * ierr = nc_def_var_deflate(self._grpid, self._varid, 0, 1, ideflate_level) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3099 * if grp.data_model in ['NETCDF4','NETCDF4_CLASSIC']: * # set zlib and shuffle parameters. * if zlib and ndims: # don't bother for scalar variable # <<<<<<<<<<<<<< * ideflate_level = complevel * if shuffle: */ } /* "netCDF4/_netCDF4.pyx":3109 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set checksum. * if fletcher32 and ndims: # don't bother for scalar variable # <<<<<<<<<<<<<< * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) * if ierr != NC_NOERR: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_fletcher32); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L63_bool_binop_done; } __pyx_t_8 = (__pyx_v_ndims != 0); __pyx_t_2 = __pyx_t_8; __pyx_L63_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3110 * # set checksum. * if fletcher32 and ndims: # don't bother for scalar variable * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ __pyx_v_ierr = nc_def_var_fletcher32(__pyx_v_self->_grpid, __pyx_v_self->_varid, 1); /* "netCDF4/_netCDF4.pyx":3111 * if fletcher32 and ndims: # don't bother for scalar variable * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3112 * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set chunking stuff. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3113 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # set chunking stuff. * if ndims: # don't bother for scalar variable. */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3111 * if fletcher32 and ndims: # don't bother for scalar variable * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3109 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set checksum. * if fletcher32 and ndims: # don't bother for scalar variable # <<<<<<<<<<<<<< * ierr = nc_def_var_fletcher32(self._grpid, self._varid, 1) * if ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":3115 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set chunking stuff. * if ndims: # don't bother for scalar variable. # <<<<<<<<<<<<<< * if contiguous: * icontiguous = NC_CONTIGUOUS */ __pyx_t_2 = (__pyx_v_ndims != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3116 * # set chunking stuff. * if ndims: # don't bother for scalar variable. * if contiguous: # <<<<<<<<<<<<<< * icontiguous = NC_CONTIGUOUS * if chunksizes is not None: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_contiguous); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3117 * if ndims: # don't bother for scalar variable. * if contiguous: * icontiguous = NC_CONTIGUOUS # <<<<<<<<<<<<<< * if chunksizes is not None: * raise ValueError('cannot specify chunksizes for a contiguous dataset') */ __pyx_v_icontiguous = NC_CONTIGUOUS; /* "netCDF4/_netCDF4.pyx":3118 * if contiguous: * icontiguous = NC_CONTIGUOUS * if chunksizes is not None: # <<<<<<<<<<<<<< * raise ValueError('cannot specify chunksizes for a contiguous dataset') * else: */ __pyx_t_2 = (__pyx_v_chunksizes != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3119 * icontiguous = NC_CONTIGUOUS * if chunksizes is not None: * raise ValueError('cannot specify chunksizes for a contiguous dataset') # <<<<<<<<<<<<<< * else: * icontiguous = NC_CHUNKED */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3118 * if contiguous: * icontiguous = NC_CONTIGUOUS * if chunksizes is not None: # <<<<<<<<<<<<<< * raise ValueError('cannot specify chunksizes for a contiguous dataset') * else: */ } /* "netCDF4/_netCDF4.pyx":3116 * # set chunking stuff. * if ndims: # don't bother for scalar variable. * if contiguous: # <<<<<<<<<<<<<< * icontiguous = NC_CONTIGUOUS * if chunksizes is not None: */ goto __pyx_L68; } /* "netCDF4/_netCDF4.pyx":3121 * raise ValueError('cannot specify chunksizes for a contiguous dataset') * else: * icontiguous = NC_CHUNKED # <<<<<<<<<<<<<< * if chunksizes is None: * chunksizesp = NULL */ /*else*/ { __pyx_v_icontiguous = NC_CHUNKED; } __pyx_L68:; /* "netCDF4/_netCDF4.pyx":3122 * else: * icontiguous = NC_CHUNKED * if chunksizes is None: # <<<<<<<<<<<<<< * chunksizesp = NULL * else: */ __pyx_t_8 = (__pyx_v_chunksizes == Py_None); __pyx_t_2 = (__pyx_t_8 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3123 * icontiguous = NC_CHUNKED * if chunksizes is None: * chunksizesp = NULL # <<<<<<<<<<<<<< * else: * if len(chunksizes) != len(dimensions): */ __pyx_v_chunksizesp = NULL; /* "netCDF4/_netCDF4.pyx":3122 * else: * icontiguous = NC_CHUNKED * if chunksizes is None: # <<<<<<<<<<<<<< * chunksizesp = NULL * else: */ goto __pyx_L70; } /* "netCDF4/_netCDF4.pyx":3125 * chunksizesp = NULL * else: * if len(chunksizes) != len(dimensions): # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise ValueError('chunksizes must be a sequence with the same length as dimensions') */ /*else*/ { __pyx_t_11 = PyObject_Length(__pyx_v_chunksizes); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = PyObject_Length(__pyx_v_dimensions); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_11 != __pyx_t_15) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3126 * else: * if len(chunksizes) != len(dimensions): * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise ValueError('chunksizes must be a sequence with the same length as dimensions') * chunksizesp = malloc(sizeof(size_t) * ndims) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_7) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3127 * if len(chunksizes) != len(dimensions): * if grp.data_model != 'NETCDF4': grp._enddef() * raise ValueError('chunksizes must be a sequence with the same length as dimensions') # <<<<<<<<<<<<<< * chunksizesp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3125 * chunksizesp = NULL * else: * if len(chunksizes) != len(dimensions): # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise ValueError('chunksizes must be a sequence with the same length as dimensions') */ } /* "netCDF4/_netCDF4.pyx":3128 * if grp.data_model != 'NETCDF4': grp._enddef() * raise ValueError('chunksizes must be a sequence with the same length as dimensions') * chunksizesp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * if not dims[n].isunlimited() and \ */ __pyx_v_chunksizesp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":3129 * raise ValueError('chunksizes must be a sequence with the same length as dimensions') * chunksizesp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * if not dims[n].isunlimited() and \ * chunksizes[n] > dims[n].size: */ __pyx_t_4 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":3130 * chunksizesp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: * if not dims[n].isunlimited() and \ # <<<<<<<<<<<<<< * chunksizes[n] > dims[n].size: * msg = 'chunksize cannot exceed dimension size' */ if (unlikely(!__pyx_v_dims)) { __Pyx_RaiseUnboundLocalError("dims"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_dims, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = ((!__pyx_t_8) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L76_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":3131 * for n from 0 <= n < ndims: * if not dims[n].isunlimited() and \ * chunksizes[n] > dims[n].size: # <<<<<<<<<<<<<< * msg = 'chunksize cannot exceed dimension size' * raise ValueError(msg) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_chunksizes, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); if (unlikely(!__pyx_v_dims)) { __Pyx_RaiseUnboundLocalError("dims"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_dims, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __pyx_t_1; __pyx_L76_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3130 * chunksizesp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: * if not dims[n].isunlimited() and \ # <<<<<<<<<<<<<< * chunksizes[n] > dims[n].size: * msg = 'chunksize cannot exceed dimension size' */ if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3132 * if not dims[n].isunlimited() and \ * chunksizes[n] > dims[n].size: * msg = 'chunksize cannot exceed dimension size' # <<<<<<<<<<<<<< * raise ValueError(msg) * chunksizesp[n] = chunksizes[n] */ __Pyx_INCREF(__pyx_kp_s_chunksize_cannot_exceed_dimensio); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_kp_s_chunksize_cannot_exceed_dimensio); /* "netCDF4/_netCDF4.pyx":3133 * chunksizes[n] > dims[n].size: * msg = 'chunksize cannot exceed dimension size' * raise ValueError(msg) # <<<<<<<<<<<<<< * chunksizesp[n] = chunksizes[n] * if chunksizes is not None or contiguous: */ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_msg); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3130 * chunksizesp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: * if not dims[n].isunlimited() and \ # <<<<<<<<<<<<<< * chunksizes[n] > dims[n].size: * msg = 'chunksize cannot exceed dimension size' */ } /* "netCDF4/_netCDF4.pyx":3134 * msg = 'chunksize cannot exceed dimension size' * raise ValueError(msg) * chunksizesp[n] = chunksizes[n] # <<<<<<<<<<<<<< * if chunksizes is not None or contiguous: * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_chunksizes, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_14 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_chunksizesp[__pyx_v_n]) = __pyx_t_14; } } __pyx_L70:; /* "netCDF4/_netCDF4.pyx":3135 * raise ValueError(msg) * chunksizesp[n] = chunksizes[n] * if chunksizes is not None or contiguous: # <<<<<<<<<<<<<< * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) * free(chunksizesp) */ __pyx_t_1 = (__pyx_v_chunksizes != Py_None); __pyx_t_8 = (__pyx_t_1 != 0); if (!__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L79_bool_binop_done; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_contiguous); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_8; __pyx_L79_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3136 * chunksizesp[n] = chunksizes[n] * if chunksizes is not None or contiguous: * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) # <<<<<<<<<<<<<< * free(chunksizesp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_def_var_chunking(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_icontiguous, __pyx_v_chunksizesp); /* "netCDF4/_netCDF4.pyx":3137 * if chunksizes is not None or contiguous: * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) * free(chunksizesp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ free(__pyx_v_chunksizesp); /* "netCDF4/_netCDF4.pyx":3138 * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) * free(chunksizesp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3139 * free(chunksizesp) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set endian-ness of variable */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "netCDF4/_netCDF4.pyx":3140 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # set endian-ness of variable * if endian == 'little': */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3138 * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) * free(chunksizesp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3135 * raise ValueError(msg) * chunksizesp[n] = chunksizes[n] * if chunksizes is not None or contiguous: # <<<<<<<<<<<<<< * ierr = nc_def_var_chunking(self._grpid, self._varid, icontiguous, chunksizesp) * free(chunksizesp) */ } /* "netCDF4/_netCDF4.pyx":3115 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set chunking stuff. * if ndims: # don't bother for scalar variable. # <<<<<<<<<<<<<< * if contiguous: * icontiguous = NC_CONTIGUOUS */ } /* "netCDF4/_netCDF4.pyx":3142 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set endian-ness of variable * if endian == 'little': # <<<<<<<<<<<<<< * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) * elif endian == 'big': */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_endian, __pyx_n_s_little, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3143 * # set endian-ness of variable * if endian == 'little': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) # <<<<<<<<<<<<<< * elif endian == 'big': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_BIG) */ __pyx_v_ierr = nc_def_var_endian(__pyx_v_self->_grpid, __pyx_v_self->_varid, NC_ENDIAN_LITTLE); /* "netCDF4/_netCDF4.pyx":3142 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # set endian-ness of variable * if endian == 'little': # <<<<<<<<<<<<<< * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) * elif endian == 'big': */ goto __pyx_L83; } /* "netCDF4/_netCDF4.pyx":3144 * if endian == 'little': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) * elif endian == 'big': # <<<<<<<<<<<<<< * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_BIG) * elif endian == 'native': */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_endian, __pyx_n_s_big, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3145 * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) * elif endian == 'big': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_BIG) # <<<<<<<<<<<<<< * elif endian == 'native': * pass # this is the default format. */ __pyx_v_ierr = nc_def_var_endian(__pyx_v_self->_grpid, __pyx_v_self->_varid, NC_ENDIAN_BIG); /* "netCDF4/_netCDF4.pyx":3144 * if endian == 'little': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_LITTLE) * elif endian == 'big': # <<<<<<<<<<<<<< * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_BIG) * elif endian == 'native': */ goto __pyx_L83; } /* "netCDF4/_netCDF4.pyx":3146 * elif endian == 'big': * ierr = nc_def_var_endian(self._grpid, self._varid, NC_ENDIAN_BIG) * elif endian == 'native': # <<<<<<<<<<<<<< * pass # this is the default format. * else: */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_endian, __pyx_n_s_native, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { goto __pyx_L83; } /* "netCDF4/_netCDF4.pyx":3149 * pass # this is the default format. * else: * raise ValueError("'endian' keyword argument must be 'little','big' or 'native', got '%s'" % endian) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ /*else*/ { __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_endian_keyword_argument_must_be, __pyx_v_endian); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L83:; /* "netCDF4/_netCDF4.pyx":3150 * else: * raise ValueError("'endian' keyword argument must be 'little','big' or 'native', got '%s'" % endian) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3151 * raise ValueError("'endian' keyword argument must be 'little','big' or 'native', got '%s'" % endian) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_3) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "netCDF4/_netCDF4.pyx":3152 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * if endian != 'native': */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3150 * else: * raise ValueError("'endian' keyword argument must be 'little','big' or 'native', got '%s'" % endian) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3097 * # and fletcher32 are silently ignored. Only * # endian='native' allowed for NETCDF3. * if grp.data_model in ['NETCDF4','NETCDF4_CLASSIC']: # <<<<<<<<<<<<<< * # set zlib and shuffle parameters. * if zlib and ndims: # don't bother for scalar variable */ goto __pyx_L53; } /* "netCDF4/_netCDF4.pyx":3154 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * if endian != 'native': # <<<<<<<<<<<<<< * msg="only endian='native' allowed for NETCDF3 files" * raise RuntimeError(msg) */ /*else*/ { __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_endian, __pyx_n_s_native, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3155 * else: * if endian != 'native': * msg="only endian='native' allowed for NETCDF3 files" # <<<<<<<<<<<<<< * raise RuntimeError(msg) * # set a fill value for this variable if fill_value keyword */ __Pyx_INCREF(__pyx_kp_s_only_endian_native_allowed_for_N); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_kp_s_only_endian_native_allowed_for_N); /* "netCDF4/_netCDF4.pyx":3156 * if endian != 'native': * msg="only endian='native' allowed for NETCDF3 files" * raise RuntimeError(msg) # <<<<<<<<<<<<<< * # set a fill value for this variable if fill_value keyword * # given. This avoids the HDF5 overhead of deleting and */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3154 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * if endian != 'native': # <<<<<<<<<<<<<< * msg="only endian='native' allowed for NETCDF3 files" * raise RuntimeError(msg) */ } } __pyx_L53:; /* "netCDF4/_netCDF4.pyx":3160 * # given. This avoids the HDF5 overhead of deleting and * # recreating the dataset if it is set later (after the enddef). * if fill_value is not None: # <<<<<<<<<<<<<< * if not fill_value and isinstance(fill_value,bool): * # no filling for this variable if fill_value==False. */ __pyx_t_2 = (__pyx_v_fill_value != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3161 * # recreating the dataset if it is set later (after the enddef). * if fill_value is not None: * if not fill_value and isinstance(fill_value,bool): # <<<<<<<<<<<<<< * # no filling for this variable if fill_value==False. * if not self._isprimitive: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fill_value); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L89_bool_binop_done; } __pyx_t_7 = ((PyObject*)&PyBool_Type); __Pyx_INCREF(__pyx_t_7); __pyx_t_1 = PyObject_IsInstance(__pyx_v_fill_value, __pyx_t_7); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = (__pyx_t_1 != 0); __pyx_t_8 = __pyx_t_2; __pyx_L89_bool_binop_done:; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3163 * if not fill_value and isinstance(fill_value,bool): * # no filling for this variable if fill_value==False. * if not self._isprimitive: # <<<<<<<<<<<<<< * # no fill values for VLEN and compound variables * # anyway. */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_8) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3166 * # no fill values for VLEN and compound variables * # anyway. * ierr = 0 # <<<<<<<<<<<<<< * else: * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL) */ __pyx_v_ierr = 0; /* "netCDF4/_netCDF4.pyx":3163 * if not fill_value and isinstance(fill_value,bool): * # no filling for this variable if fill_value==False. * if not self._isprimitive: # <<<<<<<<<<<<<< * # no fill values for VLEN and compound variables * # anyway. */ goto __pyx_L91; } /* "netCDF4/_netCDF4.pyx":3168 * ierr = 0 * else: * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() */ /*else*/ { __pyx_v_ierr = nc_def_var_fill(__pyx_v_self->_grpid, __pyx_v_self->_varid, 1, NULL); } __pyx_L91:; /* "netCDF4/_netCDF4.pyx":3169 * else: * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3170 * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL) * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_3) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "netCDF4/_netCDF4.pyx":3171 * if ierr != NC_NOERR: * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * # cast fill_value to type of variable. */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3169 * else: * ierr = nc_def_var_fill(self._grpid, self._varid, 1, NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * if grp.data_model != 'NETCDF4': grp._enddef() * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ } /* "netCDF4/_netCDF4.pyx":3161 * # recreating the dataset if it is set later (after the enddef). * if fill_value is not None: * if not fill_value and isinstance(fill_value,bool): # <<<<<<<<<<<<<< * # no filling for this variable if fill_value==False. * if not self._isprimitive: */ goto __pyx_L88; } /* "netCDF4/_netCDF4.pyx":3174 * else: * # cast fill_value to type of variable. * if self._isprimitive or self._isenum: # <<<<<<<<<<<<<< * fillval = numpy.array(fill_value, self.dtype) * _set_att(self._grp, self._varid, '_FillValue',\ */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L95_bool_binop_done; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_8; __pyx_L95_bool_binop_done:; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3175 * # cast fill_value to type of variable. * if self._isprimitive or self._isenum: * fillval = numpy.array(fill_value, self.dtype) # <<<<<<<<<<<<<< * _set_att(self._grp, self._varid, '_FillValue',\ * fillval, xtype=xtype) */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_15 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_15 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_fill_value); __Pyx_GIVEREF(__pyx_v_fill_value); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_15, __pyx_v_fill_value); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_15, __pyx_v_self->dtype); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_fillval = __pyx_t_7; __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3176 * if self._isprimitive or self._isenum: * fillval = numpy.array(fill_value, self.dtype) * _set_att(self._grp, self._varid, '_FillValue',\ # <<<<<<<<<<<<<< * fillval, xtype=xtype) * else: */ __pyx_t_7 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":3177 * fillval = numpy.array(fill_value, self.dtype) * _set_att(self._grp, self._varid, '_FillValue',\ * fillval, xtype=xtype) # <<<<<<<<<<<<<< * else: * raise AttributeError("cannot set _FillValue attribute for VLEN or compound variable") */ __pyx_t_16.__pyx_n = 1; __pyx_t_16.xtype = __pyx_v_xtype; __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__set_att(__pyx_t_7, __pyx_v_self->_varid, __pyx_n_s_FillValue, __pyx_v_fillval, &__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3174 * else: * # cast fill_value to type of variable. * if self._isprimitive or self._isenum: # <<<<<<<<<<<<<< * fillval = numpy.array(fill_value, self.dtype) * _set_att(self._grp, self._varid, '_FillValue',\ */ goto __pyx_L94; } /* "netCDF4/_netCDF4.pyx":3179 * fillval, xtype=xtype) * else: * raise AttributeError("cannot set _FillValue attribute for VLEN or compound variable") # <<<<<<<<<<<<<< * if least_significant_digit is not None: * self.least_significant_digit = least_significant_digit */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L94:; } __pyx_L88:; /* "netCDF4/_netCDF4.pyx":3160 * # given. This avoids the HDF5 overhead of deleting and * # recreating the dataset if it is set later (after the enddef). * if fill_value is not None: # <<<<<<<<<<<<<< * if not fill_value and isinstance(fill_value,bool): * # no filling for this variable if fill_value==False. */ } /* "netCDF4/_netCDF4.pyx":3180 * else: * raise AttributeError("cannot set _FillValue attribute for VLEN or compound variable") * if least_significant_digit is not None: # <<<<<<<<<<<<<< * self.least_significant_digit = least_significant_digit * # leave define mode if not a NETCDF4 format file. */ __pyx_t_2 = (__pyx_v_least_significant_digit != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3181 * raise AttributeError("cannot set _FillValue attribute for VLEN or compound variable") * if least_significant_digit is not None: * self.least_significant_digit = least_significant_digit # <<<<<<<<<<<<<< * # leave define mode if not a NETCDF4 format file. * if grp.data_model != 'NETCDF4': grp._enddef() */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_least_significant_digit, __pyx_v_least_significant_digit) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3180 * else: * raise AttributeError("cannot set _FillValue attribute for VLEN or compound variable") * if least_significant_digit is not None: # <<<<<<<<<<<<<< * self.least_significant_digit = least_significant_digit * # leave define mode if not a NETCDF4 format file. */ } /* "netCDF4/_netCDF4.pyx":3183 * self.least_significant_digit = least_significant_digit * # leave define mode if not a NETCDF4 format file. * if grp.data_model != 'NETCDF4': grp._enddef() # <<<<<<<<<<<<<< * # count how many unlimited dimensions there are. * self._nunlimdim = 0 */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_5) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __pyx_L39:; /* "netCDF4/_netCDF4.pyx":3185 * if grp.data_model != 'NETCDF4': grp._enddef() * # count how many unlimited dimensions there are. * self._nunlimdim = 0 # <<<<<<<<<<<<<< * for dimname in dimensions: * # look in current group, and parents for dim. */ __pyx_v_self->_nunlimdim = 0; /* "netCDF4/_netCDF4.pyx":3186 * # count how many unlimited dimensions there are. * self._nunlimdim = 0 * for dimname in dimensions: # <<<<<<<<<<<<<< * # look in current group, and parents for dim. * dim = _find_dim(self._grp, dimname) */ if (likely(PyList_CheckExact(__pyx_v_dimensions)) || PyTuple_CheckExact(__pyx_v_dimensions)) { __pyx_t_3 = __pyx_v_dimensions; __Pyx_INCREF(__pyx_t_3); __pyx_t_15 = 0; __pyx_t_17 = NULL; } else { __pyx_t_15 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dimensions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_17)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_7); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_15); __Pyx_INCREF(__pyx_t_7); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_17(__pyx_t_3); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3188 * for dimname in dimensions: * # look in current group, and parents for dim. * dim = _find_dim(self._grp, dimname) # <<<<<<<<<<<<<< * if dim.isunlimited(): self._nunlimdim = self._nunlimdim + 1 * # set ndim attribute (number of dimensions). */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_find_dim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_11 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_11 = 1; } } __pyx_t_18 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_self->_grp); __Pyx_GIVEREF(__pyx_v_self->_grp); PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_11, __pyx_v_self->_grp); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_11, __pyx_v_dimname); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_18, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3189 * # look in current group, and parents for dim. * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): self._nunlimdim = self._nunlimdim + 1 # <<<<<<<<<<<<<< * # set ndim attribute (number of dimensions). * with nogil: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_18 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_18)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_18); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_18) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_18); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_8) { __pyx_v_self->_nunlimdim = (__pyx_v_self->_nunlimdim + 1); } /* "netCDF4/_netCDF4.pyx":3186 * # count how many unlimited dimensions there are. * self._nunlimdim = 0 * for dimname in dimensions: # <<<<<<<<<<<<<< * # look in current group, and parents for dim. * dim = _find_dim(self._grp, dimname) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3191 * if dim.isunlimited(): self._nunlimdim = self._nunlimdim + 1 * # set ndim attribute (number of dimensions). * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3192 * # set ndim attribute (number of dimensions). * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varndims(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_numdims)); } /* "netCDF4/_netCDF4.pyx":3191 * if dim.isunlimited(): self._nunlimdim = self._nunlimdim + 1 * # set ndim attribute (number of dimensions). * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L104; } __pyx_L104:; } } /* "netCDF4/_netCDF4.pyx":3193 * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.ndim = numdims */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3194 * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * self.ndim = numdims * self._name = name */ __pyx_t_10 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_10, 0, strlen(__pyx_t_10), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3193 * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.ndim = numdims */ } /* "netCDF4/_netCDF4.pyx":3195 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.ndim = numdims # <<<<<<<<<<<<<< * self._name = name * # default for automatically applying scale_factor and */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_numdims); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->ndim); __Pyx_DECREF(__pyx_v_self->ndim); __pyx_v_self->ndim = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3196 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * self.ndim = numdims * self._name = name # <<<<<<<<<<<<<< * # default for automatically applying scale_factor and * # add_offset, and converting to/from masked arrays is True. */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_name; /* "netCDF4/_netCDF4.pyx":3199 * # default for automatically applying scale_factor and * # add_offset, and converting to/from masked arrays is True. * self.scale = True # <<<<<<<<<<<<<< * self.mask = True * */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_True; /* "netCDF4/_netCDF4.pyx":3200 * # add_offset, and converting to/from masked arrays is True. * self.scale = True * self.mask = True # <<<<<<<<<<<<<< * * def __array__(self): */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_True; /* "netCDF4/_netCDF4.pyx":2859 * """The number of stored elements.""" * * def __init__(self, grp, name, datatype, dimensions=(), zlib=False, # <<<<<<<<<<<<<< * complevel=4, shuffle=True, fletcher32=False, contiguous=False, * chunksizes=None, endian='native', least_significant_digit=None, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_18); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_user_type); __Pyx_XDECREF(__pyx_v_dtype_endian); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_dims); __Pyx_XDECREF(__pyx_v_dimname); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XDECREF(__pyx_v_fillval); __Pyx_XDECREF(__pyx_v_datatype); __Pyx_XDECREF(__pyx_v_dimensions); __Pyx_XDECREF(__pyx_v_zlib); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3202 * self.mask = True * * def __array__(self): # <<<<<<<<<<<<<< * # numpy special method that returns a numpy array. * # allows numpy ufuncs to work faster on Variable objects */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_3__array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_3__array__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__array__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_2__array__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_2__array__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__array__", 0); /* "netCDF4/_netCDF4.pyx":3206 * # allows numpy ufuncs to work faster on Variable objects * # (issue 216). * return self[...] # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), Py_Ellipsis); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3202 * self.mask = True * * def __array__(self): # <<<<<<<<<<<<<< * # numpy special method that returns a numpy array. * # allows numpy ufuncs to work faster on Variable objects */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3208 * return self[...] * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":3209 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3210 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3209 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":3212 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3208 * return self[...] * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3214 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * cdef int ierr, no_fill * if not dir(self._grp): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_6__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_no_fill; PyObject *__pyx_v_ncdump_var = NULL; PyObject *__pyx_v_dimnames = NULL; PyObject *__pyx_v_attrs = NULL; PyObject *__pyx_v_unlimdims = NULL; PyObject *__pyx_v_dimname = NULL; PyObject *__pyx_v_dim = NULL; PyObject *__pyx_v_fillval = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; Py_ssize_t __pyx_t_12; char *__pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":3216 * def __unicode__(self): * cdef int ierr, no_fill * if not dir(self._grp): # <<<<<<<<<<<<<< * return 'Variable object no longer valid' * ncdump_var = ['%r\n' % type(self)] */ __pyx_t_1 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Dir(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3217 * cdef int ierr, no_fill * if not dir(self._grp): * return 'Variable object no longer valid' # <<<<<<<<<<<<<< * ncdump_var = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_Variable_object_no_longer_valid); __pyx_r = __pyx_kp_s_Variable_object_no_longer_valid; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3216 * def __unicode__(self): * cdef int ierr, no_fill * if not dir(self._grp): # <<<<<<<<<<<<<< * return 'Variable object no longer valid' * ncdump_var = ['%r\n' % type(self)] */ } /* "netCDF4/_netCDF4.pyx":3218 * if not dir(self._grp): * return 'Variable object no longer valid' * ncdump_var = ['%r\n' % type(self)] # <<<<<<<<<<<<<< * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ */ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_r_3, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_v_ncdump_var = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3219 * return 'Variable object no longer valid' * ncdump_var = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) # <<<<<<<<<<<<<< * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_tostr); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_dimname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_dimname); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dimnames = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3220 * ncdump_var = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ # <<<<<<<<<<<<<< * self.ncattrs()] * if self._iscompound: */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); /* "netCDF4/_netCDF4.pyx":3221 * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] # <<<<<<<<<<<<<< * if self._iscompound: * ncdump_var.append('%s %s(%s)\n' %\ */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3220 * ncdump_var = ['%r\n' % type(self)] * dimnames = tuple([_tostr(dimname) for dimname in self.dimensions]) * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ # <<<<<<<<<<<<<< * self.ncattrs()] * if self._iscompound: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getncattr); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_name); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_attrs = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3222 * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] * if self._iscompound: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('compound',self._name,', '.join(dimnames))) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_iscompound); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3224 * if self._iscompound: * ncdump_var.append('%s %s(%s)\n' %\ * ('compound',self._name,', '.join(dimnames))) # <<<<<<<<<<<<<< * elif self._isvlen: * ncdump_var.append('%s %s(%s)\n' %\ */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_compound); __Pyx_GIVEREF(__pyx_n_s_compound); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_compound); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3223 * self.ncattrs()] * if self._iscompound: * ncdump_var.append('%s %s(%s)\n' %\ # <<<<<<<<<<<<<< * ('compound',self._name,', '.join(dimnames))) * elif self._isvlen: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3222 * attrs = [' %s: %s\n' % (name,self.getncattr(name)) for name in\ * self.ncattrs()] * if self._iscompound: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('compound',self._name,', '.join(dimnames))) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":3225 * ncdump_var.append('%s %s(%s)\n' %\ * ('compound',self._name,', '.join(dimnames))) * elif self._isvlen: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('vlen',self._name,', '.join(dimnames))) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3227 * elif self._isvlen: * ncdump_var.append('%s %s(%s)\n' %\ * ('vlen',self._name,', '.join(dimnames))) # <<<<<<<<<<<<<< * elif self._isenum: * ncdump_var.append('%s %s(%s)\n' %\ */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_vlen); __Pyx_GIVEREF(__pyx_n_s_vlen); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_vlen); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3226 * ('compound',self._name,', '.join(dimnames))) * elif self._isvlen: * ncdump_var.append('%s %s(%s)\n' %\ # <<<<<<<<<<<<<< * ('vlen',self._name,', '.join(dimnames))) * elif self._isenum: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3225 * ncdump_var.append('%s %s(%s)\n' %\ * ('compound',self._name,', '.join(dimnames))) * elif self._isvlen: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('vlen',self._name,', '.join(dimnames))) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":3228 * ncdump_var.append('%s %s(%s)\n' %\ * ('vlen',self._name,', '.join(dimnames))) * elif self._isenum: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('enum',self._name,', '.join(dimnames))) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3230 * elif self._isenum: * ncdump_var.append('%s %s(%s)\n' %\ * ('enum',self._name,', '.join(dimnames))) # <<<<<<<<<<<<<< * else: * ncdump_var.append('%s %s(%s)\n' %\ */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_enum); __Pyx_GIVEREF(__pyx_n_s_enum); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_enum); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3229 * ('vlen',self._name,', '.join(dimnames))) * elif self._isenum: * ncdump_var.append('%s %s(%s)\n' %\ # <<<<<<<<<<<<<< * ('enum',self._name,', '.join(dimnames))) * else: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3228 * ncdump_var.append('%s %s(%s)\n' %\ * ('vlen',self._name,', '.join(dimnames))) * elif self._isenum: # <<<<<<<<<<<<<< * ncdump_var.append('%s %s(%s)\n' %\ * ('enum',self._name,', '.join(dimnames))) */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":3232 * ('enum',self._name,', '.join(dimnames))) * else: * ncdump_var.append('%s %s(%s)\n' %\ # <<<<<<<<<<<<<< * (self.dtype,self._name,', '.join(dimnames))) * ncdump_var = ncdump_var + attrs */ /*else*/ { /* "netCDF4/_netCDF4.pyx":3233 * else: * ncdump_var.append('%s %s(%s)\n' %\ * (self.dtype,self._name,', '.join(dimnames))) # <<<<<<<<<<<<<< * ncdump_var = ncdump_var + attrs * if self._iscompound: */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_dimnames); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->dtype); __Pyx_INCREF(__pyx_v_self->_name); __Pyx_GIVEREF(__pyx_v_self->_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_name); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3232 * ('enum',self._name,', '.join(dimnames))) * else: * ncdump_var.append('%s %s(%s)\n' %\ # <<<<<<<<<<<<<< * (self.dtype,self._name,', '.join(dimnames))) * ncdump_var = ncdump_var + attrs */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L8:; /* "netCDF4/_netCDF4.pyx":3234 * ncdump_var.append('%s %s(%s)\n' %\ * (self.dtype,self._name,', '.join(dimnames))) * ncdump_var = ncdump_var + attrs # <<<<<<<<<<<<<< * if self._iscompound: * ncdump_var.append('compound data type: %s\n' % self.dtype) */ __pyx_t_5 = PyNumber_Add(__pyx_v_ncdump_var, __pyx_v_attrs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ncdump_var, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3235 * (self.dtype,self._name,', '.join(dimnames))) * ncdump_var = ncdump_var + attrs * if self._iscompound: # <<<<<<<<<<<<<< * ncdump_var.append('compound data type: %s\n' % self.dtype) * elif self._isvlen: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_iscompound); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3236 * ncdump_var = ncdump_var + attrs * if self._iscompound: * ncdump_var.append('compound data type: %s\n' % self.dtype) # <<<<<<<<<<<<<< * elif self._isvlen: * ncdump_var.append('vlen data type: %s\n' % self.dtype) */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_compound_data_type_s, __pyx_v_self->dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3235 * (self.dtype,self._name,', '.join(dimnames))) * ncdump_var = ncdump_var + attrs * if self._iscompound: # <<<<<<<<<<<<<< * ncdump_var.append('compound data type: %s\n' % self.dtype) * elif self._isvlen: */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":3237 * if self._iscompound: * ncdump_var.append('compound data type: %s\n' % self.dtype) * elif self._isvlen: # <<<<<<<<<<<<<< * ncdump_var.append('vlen data type: %s\n' % self.dtype) * elif self._isenum: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3238 * ncdump_var.append('compound data type: %s\n' % self.dtype) * elif self._isvlen: * ncdump_var.append('vlen data type: %s\n' % self.dtype) # <<<<<<<<<<<<<< * elif self._isenum: * ncdump_var.append('enum data type: %s\n' % self.dtype) */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_vlen_data_type_s, __pyx_v_self->dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3237 * if self._iscompound: * ncdump_var.append('compound data type: %s\n' % self.dtype) * elif self._isvlen: # <<<<<<<<<<<<<< * ncdump_var.append('vlen data type: %s\n' % self.dtype) * elif self._isenum: */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":3239 * elif self._isvlen: * ncdump_var.append('vlen data type: %s\n' % self.dtype) * elif self._isenum: # <<<<<<<<<<<<<< * ncdump_var.append('enum data type: %s\n' % self.dtype) * unlimdims = [] */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3240 * ncdump_var.append('vlen data type: %s\n' % self.dtype) * elif self._isenum: * ncdump_var.append('enum data type: %s\n' % self.dtype) # <<<<<<<<<<<<<< * unlimdims = [] * for dimname in self.dimensions: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_enum_data_type_s, __pyx_v_self->dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3239 * elif self._isvlen: * ncdump_var.append('vlen data type: %s\n' % self.dtype) * elif self._isenum: # <<<<<<<<<<<<<< * ncdump_var.append('enum data type: %s\n' % self.dtype) * unlimdims = [] */ } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":3241 * elif self._isenum: * ncdump_var.append('enum data type: %s\n' % self.dtype) * unlimdims = [] # <<<<<<<<<<<<<< * for dimname in self.dimensions: * dim = _find_dim(self._grp, dimname) */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_unlimdims = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3242 * ncdump_var.append('enum data type: %s\n' % self.dtype) * unlimdims = [] * for dimname in self.dimensions: # <<<<<<<<<<<<<< * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3243 * unlimdims = [] * for dimname in self.dimensions: * dim = _find_dim(self._grp, dimname) # <<<<<<<<<<<<<< * if dim.isunlimited(): * unlimdims.append(dimname) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_find_dim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_12 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_12 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_self->_grp); __Pyx_GIVEREF(__pyx_v_self->_grp); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_12, __pyx_v_self->_grp); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_12, __pyx_v_dimname); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3244 * for dimname in self.dimensions: * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): # <<<<<<<<<<<<<< * unlimdims.append(dimname) * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dim, __pyx_n_s_isunlimited); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_9) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3245 * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): * unlimdims.append(dimname) # <<<<<<<<<<<<<< * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_unlimdims, __pyx_v_dimname); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3244 * for dimname in self.dimensions: * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): # <<<<<<<<<<<<<< * unlimdims.append(dimname) * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) */ } /* "netCDF4/_netCDF4.pyx":3242 * ncdump_var.append('enum data type: %s\n' % self.dtype) * unlimdims = [] * for dimname in self.dimensions: # <<<<<<<<<<<<<< * dim = _find_dim(self._grp, dimname) * if dim.isunlimited(): */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3246 * if dim.isunlimited(): * unlimdims.append(dimname) * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) # <<<<<<<<<<<<<< * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) * ncdump_var.append('current shape = %s\n' % repr(self.shape)) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__16, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_path_s, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } /* "netCDF4/_netCDF4.pyx":3247 * unlimdims.append(dimname) * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) # <<<<<<<<<<<<<< * ncdump_var.append('current shape = %s\n' % repr(self.shape)) * with nogil: */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__21, __pyx_v_unlimdims); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_unlimited_dimensions_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3248 * if (self._grp.path != '/'): ncdump_var.append('path = %s\n' % self._grp.path) * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) * ncdump_var.append('current shape = %s\n' % repr(self.shape)) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_current_shape_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3249 * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) * ncdump_var.append('current shape = %s\n' % repr(self.shape)) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3250 * ncdump_var.append('current shape = %s\n' % repr(self.shape)) * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_fill(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_no_fill), NULL); } /* "netCDF4/_netCDF4.pyx":3249 * ncdump_var.append('unlimited dimensions: %s\n' % ', '.join(unlimdims)) * ncdump_var.append('current shape = %s\n' % repr(self.shape)) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L16; } __pyx_L16:; } } /* "netCDF4/_netCDF4.pyx":3251 * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: */ __pyx_t_4 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3252 * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if self._isprimitive: * if no_fill != 1: */ __pyx_t_13 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3251 * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: */ } /* "netCDF4/_netCDF4.pyx":3253 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: # <<<<<<<<<<<<<< * if no_fill != 1: * try: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3254 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: * if no_fill != 1: # <<<<<<<<<<<<<< * try: * fillval = self._FillValue */ __pyx_t_4 = ((__pyx_v_no_fill != 1) != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3255 * if self._isprimitive: * if no_fill != 1: * try: # <<<<<<<<<<<<<< * fillval = self._FillValue * msg = 'filling on' */ { __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "netCDF4/_netCDF4.pyx":3256 * if no_fill != 1: * try: * fillval = self._FillValue # <<<<<<<<<<<<<< * msg = 'filling on' * except AttributeError: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L20_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_fillval = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3257 * try: * fillval = self._FillValue * msg = 'filling on' # <<<<<<<<<<<<<< * except AttributeError: * fillval = default_fillvals[self.dtype.str[1:]] */ __Pyx_INCREF(__pyx_kp_s_filling_on); __pyx_v_msg = __pyx_kp_s_filling_on; /* "netCDF4/_netCDF4.pyx":3255 * if self._isprimitive: * if no_fill != 1: * try: # <<<<<<<<<<<<<< * fillval = self._FillValue * msg = 'filling on' */ } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L27_try_end; __pyx_L20_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3258 * fillval = self._FillValue * msg = 'filling on' * except AttributeError: # <<<<<<<<<<<<<< * fillval = default_fillvals[self.dtype.str[1:]] * if self.dtype.str[1:] in ['u1','i1']: */ __pyx_t_17 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_17) { __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); /* "netCDF4/_netCDF4.pyx":3259 * msg = 'filling on' * except AttributeError: * fillval = default_fillvals[self.dtype.str[1:]] # <<<<<<<<<<<<<< * if self.dtype.str[1:] in ['u1','i1']: * msg = 'filling on, default _FillValue of %s ignored\n' % fillval */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_8, 1, 0, NULL, NULL, &__pyx_slice__45, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;}; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_fillval, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":3260 * except AttributeError: * fillval = default_fillvals[self.dtype.str[1:]] * if self.dtype.str[1:] in ['u1','i1']: # <<<<<<<<<<<<<< * msg = 'filling on, default _FillValue of %s ignored\n' % fillval * else: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_8, 1, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_u1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} if (!__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L31_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_i1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __pyx_t_4 = __pyx_t_3; __pyx_L31_bool_binop_done:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3261 * fillval = default_fillvals[self.dtype.str[1:]] * if self.dtype.str[1:] in ['u1','i1']: * msg = 'filling on, default _FillValue of %s ignored\n' % fillval # <<<<<<<<<<<<<< * else: * msg = 'filling on, default _FillValue of %s used\n' % fillval */ __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_filling_on_default__FillValue_of, __pyx_v_fillval); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":3260 * except AttributeError: * fillval = default_fillvals[self.dtype.str[1:]] * if self.dtype.str[1:] in ['u1','i1']: # <<<<<<<<<<<<<< * msg = 'filling on, default _FillValue of %s ignored\n' % fillval * else: */ goto __pyx_L30; } /* "netCDF4/_netCDF4.pyx":3263 * msg = 'filling on, default _FillValue of %s ignored\n' % fillval * else: * msg = 'filling on, default _FillValue of %s used\n' % fillval # <<<<<<<<<<<<<< * ncdump_var.append(msg) * else: */ /*else*/ { __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_filling_on_default__FillValue_of_2, __pyx_v_fillval); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L22_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_10); __pyx_t_10 = 0; } __pyx_L30:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L21_exception_handled; } goto __pyx_L22_except_error; __pyx_L22_except_error:; /* "netCDF4/_netCDF4.pyx":3255 * if self._isprimitive: * if no_fill != 1: * try: # <<<<<<<<<<<<<< * fillval = self._FillValue * msg = 'filling on' */ __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); goto __pyx_L1_error; __pyx_L21_exception_handled:; __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); __pyx_L27_try_end:; } /* "netCDF4/_netCDF4.pyx":3264 * else: * msg = 'filling on, default _FillValue of %s used\n' % fillval * ncdump_var.append(msg) # <<<<<<<<<<<<<< * else: * ncdump_var.append('filling off\n') */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_v_msg); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3254 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: * if no_fill != 1: # <<<<<<<<<<<<<< * try: * fillval = self._FillValue */ goto __pyx_L19; } /* "netCDF4/_netCDF4.pyx":3266 * ncdump_var.append(msg) * else: * ncdump_var.append('filling off\n') # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ncdump_var, __pyx_kp_s_filling_off); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L19:; /* "netCDF4/_netCDF4.pyx":3253 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if self._isprimitive: # <<<<<<<<<<<<<< * if no_fill != 1: * try: */ } /* "netCDF4/_netCDF4.pyx":3269 * * * return ''.join(ncdump_var) # <<<<<<<<<<<<<< * * def _getdims(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_v_ncdump_var); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3214 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * cdef int ierr, no_fill * if not dir(self._grp): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ncdump_var); __Pyx_XDECREF(__pyx_v_dimnames); __Pyx_XDECREF(__pyx_v_attrs); __Pyx_XDECREF(__pyx_v_unlimdims); __Pyx_XDECREF(__pyx_v_dimname); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XDECREF(__pyx_v_fillval); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3271 * return ''.join(ncdump_var) * * def _getdims(self): # <<<<<<<<<<<<<< * # Private method to get variables's dimension names * cdef int ierr, numdims, n, nn */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_9_getdims(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_9_getdims(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getdims (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_getdims(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8_getdims(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_numdims; int __pyx_v_nn; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; int *__pyx_v_dimids; PyObject *__pyx_v_dimensions = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getdims", 0); /* "netCDF4/_netCDF4.pyx":3277 * cdef int *dimids * # get number of dimensions for this variable. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3278 * # get number of dimensions for this variable. * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varndims(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_numdims)); } /* "netCDF4/_netCDF4.pyx":3277 * cdef int *dimids * # get number of dimensions for this variable. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":3279 * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3280 * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3279 * with nogil: * ierr = nc_inq_varndims(self._grpid, self._varid, &numdims) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) */ } /* "netCDF4/_netCDF4.pyx":3281 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dimids = malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<< * # get dimension ids. * with nogil: */ __pyx_v_dimids = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims))); /* "netCDF4/_netCDF4.pyx":3283 * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3284 * # get dimension ids. * with nogil: * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_vardimid(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_dimids); } /* "netCDF4/_netCDF4.pyx":3283 * dimids = malloc(sizeof(int) * numdims) * # get dimension ids. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L9; } __pyx_L9:; } } /* "netCDF4/_netCDF4.pyx":3285 * with nogil: * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over dimensions, retrieve names. */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3286 * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # loop over dimensions, retrieve names. * dimensions = () */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3285 * with nogil: * ierr = nc_inq_vardimid(self._grpid, self._varid, dimids) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over dimensions, retrieve names. */ } /* "netCDF4/_netCDF4.pyx":3288 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over dimensions, retrieve names. * dimensions = () # <<<<<<<<<<<<<< * for nn from 0 <= nn < numdims: * with nogil: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_dimensions = __pyx_empty_tuple; /* "netCDF4/_netCDF4.pyx":3289 * # loop over dimensions, retrieve names. * dimensions = () * for nn from 0 <= nn < numdims: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) */ __pyx_t_5 = __pyx_v_numdims; for (__pyx_v_nn = 0; __pyx_v_nn < __pyx_t_5; __pyx_v_nn++) { /* "netCDF4/_netCDF4.pyx":3290 * dimensions = () * for nn from 0 <= nn < numdims: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3291 * for nn from 0 <= nn < numdims: * with nogil: * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_dimname(__pyx_v_self->_grpid, (__pyx_v_dimids[__pyx_v_nn]), __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":3290 * dimensions = () * for nn from 0 <= nn < numdims: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } /* "netCDF4/_netCDF4.pyx":3292 * with nogil: * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3293 * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = namstring.decode(default_encoding,unicode_error) * dimensions = dimensions + (name,) */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3292 * with nogil: * ierr = nc_inq_dimname(self._grpid, dimids[nn], namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":3294 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * dimensions = dimensions + (name,) * free(dimids) */ __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3295 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = namstring.decode(default_encoding,unicode_error) * dimensions = dimensions + (name,) # <<<<<<<<<<<<<< * free(dimids) * return dimensions */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_name); __pyx_t_6 = PyNumber_Add(__pyx_v_dimensions, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dimensions, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; } /* "netCDF4/_netCDF4.pyx":3296 * name = namstring.decode(default_encoding,unicode_error) * dimensions = dimensions + (name,) * free(dimids) # <<<<<<<<<<<<<< * return dimensions * */ free(__pyx_v_dimids); /* "netCDF4/_netCDF4.pyx":3297 * dimensions = dimensions + (name,) * free(dimids) * return dimensions # <<<<<<<<<<<<<< * * def _getname(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_dimensions); __pyx_r = __pyx_v_dimensions; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3271 * return ''.join(ncdump_var) * * def _getdims(self): # <<<<<<<<<<<<<< * # Private method to get variables's dimension names * cdef int ierr, numdims, n, nn */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._getdims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dimensions); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3299 * return dimensions * * def _getname(self): # <<<<<<<<<<<<<< * # Private method to get name associated with instance * cdef int err, _grpid */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_11_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_11_getname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getname (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_10_getname(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10_getname(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v__grpid; char __pyx_v_namstring[(NC_MAX_NAME + 1)]; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getname", 0); /* "netCDF4/_netCDF4.pyx":3303 * cdef int err, _grpid * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_varname(_grpid, self._varid, namstring) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":3304 * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varname(_grpid, self._varid, namstring) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3305 * _grpid = self._grp._grpid * with nogil: * ierr = nc_inq_varname(_grpid, self._varid, namstring) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_varname(__pyx_v__grpid, __pyx_v_self->_varid, __pyx_v_namstring); } /* "netCDF4/_netCDF4.pyx":3304 * cdef char namstring[NC_MAX_NAME+1] * _grpid = self._grp._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_varname(_grpid, self._varid, namstring) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":3306 * with nogil: * ierr = nc_inq_varname(_grpid, self._varid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3307 * ierr = nc_inq_varname(_grpid, self._varid, namstring) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * return namstring.decode(default_encoding,unicode_error) * */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3306 * with nogil: * ierr = nc_inq_varname(_grpid, self._varid, namstring) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":3308 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3299 * return dimensions * * def _getname(self): # <<<<<<<<<<<<<< * # Private method to get name associated with instance * cdef int err, _grpid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._getname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3312 * property name: * """string name of Variable instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":3313 * """string name of Variable instance""" * def __get__(self): * return self._getname() # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("name cannot be altered") */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3312 * property name: * """string name of Variable instance""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getname() * def __set__(self,value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3314 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4name_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":3315 * return self._getname() * def __set__(self,value): * raise AttributeError("name cannot be altered") # <<<<<<<<<<<<<< * * property datatype: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3314 * def __get__(self): * return self._getname() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("name cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3321 * VLType/CompoundType/EnumType instance * (for compound, vlen or enum data types)""" * def __get__(self): # <<<<<<<<<<<<<< * if self._iscompound: * return self._cmptype */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8datatype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8datatype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_8datatype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8datatype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":3322 * (for compound, vlen or enum data types)""" * def __get__(self): * if self._iscompound: # <<<<<<<<<<<<<< * return self._cmptype * elif self._isvlen: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_iscompound); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3323 * def __get__(self): * if self._iscompound: * return self._cmptype # <<<<<<<<<<<<<< * elif self._isvlen: * return self._vltype */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_cmptype); __pyx_r = __pyx_v_self->_cmptype; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3322 * (for compound, vlen or enum data types)""" * def __get__(self): * if self._iscompound: # <<<<<<<<<<<<<< * return self._cmptype * elif self._isvlen: */ } /* "netCDF4/_netCDF4.pyx":3324 * if self._iscompound: * return self._cmptype * elif self._isvlen: # <<<<<<<<<<<<<< * return self._vltype * elif self._isenum: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3325 * return self._cmptype * elif self._isvlen: * return self._vltype # <<<<<<<<<<<<<< * elif self._isenum: * return self._enumtype */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_vltype); __pyx_r = __pyx_v_self->_vltype; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3324 * if self._iscompound: * return self._cmptype * elif self._isvlen: # <<<<<<<<<<<<<< * return self._vltype * elif self._isenum: */ } /* "netCDF4/_netCDF4.pyx":3326 * elif self._isvlen: * return self._vltype * elif self._isenum: # <<<<<<<<<<<<<< * return self._enumtype * elif self._isprimitive: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3327 * return self._vltype * elif self._isenum: * return self._enumtype # <<<<<<<<<<<<<< * elif self._isprimitive: * return self.dtype */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_enumtype); __pyx_r = __pyx_v_self->_enumtype; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3326 * elif self._isvlen: * return self._vltype * elif self._isenum: # <<<<<<<<<<<<<< * return self._enumtype * elif self._isprimitive: */ } /* "netCDF4/_netCDF4.pyx":3328 * elif self._isenum: * return self._enumtype * elif self._isprimitive: # <<<<<<<<<<<<<< * return self.dtype * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3329 * return self._enumtype * elif self._isprimitive: * return self.dtype # <<<<<<<<<<<<<< * * property shape: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dtype); __pyx_r = __pyx_v_self->dtype; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3328 * elif self._isenum: * return self._enumtype * elif self._isprimitive: # <<<<<<<<<<<<<< * return self.dtype * */ } /* "netCDF4/_netCDF4.pyx":3321 * VLType/CompoundType/EnumType instance * (for compound, vlen or enum data types)""" * def __get__(self): # <<<<<<<<<<<<<< * if self._iscompound: * return self._cmptype */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.datatype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3333 * property shape: * """find current sizes of all variable dimensions""" * def __get__(self): # <<<<<<<<<<<<<< * shape = () * for dimname in self._getdims(): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_v_shape = NULL; PyObject *__pyx_v_dimname = NULL; PyObject *__pyx_v_dim = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":3334 * """find current sizes of all variable dimensions""" * def __get__(self): * shape = () # <<<<<<<<<<<<<< * for dimname in self._getdims(): * # look in current group, and parents for dim. */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_shape = __pyx_empty_tuple; /* "netCDF4/_netCDF4.pyx":3335 * def __get__(self): * shape = () * for dimname in self._getdims(): # <<<<<<<<<<<<<< * # look in current group, and parents for dim. * dim = _find_dim(self._grp,dimname) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getdims); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_dimname, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3337 * for dimname in self._getdims(): * # look in current group, and parents for dim. * dim = _find_dim(self._grp,dimname) # <<<<<<<<<<<<<< * shape = shape + (len(dim),) * return shape */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_find_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_self->_grp); __Pyx_GIVEREF(__pyx_v_self->_grp); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_self->_grp); __Pyx_INCREF(__pyx_v_dimname); __Pyx_GIVEREF(__pyx_v_dimname); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_dimname); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_dim, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3338 * # look in current group, and parents for dim. * dim = _find_dim(self._grp,dimname) * shape = shape + (len(dim),) # <<<<<<<<<<<<<< * return shape * def __set__(self,value): */ __pyx_t_7 = PyObject_Length(__pyx_v_dim); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_v_shape, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3335 * def __get__(self): * shape = () * for dimname in self._getdims(): # <<<<<<<<<<<<<< * # look in current group, and parents for dim. * dim = _find_dim(self._grp,dimname) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3339 * dim = _find_dim(self._grp,dimname) * shape = shape + (len(dim),) * return shape # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("shape cannot be altered") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_shape); __pyx_r = __pyx_v_shape; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3333 * property shape: * """find current sizes of all variable dimensions""" * def __get__(self): # <<<<<<<<<<<<<< * shape = () * for dimname in self._getdims(): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_dimname); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3340 * shape = shape + (len(dim),) * return shape * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("shape cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5shape_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":3341 * return shape * def __set__(self,value): * raise AttributeError("shape cannot be altered") # <<<<<<<<<<<<<< * * property size: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3340 * shape = shape + (len(dim),) * return shape * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("shape cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3345 * property size: * """Return the number of stored elements.""" * def __get__(self): # <<<<<<<<<<<<<< * return numpy.prod(self.shape) * */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4size___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4size___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":3346 * """Return the number of stored elements.""" * def __get__(self): * return numpy.prod(self.shape) # <<<<<<<<<<<<<< * * property dimensions: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_prod); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3345 * property size: * """Return the number of stored elements.""" * def __get__(self): # <<<<<<<<<<<<<< * return numpy.prod(self.shape) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3350 * property dimensions: * """get variables's dimension names""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getdims() * def __set__(self,value): */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "netCDF4/_netCDF4.pyx":3351 * """get variables's dimension names""" * def __get__(self): * return self._getdims() # <<<<<<<<<<<<<< * def __set__(self,value): * raise AttributeError("dimensions cannot be altered") */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getdims); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3350 * property dimensions: * """get variables's dimension names""" * def __get__(self): # <<<<<<<<<<<<<< * return self._getdims() * def __set__(self,value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.dimensions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3352 * def __get__(self): * return self._getdims() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("dimensions cannot be altered") * */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_10dimensions_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_10dimensions_2__set__(CYTHON_UNUSED struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "netCDF4/_netCDF4.pyx":3353 * return self._getdims() * def __set__(self,value): * raise AttributeError("dimensions cannot be altered") # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3352 * def __get__(self): * return self._getdims() * def __set__(self,value): # <<<<<<<<<<<<<< * raise AttributeError("dimensions cannot be altered") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.dimensions.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3356 * * * def group(self): # <<<<<<<<<<<<<< * """ * **`group(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_13group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_12group[] = "\n**`group(self)`**\n\nreturn the group that this `netCDF4.Variable` is a member of."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_13group(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_12group(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_12group(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("group", 0); /* "netCDF4/_netCDF4.pyx":3361 * * return the group that this `netCDF4.Variable` is a member of.""" * return self._grp # <<<<<<<<<<<<<< * * def ncattrs(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_grp); __pyx_r = __pyx_v_self->_grp; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3356 * * * def group(self): # <<<<<<<<<<<<<< * """ * **`group(self)`** */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3363 * return self._grp * * def ncattrs(self): # <<<<<<<<<<<<<< * """ * **`ncattrs(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_15ncattrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_14ncattrs[] = "\n**`ncattrs(self)`**\n\nreturn netCDF attribute names for this `netCDF4.Variable` in a list."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_15ncattrs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ncattrs (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_14ncattrs(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_14ncattrs(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ncattrs", 0); /* "netCDF4/_netCDF4.pyx":3368 * * return netCDF attribute names for this `netCDF4.Variable` in a list.""" * return _get_att_names(self._grpid, self._varid) # <<<<<<<<<<<<<< * * def setncattr(self,name,value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__get_att_names(__pyx_v_self->_grpid, __pyx_v_self->_varid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3363 * return self._grp * * def ncattrs(self): # <<<<<<<<<<<<<< * """ * **`ncattrs(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.ncattrs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3370 * return _get_att_names(self._grpid, self._varid) * * def setncattr(self,name,value): # <<<<<<<<<<<<<< * """ * **`setncattr(self,name,value)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_17setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_16setncattr[] = "\n**`setncattr(self,name,value)`**\n\nset a netCDF variable attribute using name,value pair. Use if you need to set a\nnetCDF attribute with the same name as one of the reserved python\nattributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_17setncattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setncattr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setncattr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setncattr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setncattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_16setncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_16setncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setncattr", 0); /* "netCDF4/_netCDF4.pyx":3377 * netCDF attribute with the same name as one of the reserved python * attributes.""" * if self._grp.data_model != 'NETCDF4': self._grp._redef() # <<<<<<<<<<<<<< * _set_att(self._grp, self._varid, name, value) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_redef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3378 * attributes.""" * if self._grp.data_model != 'NETCDF4': self._grp._redef() * _set_att(self._grp, self._varid, name, value) # <<<<<<<<<<<<<< * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * */ __pyx_t_1 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__set_att(__pyx_t_1, __pyx_v_self->_varid, __pyx_v_name, __pyx_v_value, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3379 * if self._grp.data_model != 'NETCDF4': self._grp._redef() * _set_att(self._grp, self._varid, name, value) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() # <<<<<<<<<<<<<< * * def setncatts(self,attdict): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3370 * return _get_att_names(self._grpid, self._varid) * * def setncattr(self,name,value): # <<<<<<<<<<<<<< * """ * **`setncattr(self,name,value)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.setncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3381 * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * * def setncatts(self,attdict): # <<<<<<<<<<<<<< * """ * **`setncatts(self,attdict)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_19setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_18setncatts[] = "\n**`setncatts(self,attdict)`**\n\nset a bunch of netCDF variable attributes at once using a python dictionary.\nThis may be faster when setting a lot of attributes for a `NETCDF3`\nformatted file, since nc_redef/nc_enddef is not called in between setting\neach attribute"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_19setncatts(PyObject *__pyx_v_self, PyObject *__pyx_v_attdict) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setncatts (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_18setncatts(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_attdict)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_18setncatts(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_attdict) { PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setncatts", 0); /* "netCDF4/_netCDF4.pyx":3389 * formatted file, since nc_redef/nc_enddef is not called in between setting * each attribute""" * if self._grp.data_model != 'NETCDF4': self._grp._redef() # <<<<<<<<<<<<<< * for name, value in attdict.items(): * _set_att(self._grp, self._varid, name, value) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_redef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3390 * each attribute""" * if self._grp.data_model != 'NETCDF4': self._grp._redef() * for name, value in attdict.items(): # <<<<<<<<<<<<<< * _set_att(self._grp, self._varid, name, value) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_attdict, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3391 * if self._grp.data_model != 'NETCDF4': self._grp._redef() * for name, value in attdict.items(): * _set_att(self._grp, self._varid, name, value) # <<<<<<<<<<<<<< * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * */ __pyx_t_1 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__set_att(__pyx_t_1, __pyx_v_self->_varid, __pyx_v_name, __pyx_v_value, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3390 * each attribute""" * if self._grp.data_model != 'NETCDF4': self._grp._redef() * for name, value in attdict.items(): # <<<<<<<<<<<<<< * _set_att(self._grp, self._varid, name, value) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3392 * for name, value in attdict.items(): * _set_att(self._grp, self._varid, name, value) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() # <<<<<<<<<<<<<< * * def getncattr(self,name): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "netCDF4/_netCDF4.pyx":3381 * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * * def setncatts(self,attdict): # <<<<<<<<<<<<<< * """ * **`setncatts(self,attdict)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.setncatts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3394 * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * * def getncattr(self,name): # <<<<<<<<<<<<<< * """ * **`getncattr(self,name)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_21getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_20getncattr[] = "\n**`getncattr(self,name)`**\n\nretrievel a netCDF variable attribute. Use if you need to set a\nnetCDF attribute with the same name as one of the reserved python\nattributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_21getncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getncattr (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_20getncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_20getncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getncattr", 0); /* "netCDF4/_netCDF4.pyx":3401 * netCDF attribute with the same name as one of the reserved python * attributes.""" * return _get_att(self._grp, self._varid, name) # <<<<<<<<<<<<<< * * def delncattr(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_f_7netCDF4_8_netCDF4__get_att(__pyx_t_1, __pyx_v_self->_varid, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3394 * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * * def getncattr(self,name): # <<<<<<<<<<<<<< * """ * **`getncattr(self,name)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.getncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3403 * return _get_att(self._grp, self._varid, name) * * def delncattr(self, name): # <<<<<<<<<<<<<< * """ * **`delncattr(self,name,value)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_23delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_22delncattr[] = "\n**`delncattr(self,name,value)`**\n\ndelete a netCDF variable attribute. Use if you need to delete a\nnetCDF attribute with the same name as one of the reserved python\nattributes."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_23delncattr(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delncattr (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_22delncattr(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_22delncattr(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name) { char *__pyx_v_attname; PyObject *__pyx_v_bytestr = NULL; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delncattr", 0); /* "netCDF4/_netCDF4.pyx":3411 * attributes.""" * cdef char *attname * bytestr = _strencode(name) # <<<<<<<<<<<<<< * attname = bytestr * if self._grp.data_model != 'NETCDF4': self._grp._redef() */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3412 * cdef char *attname * bytestr = _strencode(name) * attname = bytestr # <<<<<<<<<<<<<< * if self._grp.data_model != 'NETCDF4': self._grp._redef() * ierr = nc_del_att(self._grpid, self._varid, attname) */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_attname = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":3413 * bytestr = _strencode(name) * attname = bytestr * if self._grp.data_model != 'NETCDF4': self._grp._redef() # <<<<<<<<<<<<<< * ierr = nc_del_att(self._grpid, self._varid, attname) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_redef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3414 * attname = bytestr * if self._grp.data_model != 'NETCDF4': self._grp._redef() * ierr = nc_del_att(self._grpid, self._varid, attname) # <<<<<<<<<<<<<< * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_del_att(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_attname); /* "netCDF4/_netCDF4.pyx":3415 * if self._grp.data_model != 'NETCDF4': self._grp._redef() * ierr = nc_del_att(self._grpid, self._varid, attname) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_enddef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3416 * ierr = nc_del_att(self._grpid, self._varid, attname) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3417 * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def filters(self): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3416 * ierr = nc_del_att(self._grpid, self._varid, attname) * if self._grp.data_model != 'NETCDF4': self._grp._enddef() * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":3403 * return _get_att(self._grp, self._varid, name) * * def delncattr(self, name): # <<<<<<<<<<<<<< * """ * **`delncattr(self,name,value)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.delncattr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3419 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def filters(self): # <<<<<<<<<<<<<< * """ * **`filters(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_25filters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_24filters[] = "\n**`filters(self)`**\n\nreturn dictionary containing HDF5 filter parameters."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_25filters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("filters (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_24filters(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_24filters(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_ideflate; int __pyx_v_ishuffle; int __pyx_v_ideflate_level; int __pyx_v_ifletcher32; PyObject *__pyx_v_filtdict = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filters", 0); /* "netCDF4/_netCDF4.pyx":3425 * return dictionary containing HDF5 filter parameters.""" * cdef int ierr,ideflate,ishuffle,ideflate_level,ifletcher32 * filtdict = {'zlib':False,'shuffle':False,'complevel':0,'fletcher32':False} # <<<<<<<<<<<<<< * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return * with nogil: */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zlib, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shuffle, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_complevel, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fletcher32, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_filtdict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3426 * cdef int ierr,ideflate,ishuffle,ideflate_level,ifletcher32 * filtdict = {'zlib':False,'shuffle':False,'complevel':0,'fletcher32':False} * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4_CLASSIC, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3427 * filtdict = {'zlib':False,'shuffle':False,'complevel':0,'fletcher32':False} * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3428 * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return * with nogil: * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_deflate(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_ishuffle), (&__pyx_v_ideflate), (&__pyx_v_ideflate_level)); } /* "netCDF4/_netCDF4.pyx":3427 * filtdict = {'zlib':False,'shuffle':False,'complevel':0,'fletcher32':False} * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "netCDF4/_netCDF4.pyx":3429 * with nogil: * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * with nogil: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3430 * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3429 * with nogil: * ierr = nc_inq_var_deflate(self._grpid, self._varid, &ishuffle, &ideflate, &ideflate_level) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * with nogil: */ } /* "netCDF4/_netCDF4.pyx":3431 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3432 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * with nogil: * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_fletcher32(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_ifletcher32)); } /* "netCDF4/_netCDF4.pyx":3431 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "netCDF4/_netCDF4.pyx":3433 * with nogil: * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ideflate: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3434 * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if ideflate: * filtdict['zlib']=True */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3433 * with nogil: * ierr = nc_inq_var_fletcher32(self._grpid, self._varid, &ifletcher32) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ideflate: */ } /* "netCDF4/_netCDF4.pyx":3435 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ideflate: # <<<<<<<<<<<<<< * filtdict['zlib']=True * filtdict['complevel']=ideflate_level */ __pyx_t_3 = (__pyx_v_ideflate != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3436 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ideflate: * filtdict['zlib']=True # <<<<<<<<<<<<<< * filtdict['complevel']=ideflate_level * if ishuffle: */ if (unlikely(PyDict_SetItem(__pyx_v_filtdict, __pyx_n_s_zlib, Py_True) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3437 * if ideflate: * filtdict['zlib']=True * filtdict['complevel']=ideflate_level # <<<<<<<<<<<<<< * if ishuffle: * filtdict['shuffle']=True */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ideflate_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyDict_SetItem(__pyx_v_filtdict, __pyx_n_s_complevel, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3435 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if ideflate: # <<<<<<<<<<<<<< * filtdict['zlib']=True * filtdict['complevel']=ideflate_level */ } /* "netCDF4/_netCDF4.pyx":3438 * filtdict['zlib']=True * filtdict['complevel']=ideflate_level * if ishuffle: # <<<<<<<<<<<<<< * filtdict['shuffle']=True * if ifletcher32: */ __pyx_t_3 = (__pyx_v_ishuffle != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3439 * filtdict['complevel']=ideflate_level * if ishuffle: * filtdict['shuffle']=True # <<<<<<<<<<<<<< * if ifletcher32: * filtdict['fletcher32']=True */ if (unlikely(PyDict_SetItem(__pyx_v_filtdict, __pyx_n_s_shuffle, Py_True) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3438 * filtdict['zlib']=True * filtdict['complevel']=ideflate_level * if ishuffle: # <<<<<<<<<<<<<< * filtdict['shuffle']=True * if ifletcher32: */ } /* "netCDF4/_netCDF4.pyx":3440 * if ishuffle: * filtdict['shuffle']=True * if ifletcher32: # <<<<<<<<<<<<<< * filtdict['fletcher32']=True * return filtdict */ __pyx_t_3 = (__pyx_v_ifletcher32 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3441 * filtdict['shuffle']=True * if ifletcher32: * filtdict['fletcher32']=True # <<<<<<<<<<<<<< * return filtdict * */ if (unlikely(PyDict_SetItem(__pyx_v_filtdict, __pyx_n_s_fletcher32, Py_True) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3440 * if ishuffle: * filtdict['shuffle']=True * if ifletcher32: # <<<<<<<<<<<<<< * filtdict['fletcher32']=True * return filtdict */ } /* "netCDF4/_netCDF4.pyx":3442 * if ifletcher32: * filtdict['fletcher32']=True * return filtdict # <<<<<<<<<<<<<< * * def endian(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_filtdict); __pyx_r = __pyx_v_filtdict; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3419 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def filters(self): # <<<<<<<<<<<<<< * """ * **`filters(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.filters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filtdict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3444 * return filtdict * * def endian(self): # <<<<<<<<<<<<<< * """ * **`endian(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_27endian(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_26endian[] = "\n**`endian(self)`**\n\nreturn endian-ness (`little,big,native`) of variable (as stored in HDF5 file)."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_27endian(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("endian (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_26endian(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_26endian(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_iendian; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("endian", 0); /* "netCDF4/_netCDF4.pyx":3450 * return endian-ness (`little,big,native`) of variable (as stored in HDF5 file).""" * cdef int ierr, iendian * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: # <<<<<<<<<<<<<< * return 'native' * with nogil: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4_CLASSIC, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3451 * cdef int ierr, iendian * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: * return 'native' # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_native); __pyx_r = __pyx_n_s_native; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3450 * return endian-ness (`little,big,native`) of variable (as stored in HDF5 file).""" * cdef int ierr, iendian * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: # <<<<<<<<<<<<<< * return 'native' * with nogil: */ } /* "netCDF4/_netCDF4.pyx":3452 * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: * return 'native' * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3453 * return 'native' * with nogil: * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_endian(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_iendian)); } /* "netCDF4/_netCDF4.pyx":3452 * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: * return 'native' * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "netCDF4/_netCDF4.pyx":3454 * with nogil: * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if iendian == NC_ENDIAN_LITTLE: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3455 * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * if iendian == NC_ENDIAN_LITTLE: * return 'little' */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3454 * with nogil: * ierr = nc_inq_var_endian(self._grpid, self._varid, &iendian) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if iendian == NC_ENDIAN_LITTLE: */ } /* "netCDF4/_netCDF4.pyx":3456 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if iendian == NC_ENDIAN_LITTLE: # <<<<<<<<<<<<<< * return 'little' * elif iendian == NC_ENDIAN_BIG: */ switch (__pyx_v_iendian) { case NC_ENDIAN_LITTLE: /* "netCDF4/_netCDF4.pyx":3457 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if iendian == NC_ENDIAN_LITTLE: * return 'little' # <<<<<<<<<<<<<< * elif iendian == NC_ENDIAN_BIG: * return 'big' */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_little); __pyx_r = __pyx_n_s_little; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3456 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * if iendian == NC_ENDIAN_LITTLE: # <<<<<<<<<<<<<< * return 'little' * elif iendian == NC_ENDIAN_BIG: */ break; /* "netCDF4/_netCDF4.pyx":3458 * if iendian == NC_ENDIAN_LITTLE: * return 'little' * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<< * return 'big' * else: */ case NC_ENDIAN_BIG: /* "netCDF4/_netCDF4.pyx":3459 * return 'little' * elif iendian == NC_ENDIAN_BIG: * return 'big' # <<<<<<<<<<<<<< * else: * return 'native' */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_big); __pyx_r = __pyx_n_s_big; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3458 * if iendian == NC_ENDIAN_LITTLE: * return 'little' * elif iendian == NC_ENDIAN_BIG: # <<<<<<<<<<<<<< * return 'big' * else: */ break; default: /* "netCDF4/_netCDF4.pyx":3461 * return 'big' * else: * return 'native' # <<<<<<<<<<<<<< * * def chunking(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_native); __pyx_r = __pyx_n_s_native; goto __pyx_L0; break; } /* "netCDF4/_netCDF4.pyx":3444 * return filtdict * * def endian(self): # <<<<<<<<<<<<<< * """ * **`endian(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.endian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3463 * return 'native' * * def chunking(self): # <<<<<<<<<<<<<< * """ * **`chunking(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_29chunking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_28chunking[] = "\n**`chunking(self)`**\n\nreturn variable chunking information. If the dataset is\ndefined to be contiguous (and hence there is no chunking) the word 'contiguous'\nis returned. Otherwise, a sequence with the chunksize for\neach dimension is returned."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_29chunking(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chunking (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_28chunking(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_28chunking(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; int __pyx_v_icontiguous; int __pyx_v_ndims; size_t *__pyx_v_chunksizesp; PyObject *__pyx_v_chunksizes = NULL; long __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; char *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chunking", 0); /* "netCDF4/_netCDF4.pyx":3473 * cdef int ierr, icontiguous, ndims * cdef size_t *chunksizesp * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return None # <<<<<<<<<<<<<< * ndims = self.ndim * chunksizesp = malloc(sizeof(size_t) * ndims) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_grp, __pyx_n_s_data_model); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4_CLASSIC, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_NETCDF4, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3474 * cdef size_t *chunksizesp * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return None * ndims = self.ndim # <<<<<<<<<<<<<< * chunksizesp = malloc(sizeof(size_t) * ndims) * with nogil: */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_self->ndim); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ndims = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":3475 * if self._grp.data_model not in ['NETCDF4_CLASSIC','NETCDF4']: return None * ndims = self.ndim * chunksizesp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) */ __pyx_v_chunksizesp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":3476 * ndims = self.ndim * chunksizesp = malloc(sizeof(size_t) * ndims) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3477 * chunksizesp = malloc(sizeof(size_t) * ndims) * with nogil: * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_chunking(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_icontiguous), __pyx_v_chunksizesp); } /* "netCDF4/_netCDF4.pyx":3476 * ndims = self.ndim * chunksizesp = malloc(sizeof(size_t) * ndims) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L8; } __pyx_L8:; } } /* "netCDF4/_netCDF4.pyx":3478 * with nogil: * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * chunksizes=[] */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3479 * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * chunksizes=[] * for n from 0 <= n < ndims: */ __pyx_t_5 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_5, 0, strlen(__pyx_t_5), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3478 * with nogil: * ierr = nc_inq_var_chunking(self._grpid, self._varid, &icontiguous, chunksizesp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * chunksizes=[] */ } /* "netCDF4/_netCDF4.pyx":3480 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * chunksizes=[] # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * chunksizes.append(chunksizesp[n]) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_chunksizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3481 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * chunksizes=[] * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * chunksizes.append(chunksizesp[n]) * free(chunksizesp) */ __pyx_t_4 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":3482 * chunksizes=[] * for n from 0 <= n < ndims: * chunksizes.append(chunksizesp[n]) # <<<<<<<<<<<<<< * free(chunksizesp) * if icontiguous: */ __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_chunksizesp[__pyx_v_n])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_chunksizes, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3483 * for n from 0 <= n < ndims: * chunksizes.append(chunksizesp[n]) * free(chunksizesp) # <<<<<<<<<<<<<< * if icontiguous: * return 'contiguous' */ free(__pyx_v_chunksizesp); /* "netCDF4/_netCDF4.pyx":3484 * chunksizes.append(chunksizesp[n]) * free(chunksizesp) * if icontiguous: # <<<<<<<<<<<<<< * return 'contiguous' * else: */ __pyx_t_3 = (__pyx_v_icontiguous != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3485 * free(chunksizesp) * if icontiguous: * return 'contiguous' # <<<<<<<<<<<<<< * else: * return chunksizes */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_contiguous); __pyx_r = __pyx_n_s_contiguous; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3484 * chunksizes.append(chunksizesp[n]) * free(chunksizesp) * if icontiguous: # <<<<<<<<<<<<<< * return 'contiguous' * else: */ } /* "netCDF4/_netCDF4.pyx":3487 * return 'contiguous' * else: * return chunksizes # <<<<<<<<<<<<<< * * def get_var_chunk_cache(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_chunksizes); __pyx_r = __pyx_v_chunksizes; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3463 * return 'native' * * def chunking(self): # <<<<<<<<<<<<<< * """ * **`chunking(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.chunking", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_chunksizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3489 * return chunksizes * * def get_var_chunk_cache(self): # <<<<<<<<<<<<<< * """ * **`get_var_chunk_cache(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_31get_var_chunk_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_30get_var_chunk_cache[] = "\n**`get_var_chunk_cache(self)`**\n\nreturn variable chunk cache information in a tuple (size,nelems,preemption).\nSee netcdf C library documentation for `nc_get_var_chunk_cache` for\ndetails."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_31get_var_chunk_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_var_chunk_cache (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_30get_var_chunk_cache(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_30get_var_chunk_cache(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_v_ierr; size_t __pyx_v_sizep; size_t __pyx_v_nelemsp; float __pyx_v_preemptionp; size_t __pyx_v_size; size_t __pyx_v_nelems; PyObject *__pyx_v_preemption = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_var_chunk_cache", 0); /* "netCDF4/_netCDF4.pyx":3499 * cdef size_t sizep, nelemsp * cdef float preemptionp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3500 * cdef float preemptionp * with nogil: * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, # <<<<<<<<<<<<<< * &nelemsp, &preemptionp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_get_var_chunk_cache(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_sizep), (&__pyx_v_nelemsp), (&__pyx_v_preemptionp)); } /* "netCDF4/_netCDF4.pyx":3499 * cdef size_t sizep, nelemsp * cdef float preemptionp * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":3502 * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * size = sizep; nelems = nelemsp; preemption = preemptionp */ __pyx_t_1 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3503 * &nelemsp, &preemptionp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * size = sizep; nelems = nelemsp; preemption = preemptionp * return (size,nelems,preemption) */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3502 * ierr = nc_get_var_chunk_cache(self._grpid, self._varid, &sizep, * &nelemsp, &preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * size = sizep; nelems = nelemsp; preemption = preemptionp */ } /* "netCDF4/_netCDF4.pyx":3504 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * size = sizep; nelems = nelemsp; preemption = preemptionp # <<<<<<<<<<<<<< * return (size,nelems,preemption) * */ __pyx_v_size = __pyx_v_sizep; __pyx_v_nelems = __pyx_v_nelemsp; __pyx_t_3 = PyFloat_FromDouble(__pyx_v_preemptionp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_preemption = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3505 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * size = sizep; nelems = nelemsp; preemption = preemptionp * return (size,nelems,preemption) # <<<<<<<<<<<<<< * * def set_var_chunk_cache(self,size=None,nelems=None,preemption=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __Pyx_INCREF(__pyx_v_preemption); __Pyx_GIVEREF(__pyx_v_preemption); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_preemption); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3489 * return chunksizes * * def get_var_chunk_cache(self): # <<<<<<<<<<<<<< * """ * **`get_var_chunk_cache(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.get_var_chunk_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preemption); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3507 * return (size,nelems,preemption) * * def set_var_chunk_cache(self,size=None,nelems=None,preemption=None): # <<<<<<<<<<<<<< * """ * **`set_var_chunk_cache(self,size=None,nelems=None,preemption=None)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_33set_var_chunk_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_32set_var_chunk_cache[] = "\n**`set_var_chunk_cache(self,size=None,nelems=None,preemption=None)`**\n\nchange variable chunk cache settings.\nSee netcdf C library documentation for `nc_set_var_chunk_cache` for\ndetails."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_33set_var_chunk_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_nelems = 0; PyObject *__pyx_v_preemption = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_var_chunk_cache (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_nelems,&__pyx_n_s_preemption,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nelems); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_preemption); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_var_chunk_cache") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_nelems = values[1]; __pyx_v_preemption = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_var_chunk_cache", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.set_var_chunk_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_32set_var_chunk_cache(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_size, __pyx_v_nelems, __pyx_v_preemption); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_32set_var_chunk_cache(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_nelems, PyObject *__pyx_v_preemption) { int __pyx_v_ierr; size_t __pyx_v_sizep; size_t __pyx_v_nelemsp; float __pyx_v_preemptionp; PyObject *__pyx_v_size_orig = NULL; PyObject *__pyx_v_nelems_orig = NULL; PyObject *__pyx_v_preemption_orig = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; size_t __pyx_t_9; float __pyx_t_10; char *__pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_var_chunk_cache", 0); /* "netCDF4/_netCDF4.pyx":3518 * cdef float preemptionp * # reset chunk cache size, leave other parameters unchanged. * size_orig, nelems_orig, preemption_orig = self.get_var_chunk_cache() # <<<<<<<<<<<<<< * if size is not None: * sizep = size */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_var_chunk_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_size_orig = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_nelems_orig = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_preemption_orig = __pyx_t_4; __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3519 * # reset chunk cache size, leave other parameters unchanged. * size_orig, nelems_orig, preemption_orig = self.get_var_chunk_cache() * if size is not None: # <<<<<<<<<<<<<< * sizep = size * else: */ __pyx_t_7 = (__pyx_v_size != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3520 * size_orig, nelems_orig, preemption_orig = self.get_var_chunk_cache() * if size is not None: * sizep = size # <<<<<<<<<<<<<< * else: * sizep = size_orig */ __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_size); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sizep = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":3519 * # reset chunk cache size, leave other parameters unchanged. * size_orig, nelems_orig, preemption_orig = self.get_var_chunk_cache() * if size is not None: # <<<<<<<<<<<<<< * sizep = size * else: */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":3522 * sizep = size * else: * sizep = size_orig # <<<<<<<<<<<<<< * if nelems is not None: * nelemsp = nelems */ /*else*/ { __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_size_orig); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sizep = __pyx_t_9; } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":3523 * else: * sizep = size_orig * if nelems is not None: # <<<<<<<<<<<<<< * nelemsp = nelems * else: */ __pyx_t_8 = (__pyx_v_nelems != Py_None); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":3524 * sizep = size_orig * if nelems is not None: * nelemsp = nelems # <<<<<<<<<<<<<< * else: * nelemsp = nelems_orig */ __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_nelems); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_nelemsp = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":3523 * else: * sizep = size_orig * if nelems is not None: # <<<<<<<<<<<<<< * nelemsp = nelems * else: */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":3526 * nelemsp = nelems * else: * nelemsp = nelems_orig # <<<<<<<<<<<<<< * if preemption is not None: * preemptionp = preemption */ /*else*/ { __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_nelems_orig); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_nelemsp = __pyx_t_9; } __pyx_L6:; /* "netCDF4/_netCDF4.pyx":3527 * else: * nelemsp = nelems_orig * if preemption is not None: # <<<<<<<<<<<<<< * preemptionp = preemption * else: */ __pyx_t_7 = (__pyx_v_preemption != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3528 * nelemsp = nelems_orig * if preemption is not None: * preemptionp = preemption # <<<<<<<<<<<<<< * else: * preemptionp = preemption_orig */ __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_v_preemption); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_preemptionp = __pyx_t_10; /* "netCDF4/_netCDF4.pyx":3527 * else: * nelemsp = nelems_orig * if preemption is not None: # <<<<<<<<<<<<<< * preemptionp = preemption * else: */ goto __pyx_L7; } /* "netCDF4/_netCDF4.pyx":3530 * preemptionp = preemption * else: * preemptionp = preemption_orig # <<<<<<<<<<<<<< * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) */ /*else*/ { __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_v_preemption_orig); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_preemptionp = __pyx_t_10; } __pyx_L7:; /* "netCDF4/_netCDF4.pyx":3531 * else: * preemptionp = preemption_orig * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, # <<<<<<<<<<<<<< * nelemsp, preemptionp) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_set_var_chunk_cache(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_sizep, __pyx_v_nelemsp, __pyx_v_preemptionp); /* "netCDF4/_netCDF4.pyx":3533 * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_8 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3534 * nelemsp, preemptionp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def __delattr__(self,name): */ __pyx_t_11 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_11, 0, strlen(__pyx_t_11), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3533 * ierr = nc_set_var_chunk_cache(self._grpid, self._varid, sizep, * nelemsp, preemptionp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":3507 * return (size,nelems,preemption) * * def set_var_chunk_cache(self,size=None,nelems=None,preemption=None): # <<<<<<<<<<<<<< * """ * **`set_var_chunk_cache(self,size=None,nelems=None,preemption=None)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.set_var_chunk_cache", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size_orig); __Pyx_XDECREF(__pyx_v_nelems_orig); __Pyx_XDECREF(__pyx_v_preemption_orig); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3536 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __delattr__(self,name): # <<<<<<<<<<<<<< * # if it's a netCDF attribute, remove it * if name not in _private_atts: */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_35__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_35__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_34__delattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_34__delattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delattr__", 0); /* "netCDF4/_netCDF4.pyx":3538 * def __delattr__(self,name): * # if it's a netCDF attribute, remove it * if name not in _private_atts: # <<<<<<<<<<<<<< * self.delncattr(name) * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3539 * # if it's a netCDF attribute, remove it * if name not in _private_atts: * self.delncattr(name) # <<<<<<<<<<<<<< * else: * raise AttributeError( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delncattr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_name); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3538 * def __delattr__(self,name): * # if it's a netCDF attribute, remove it * if name not in _private_atts: # <<<<<<<<<<<<<< * self.delncattr(name) * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":3541 * self.delncattr(name) * else: * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * */ /*else*/ { /* "netCDF4/_netCDF4.pyx":3542 * else: * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) # <<<<<<<<<<<<<< * * def __setattr__(self,name,value): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_is_one_of_the_reserved_attrib, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3541 * self.delncattr(name) * else: * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":3536 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __delattr__(self,name): # <<<<<<<<<<<<<< * # if it's a netCDF attribute, remove it * if name not in _private_atts: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3544 * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * * def __setattr__(self,name,value): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_37__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_37__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_36__setattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_name), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_36__setattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PyObject *__pyx_v_msg = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setattr__", 0); __Pyx_INCREF(__pyx_v_value); /* "netCDF4/_netCDF4.pyx":3547 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name not in _private_atts: # <<<<<<<<<<<<<< * # if setting _FillValue or missing_value, make sure value * # has same type as variable. */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3550 * # if setting _FillValue or missing_value, make sure value * # has same type as variable. * if name == '_FillValue': # <<<<<<<<<<<<<< * msg='_FillValue attribute must be set when variable is '+\ * 'created (using fill_value keyword to createVariable)' */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_FillValue, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3551 * # has same type as variable. * if name == '_FillValue': * msg='_FillValue attribute must be set when variable is '+\ # <<<<<<<<<<<<<< * 'created (using fill_value keyword to createVariable)' * raise AttributeError(msg) */ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_FillValue_attribute_must_be_set, __pyx_kp_s_created_using_fill_value_keyword); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_msg = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3553 * msg='_FillValue attribute must be set when variable is '+\ * 'created (using fill_value keyword to createVariable)' * raise AttributeError(msg) # <<<<<<<<<<<<<< * #if self._isprimitive: * # value = numpy.array(value, self.dtype) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_msg); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3550 * # if setting _FillValue or missing_value, make sure value * # has same type as variable. * if name == '_FillValue': # <<<<<<<<<<<<<< * msg='_FillValue attribute must be set when variable is '+\ * 'created (using fill_value keyword to createVariable)' */ } /* "netCDF4/_netCDF4.pyx":3560 * # "VLEN or compound variable" * # raise AttributeError(msg) * elif name == 'missing_value' and self._isprimitive: # <<<<<<<<<<<<<< * value = numpy.array(value, self.dtype) * self.setncattr(name, value) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_missing_value, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3561 * # raise AttributeError(msg) * elif name == 'missing_value' and self._isprimitive: * value = numpy.array(value, self.dtype) # <<<<<<<<<<<<<< * self.setncattr(name, value) * elif not name.endswith('__'): */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_value); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_self->dtype); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3560 * # "VLEN or compound variable" * # raise AttributeError(msg) * elif name == 'missing_value' and self._isprimitive: # <<<<<<<<<<<<<< * value = numpy.array(value, self.dtype) * self.setncattr(name, value) */ } /* "netCDF4/_netCDF4.pyx":3562 * elif name == 'missing_value' and self._isprimitive: * value = numpy.array(value, self.dtype) * self.setncattr(name, value) # <<<<<<<<<<<<<< * elif not name.endswith('__'): * if hasattr(self,name): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setncattr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_name); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_value); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3547 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name not in _private_atts: # <<<<<<<<<<<<<< * # if setting _FillValue or missing_value, make sure value * # has same type as variable. */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":3563 * value = numpy.array(value, self.dtype) * self.setncattr(name, value) * elif not name.endswith('__'): # <<<<<<<<<<<<<< * if hasattr(self,name): * raise AttributeError( */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = ((!__pyx_t_3) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3564 * self.setncattr(name, value) * elif not name.endswith('__'): * if hasattr(self,name): # <<<<<<<<<<<<<< * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) */ __pyx_t_2 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_v_name); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3566 * if hasattr(self,name): * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) # <<<<<<<<<<<<<< * else: * self.__dict__[name]=value */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_is_one_of_the_reserved_attrib_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3565 * elif not name.endswith('__'): * if hasattr(self,name): * raise AttributeError( # <<<<<<<<<<<<<< * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) * else: */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3564 * self.setncattr(name, value) * elif not name.endswith('__'): * if hasattr(self,name): # <<<<<<<<<<<<<< * raise AttributeError( * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) */ } /* "netCDF4/_netCDF4.pyx":3568 * "'%s' is one of the reserved attributes %s, cannot rebind. Use setncattr instead." % (name, tuple(_private_atts))) * else: * self.__dict__[name]=value # <<<<<<<<<<<<<< * * def __getattr__(self,name): */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } /* "netCDF4/_netCDF4.pyx":3563 * value = numpy.array(value, self.dtype) * self.setncattr(name, value) * elif not name.endswith('__'): # <<<<<<<<<<<<<< * if hasattr(self,name): * raise AttributeError( */ } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":3544 * "'%s' is one of the reserved attributes %s, cannot delete. Use delncattr instead." % (name, tuple(_private_atts))) * * def __setattr__(self,name,value): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_value); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3570 * self.__dict__[name]=value * * def __getattr__(self,name): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_39__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_39__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_38__getattr__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_38__getattr__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_name) { PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_values = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); __Pyx_INCREF(__pyx_v_name); /* "netCDF4/_netCDF4.pyx":3573 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<< * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3575 * if name.startswith('__') and name.endswith('__'): * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': # <<<<<<<<<<<<<< * names = self.ncattrs() * values = [] */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_dict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3576 * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': * names = self.ncattrs() # <<<<<<<<<<<<<< * values = [] * for name in names: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3576; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_names = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3577 * if name == '__dict__': * names = self.ncattrs() * values = [] # <<<<<<<<<<<<<< * for name in names: * values.append(_get_att(self._grp, self._varid, name)) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_v_values = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3578 * names = self.ncattrs() * values = [] * for name in names: # <<<<<<<<<<<<<< * values.append(_get_att(self._grp, self._varid, name)) * return OrderedDict(zip(names,values)) */ if (likely(PyList_CheckExact(__pyx_v_names)) || PyTuple_CheckExact(__pyx_v_names)) { __pyx_t_2 = __pyx_v_names; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3579 * values = [] * for name in names: * values.append(_get_att(self._grp, self._varid, name)) # <<<<<<<<<<<<<< * return OrderedDict(zip(names,values)) * else: */ __pyx_t_3 = __pyx_v_self->_grp; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__get_att(__pyx_t_3, __pyx_v_self->_varid, __pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3578 * names = self.ncattrs() * values = [] * for name in names: # <<<<<<<<<<<<<< * values.append(_get_att(self._grp, self._varid, name)) * return OrderedDict(zip(names,values)) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3580 * for name in names: * values.append(_get_att(self._grp, self._varid, name)) * return OrderedDict(zip(names,values)) # <<<<<<<<<<<<<< * else: * raise AttributeError */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_6 = 1; } } __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_names); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_v_values); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_9) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3575 * if name.startswith('__') and name.endswith('__'): * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': # <<<<<<<<<<<<<< * names = self.ncattrs() * values = [] */ } /* "netCDF4/_netCDF4.pyx":3582 * return OrderedDict(zip(names,values)) * else: * raise AttributeError # <<<<<<<<<<<<<< * elif name in _private_atts: * return self.__dict__[name] */ /*else*/ { __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":3573 * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. * if name.startswith('__') and name.endswith('__'): # <<<<<<<<<<<<<< * # if __dict__ requested, return a dict with netCDF attributes. * if name == '__dict__': */ } /* "netCDF4/_netCDF4.pyx":3583 * else: * raise AttributeError * elif name in _private_atts: # <<<<<<<<<<<<<< * return self.__dict__[name] * else: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_private_atts); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":3584 * raise AttributeError * elif name in _private_atts: * return self.__dict__[name] # <<<<<<<<<<<<<< * else: * return self.getncattr(name) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_GetItem(__pyx_t_2, __pyx_v_name); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3583 * else: * raise AttributeError * elif name in _private_atts: # <<<<<<<<<<<<<< * return self.__dict__[name] * else: */ } /* "netCDF4/_netCDF4.pyx":3586 * return self.__dict__[name] * else: * return self.getncattr(name) # <<<<<<<<<<<<<< * * def renameAttribute(self, oldname, newname): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getncattr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_11) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __pyx_t_11 = NULL; __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_name); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3570 * self.__dict__[name]=value * * def __getattr__(self,name): # <<<<<<<<<<<<<< * # if name in _private_atts, it is stored at the python * # level and not in the netCDF file. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_values); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3588 * return self.getncattr(name) * * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameAttribute(self, oldname, newname)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_41renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_40renameAttribute[] = "\n**`renameAttribute(self, oldname, newname)`**\n\nrename a `netCDF4.Variable` attribute named `oldname` to `newname`."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_41renameAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_oldname = 0; PyObject *__pyx_v_newname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renameAttribute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_oldname,&__pyx_n_s_newname,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_oldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_newname)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("renameAttribute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renameAttribute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_oldname = values[0]; __pyx_v_newname = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renameAttribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3588; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.renameAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_40renameAttribute(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_oldname, __pyx_v_newname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_40renameAttribute(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_oldname, PyObject *__pyx_v_newname) { int __pyx_v_ierr; char *__pyx_v_oldnamec; char *__pyx_v_newnamec; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renameAttribute", 0); /* "netCDF4/_netCDF4.pyx":3596 * cdef char *oldnamec * cdef char *newnamec * bytestr = _strencode(oldname) # <<<<<<<<<<<<<< * oldnamec = bytestr * bytestr = _strencode(newname) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_oldname, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3597 * cdef char *newnamec * bytestr = _strencode(oldname) * oldnamec = bytestr # <<<<<<<<<<<<<< * bytestr = _strencode(newname) * newnamec = bytestr */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_oldnamec = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":3598 * bytestr = _strencode(oldname) * oldnamec = bytestr * bytestr = _strencode(newname) # <<<<<<<<<<<<<< * newnamec = bytestr * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_newname, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3599 * oldnamec = bytestr * bytestr = _strencode(newname) * newnamec = bytestr # <<<<<<<<<<<<<< * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) * if ierr != NC_NOERR: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_newnamec = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":3600 * bytestr = _strencode(newname) * newnamec = bytestr * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_rename_att(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_oldnamec, __pyx_v_newnamec); /* "netCDF4/_netCDF4.pyx":3601 * newnamec = bytestr * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3602 * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * * def __getitem__(self, elem): */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3601 * newnamec = bytestr * ierr = nc_rename_att(self._grpid, self._varid, oldnamec, newnamec) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * */ } /* "netCDF4/_netCDF4.pyx":3588 * return self.getncattr(name) * * def renameAttribute(self, oldname, newname): # <<<<<<<<<<<<<< * """ * **`renameAttribute(self, oldname, newname)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.renameAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3604 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __getitem__(self, elem): # <<<<<<<<<<<<<< * # This special method is used to index the netCDF variable * # using the "extended slice syntax". The extended slice syntax */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_43__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_43__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_42__getitem__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_elem)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_42__getitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem) { PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_count = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_put_ind = NULL; PyObject *__pyx_v_datashape = NULL; PyObject *__pyx_v_data = NULL; PyObject *__pyx_v_squeeze = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_datout = NULL; PyObject *__pyx_v_shape = NULL; int __pyx_v_valid_scaleoffset; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; PyObject *__pyx_t_12 = NULL; Py_ssize_t __pyx_t_13; int __pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; double __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "netCDF4/_netCDF4.pyx":3610 * # arguments to the nc_get_var() function, and is much more easy * # to use. * start, count, stride, put_ind = _StartCountStride(elem,self.shape) # <<<<<<<<<<<<<< * datashape = _out_array_shape(count) * if self._isvlen: */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_StartCountStride); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_elem); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_4 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_3,&__pyx_t_4}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_3,&__pyx_t_4}; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } __pyx_v_start = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_count = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_stride = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_put_ind = __pyx_t_4; __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3611 * # to use. * start, count, stride, put_ind = _StartCountStride(elem,self.shape) * datashape = _out_array_shape(count) # <<<<<<<<<<<<<< * if self._isvlen: * data = numpy.empty(datashape, dtype='O') */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_out_array_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_count); __Pyx_GIVEREF(__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_count); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_datashape = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3612 * start, count, stride, put_ind = _StartCountStride(elem,self.shape) * datashape = _out_array_shape(count) * if self._isvlen: # <<<<<<<<<<<<<< * data = numpy.empty(datashape, dtype='O') * else: */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3613 * datashape = _out_array_shape(count) * if self._isvlen: * data = numpy.empty(datashape, dtype='O') # <<<<<<<<<<<<<< * else: * data = numpy.empty(datashape, dtype=self.dtype) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_datashape); __Pyx_GIVEREF(__pyx_v_datashape); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_datashape); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_n_s_O) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_data = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3612 * start, count, stride, put_ind = _StartCountStride(elem,self.shape) * datashape = _out_array_shape(count) * if self._isvlen: # <<<<<<<<<<<<<< * data = numpy.empty(datashape, dtype='O') * else: */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":3615 * data = numpy.empty(datashape, dtype='O') * else: * data = numpy.empty(datashape, dtype=self.dtype) # <<<<<<<<<<<<<< * * # Determine which dimensions need to be */ /*else*/ { __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_datashape); __Pyx_GIVEREF(__pyx_v_datashape); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_datashape); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_data = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":3621 * # The convention used is that for those cases, * # put_ind for this dimension is set to -1 by _StartCountStride. * squeeze = data.ndim * [slice(None),] # <<<<<<<<<<<<<< * for i,n in enumerate(put_ind.shape[:-1]): * if n == 1 and put_ind[...,i].ravel()[0] == -1: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_slice__53); __Pyx_GIVEREF(__pyx_slice__53); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_slice__53); __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_squeeze = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3622 * # put_ind for this dimension is set to -1 by _StartCountStride. * squeeze = data.ndim * [slice(None),] * for i,n in enumerate(put_ind.shape[:-1]): # <<<<<<<<<<<<<< * if n == 1 and put_ind[...,i].ravel()[0] == -1: * squeeze[i] = 0 */ __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_slice__54, 0, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_10 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3623 * squeeze = data.ndim * [slice(None),] * for i,n in enumerate(put_ind.shape[:-1]): * if n == 1 and put_ind[...,i].ravel()[0] == -1: # <<<<<<<<<<<<<< * squeeze[i] = 0 * */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_11) { } else { __pyx_t_9 = __pyx_t_11; goto __pyx_L9_bool_binop_done; } __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_Ellipsis); __Pyx_GIVEREF(Py_Ellipsis); PyTuple_SET_ITEM(__pyx_t_6, 0, Py_Ellipsis); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_i); __pyx_t_2 = PyObject_GetItem(__pyx_v_put_ind, __pyx_t_6); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __pyx_t_11; __pyx_L9_bool_binop_done:; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3624 * for i,n in enumerate(put_ind.shape[:-1]): * if n == 1 and put_ind[...,i].ravel()[0] == -1: * squeeze[i] = 0 # <<<<<<<<<<<<<< * * # Reshape the arrays so we can iterate over them. */ if (unlikely(PyObject_SetItem(__pyx_v_squeeze, __pyx_v_i, __pyx_int_0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3623 * squeeze = data.ndim * [slice(None),] * for i,n in enumerate(put_ind.shape[:-1]): * if n == 1 and put_ind[...,i].ravel()[0] == -1: # <<<<<<<<<<<<<< * squeeze[i] = 0 * */ } /* "netCDF4/_netCDF4.pyx":3622 * # put_ind for this dimension is set to -1 by _StartCountStride. * squeeze = data.ndim * [slice(None),] * for i,n in enumerate(put_ind.shape[:-1]): # <<<<<<<<<<<<<< * if n == 1 and put_ind[...,i].ravel()[0] == -1: * squeeze[i] = 0 */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3627 * * # Reshape the arrays so we can iterate over them. * start = start.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_start, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_9) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_4 = __pyx_v_self->ndim; goto __pyx_L11_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L11_bool_binop_done:; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3628 * # Reshape the arrays so we can iterate over them. * start = start.reshape((-1, self.ndim or 1)) * count = count.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * stride = stride.reshape((-1, self.ndim or 1)) * put_ind = put_ind.reshape((-1, self.ndim or 1)) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_count, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_9) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_2 = __pyx_v_self->ndim; goto __pyx_L13_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L13_bool_binop_done:; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3629 * start = start.reshape((-1, self.ndim or 1)) * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * put_ind = put_ind.reshape((-1, self.ndim or 1)) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stride, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_9) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_4 = __pyx_v_self->ndim; goto __pyx_L15_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L15_bool_binop_done:; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_4) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_stride, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3630 * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) * put_ind = put_ind.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * * # Fill output array with data chunks. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_9) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_2 = __pyx_v_self->ndim; goto __pyx_L17_bool_binop_done; } __pyx_t_6 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L17_bool_binop_done:; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_put_ind, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3633 * * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): # <<<<<<<<<<<<<< * datout = self._get(a,b,c) * if not hasattr(datout,'shape') or data.shape == datout.shape: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start); __Pyx_INCREF(__pyx_v_count); __Pyx_GIVEREF(__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_count); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_stride); __Pyx_INCREF(__pyx_v_put_ind); __Pyx_GIVEREF(__pyx_v_put_ind); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_put_ind); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_10 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_10(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_3); } if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_2 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_4,&__pyx_t_2,&__pyx_t_7}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_4,&__pyx_t_2,&__pyx_t_7}; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_12)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_8(__pyx_t_12); if (unlikely(!item)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_12), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L22_unpacking_done; __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L22_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3634 * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): * datout = self._get(a,b,c) # <<<<<<<<<<<<<< * if not hasattr(datout,'shape') or data.shape == datout.shape: * data = datout */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_13 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_13 = 1; } } __pyx_t_4 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_13, __pyx_v_a); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_13, __pyx_v_b); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_13, __pyx_v_c); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_datout, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3635 * for (a,b,c,i) in zip(start, count, stride, put_ind): * datout = self._get(a,b,c) * if not hasattr(datout,'shape') or data.shape == datout.shape: # <<<<<<<<<<<<<< * data = datout * else: */ __pyx_t_11 = PyObject_HasAttr(__pyx_v_datout, __pyx_n_s_shape); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((!(__pyx_t_11 != 0)) != 0); if (!__pyx_t_14) { } else { __pyx_t_9 = __pyx_t_14; goto __pyx_L24_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datout, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __pyx_t_14; __pyx_L24_bool_binop_done:; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3636 * datout = self._get(a,b,c) * if not hasattr(datout,'shape') or data.shape == datout.shape: * data = datout # <<<<<<<<<<<<<< * else: * shape = getattr(data[tuple(i)], 'shape', ()) */ __Pyx_INCREF(__pyx_v_datout); __Pyx_DECREF_SET(__pyx_v_data, __pyx_v_datout); /* "netCDF4/_netCDF4.pyx":3635 * for (a,b,c,i) in zip(start, count, stride, put_ind): * datout = self._get(a,b,c) * if not hasattr(datout,'shape') or data.shape == datout.shape: # <<<<<<<<<<<<<< * data = datout * else: */ goto __pyx_L23; } /* "netCDF4/_netCDF4.pyx":3638 * data = datout * else: * shape = getattr(data[tuple(i)], 'shape', ()) # <<<<<<<<<<<<<< * if self._isvlen and not len(self.dimensions): * # special case of scalar VLEN */ /*else*/ { __pyx_t_4 = PySequence_Tuple(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_GetItem(__pyx_v_data, __pyx_t_4); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_shape, __pyx_empty_tuple); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_shape, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3639 * else: * shape = getattr(data[tuple(i)], 'shape', ()) * if self._isvlen and not len(self.dimensions): # <<<<<<<<<<<<<< * # special case of scalar VLEN * data[0] = datout */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_14) { } else { __pyx_t_9 = __pyx_t_14; goto __pyx_L27_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = ((!(__pyx_t_13 != 0)) != 0); __pyx_t_9 = __pyx_t_14; __pyx_L27_bool_binop_done:; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3641 * if self._isvlen and not len(self.dimensions): * # special case of scalar VLEN * data[0] = datout # <<<<<<<<<<<<<< * else: * data[tuple(i)] = datout.reshape(shape) */ if (unlikely(__Pyx_SetItemInt(__pyx_v_data, 0, __pyx_v_datout, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3639 * else: * shape = getattr(data[tuple(i)], 'shape', ()) * if self._isvlen and not len(self.dimensions): # <<<<<<<<<<<<<< * # special case of scalar VLEN * data[0] = datout */ goto __pyx_L26; } /* "netCDF4/_netCDF4.pyx":3643 * data[0] = datout * else: * data[tuple(i)] = datout.reshape(shape) # <<<<<<<<<<<<<< * * # Remove extra singleton dimensions. */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_datout, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_3) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_shape); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PySequence_Tuple(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (unlikely(PyObject_SetItem(__pyx_v_data, __pyx_t_7, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L26:; } __pyx_L23:; /* "netCDF4/_netCDF4.pyx":3633 * * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): # <<<<<<<<<<<<<< * datout = self._get(a,b,c) * if not hasattr(datout,'shape') or data.shape == datout.shape: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3646 * * # Remove extra singleton dimensions. * if hasattr(data,'shape'): # <<<<<<<<<<<<<< * data = data[tuple(squeeze)] * if hasattr(data,'ndim') and self.ndim == 0: */ __pyx_t_9 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = (__pyx_t_9 != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3647 * # Remove extra singleton dimensions. * if hasattr(data,'shape'): * data = data[tuple(squeeze)] # <<<<<<<<<<<<<< * if hasattr(data,'ndim') and self.ndim == 0: * # Make sure a numpy scalar array is returned instead of a 1-d array of */ __pyx_t_1 = PySequence_Tuple(__pyx_v_squeeze); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetItem(__pyx_v_data, __pyx_t_1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3646 * * # Remove extra singleton dimensions. * if hasattr(data,'shape'): # <<<<<<<<<<<<<< * data = data[tuple(squeeze)] * if hasattr(data,'ndim') and self.ndim == 0: */ } /* "netCDF4/_netCDF4.pyx":3648 * if hasattr(data,'shape'): * data = data[tuple(squeeze)] * if hasattr(data,'ndim') and self.ndim == 0: # <<<<<<<<<<<<<< * # Make sure a numpy scalar array is returned instead of a 1-d array of * # length 1. */ __pyx_t_9 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = (__pyx_t_9 != 0); if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L31_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_self->ndim, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __pyx_t_11; __pyx_L31_bool_binop_done:; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3651 * # Make sure a numpy scalar array is returned instead of a 1-d array of * # length 1. * if data.ndim != 0: data = numpy.asarray(data[0]) # <<<<<<<<<<<<<< * * # if auto_scale mode set to True, (through */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_14) { __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3648 * if hasattr(data,'shape'): * data = data[tuple(squeeze)] * if hasattr(data,'ndim') and self.ndim == 0: # <<<<<<<<<<<<<< * # Make sure a numpy scalar array is returned instead of a 1-d array of * # length 1. */ } /* "netCDF4/_netCDF4.pyx":3661 * # missing_value/_Fill_Value. * # ignore for compound, vlen or enum datatypes. * try: # check to see if scale_factor and add_offset is valid (issue 176). # <<<<<<<<<<<<<< * if hasattr(self,'scale_factor'): float(self.scale_factor) * if hasattr(self,'add_offset'): float(self.add_offset) */ { __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "netCDF4/_netCDF4.pyx":3662 * # ignore for compound, vlen or enum datatypes. * try: # check to see if scale_factor and add_offset is valid (issue 176). * if hasattr(self,'scale_factor'): float(self.scale_factor) # <<<<<<<<<<<<<< * if hasattr(self,'add_offset'): float(self.add_offset) * valid_scaleoffset = True */ __pyx_t_14 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __pyx_t_11 = (__pyx_t_14 != 0); if (__pyx_t_11) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_18 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3662; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3663 * try: # check to see if scale_factor and add_offset is valid (issue 176). * if hasattr(self,'scale_factor'): float(self.scale_factor) * if hasattr(self,'add_offset'): float(self.add_offset) # <<<<<<<<<<<<<< * valid_scaleoffset = True * except: */ __pyx_t_11 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __pyx_t_14 = (__pyx_t_11 != 0); if (__pyx_t_14) { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_18 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L34_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":3664 * if hasattr(self,'scale_factor'): float(self.scale_factor) * if hasattr(self,'add_offset'): float(self.add_offset) * valid_scaleoffset = True # <<<<<<<<<<<<<< * except: * valid_scaleoffset = False */ __pyx_v_valid_scaleoffset = 1; /* "netCDF4/_netCDF4.pyx":3661 * # missing_value/_Fill_Value. * # ignore for compound, vlen or enum datatypes. * try: # check to see if scale_factor and add_offset is valid (issue 176). # <<<<<<<<<<<<<< * if hasattr(self,'scale_factor'): float(self.scale_factor) * if hasattr(self,'add_offset'): float(self.add_offset) */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L41_try_end; __pyx_L34_error:; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3665 * if hasattr(self,'add_offset'): float(self.add_offset) * valid_scaleoffset = True * except: # <<<<<<<<<<<<<< * valid_scaleoffset = False * if self.scale: */ /*except:*/ { __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3665; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_3); /* "netCDF4/_netCDF4.pyx":3666 * valid_scaleoffset = True * except: * valid_scaleoffset = False # <<<<<<<<<<<<<< * if self.scale: * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' */ __pyx_v_valid_scaleoffset = 0; /* "netCDF4/_netCDF4.pyx":3667 * except: * valid_scaleoffset = False * if self.scale: # <<<<<<<<<<<<<< * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' * warnings.warn(msg) */ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3668 * valid_scaleoffset = False * if self.scale: * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' # <<<<<<<<<<<<<< * warnings.warn(msg) * if self.mask and (self._isprimitive or self._isenum): */ __Pyx_INCREF(__pyx_kp_s_invalid_scale_factor_or_add_offs); __pyx_v_msg = __pyx_kp_s_invalid_scale_factor_or_add_offs; /* "netCDF4/_netCDF4.pyx":3669 * if self.scale: * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' * warnings.warn(msg) # <<<<<<<<<<<<<< * if self.mask and (self._isprimitive or self._isenum): * data = self._toma(data) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (!__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_msg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_msg); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3667 * except: * valid_scaleoffset = False * if self.scale: # <<<<<<<<<<<<<< * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' * warnings.warn(msg) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L35_exception_handled; } __pyx_L36_except_error:; /* "netCDF4/_netCDF4.pyx":3661 * # missing_value/_Fill_Value. * # ignore for compound, vlen or enum datatypes. * try: # check to see if scale_factor and add_offset is valid (issue 176). # <<<<<<<<<<<<<< * if hasattr(self,'scale_factor'): float(self.scale_factor) * if hasattr(self,'add_offset'): float(self.add_offset) */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L1_error; __pyx_L35_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_L41_try_end:; } /* "netCDF4/_netCDF4.pyx":3670 * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' * warnings.warn(msg) * if self.mask and (self._isprimitive or self._isenum): # <<<<<<<<<<<<<< * data = self._toma(data) * if self.scale and self._isprimitive and valid_scaleoffset: */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->mask); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L48_bool_binop_done; } __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L48_bool_binop_done; } __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = __pyx_t_11; __pyx_L48_bool_binop_done:; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3671 * warnings.warn(msg) * if self.mask and (self._isprimitive or self._isenum): * data = self._toma(data) # <<<<<<<<<<<<<< * if self.scale and self._isprimitive and valid_scaleoffset: * # if variable has scale_factor and add_offset attributes, rescale. */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toma); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_data); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3670 * msg = 'invalid scale_factor or add_offset attribute, no unpacking done...' * warnings.warn(msg) * if self.mask and (self._isprimitive or self._isenum): # <<<<<<<<<<<<<< * data = self._toma(data) * if self.scale and self._isprimitive and valid_scaleoffset: */ } /* "netCDF4/_netCDF4.pyx":3672 * if self.mask and (self._isprimitive or self._isenum): * data = self._toma(data) * if self.scale and self._isprimitive and valid_scaleoffset: # <<<<<<<<<<<<<< * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ */ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L52_bool_binop_done; } __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3672; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L52_bool_binop_done; } __pyx_t_11 = (__pyx_v_valid_scaleoffset != 0); __pyx_t_14 = __pyx_t_11; __pyx_L52_bool_binop_done:; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3674 * if self.scale and self._isprimitive and valid_scaleoffset: * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ # <<<<<<<<<<<<<< * (self.add_offset != 0.0 or self.scale_factor != 1.0): * data = data*self.scale_factor + self.add_offset */ __pyx_t_11 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_11 != 0); if (__pyx_t_9) { } else { __pyx_t_14 = __pyx_t_9; goto __pyx_L56_bool_binop_done; } __pyx_t_9 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = (__pyx_t_9 != 0); if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L56_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":3675 * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ * (self.add_offset != 0.0 or self.scale_factor != 1.0): # <<<<<<<<<<<<<< * data = data*self.scale_factor + self.add_offset * # else if variable has only scale_factor attributes, rescale. */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_float_0_0, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L56_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_float_1_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = __pyx_t_11; __pyx_L56_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3674 * if self.scale and self._isprimitive and valid_scaleoffset: * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ # <<<<<<<<<<<<<< * (self.add_offset != 0.0 or self.scale_factor != 1.0): * data = data*self.scale_factor + self.add_offset */ if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3676 * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ * (self.add_offset != 0.0 or self.scale_factor != 1.0): * data = data*self.scale_factor + self.add_offset # <<<<<<<<<<<<<< * # else if variable has only scale_factor attributes, rescale. * elif hasattr(self, 'scale_factor') and self.scale_factor != 1.0: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Multiply(__pyx_v_data, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3674 * if self.scale and self._isprimitive and valid_scaleoffset: * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ # <<<<<<<<<<<<<< * (self.add_offset != 0.0 or self.scale_factor != 1.0): * data = data*self.scale_factor + self.add_offset */ goto __pyx_L55; } /* "netCDF4/_netCDF4.pyx":3678 * data = data*self.scale_factor + self.add_offset * # else if variable has only scale_factor attributes, rescale. * elif hasattr(self, 'scale_factor') and self.scale_factor != 1.0: # <<<<<<<<<<<<<< * data = data*self.scale_factor * # else if variable has only add_offset attributes, rescale. */ __pyx_t_11 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_11 != 0); if (__pyx_t_9) { } else { __pyx_t_14 = __pyx_t_9; goto __pyx_L60_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_float_1_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = __pyx_t_9; __pyx_L60_bool_binop_done:; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3679 * # else if variable has only scale_factor attributes, rescale. * elif hasattr(self, 'scale_factor') and self.scale_factor != 1.0: * data = data*self.scale_factor # <<<<<<<<<<<<<< * # else if variable has only add_offset attributes, rescale. * elif hasattr(self, 'add_offset') and self.add_offset != 0.0: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Multiply(__pyx_v_data, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3678 * data = data*self.scale_factor + self.add_offset * # else if variable has only scale_factor attributes, rescale. * elif hasattr(self, 'scale_factor') and self.scale_factor != 1.0: # <<<<<<<<<<<<<< * data = data*self.scale_factor * # else if variable has only add_offset attributes, rescale. */ goto __pyx_L55; } /* "netCDF4/_netCDF4.pyx":3681 * data = data*self.scale_factor * # else if variable has only add_offset attributes, rescale. * elif hasattr(self, 'add_offset') and self.add_offset != 0.0: # <<<<<<<<<<<<<< * data = data + self.add_offset * return data */ __pyx_t_9 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = (__pyx_t_9 != 0); if (__pyx_t_11) { } else { __pyx_t_14 = __pyx_t_11; goto __pyx_L62_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_float_0_0, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3681; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = __pyx_t_11; __pyx_L62_bool_binop_done:; if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":3682 * # else if variable has only add_offset attributes, rescale. * elif hasattr(self, 'add_offset') and self.add_offset != 0.0: * data = data + self.add_offset # <<<<<<<<<<<<<< * return data * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyNumber_Add(__pyx_v_data, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":3681 * data = data*self.scale_factor * # else if variable has only add_offset attributes, rescale. * elif hasattr(self, 'add_offset') and self.add_offset != 0.0: # <<<<<<<<<<<<<< * data = data + self.add_offset * return data */ } __pyx_L55:; /* "netCDF4/_netCDF4.pyx":3672 * if self.mask and (self._isprimitive or self._isenum): * data = self._toma(data) * if self.scale and self._isprimitive and valid_scaleoffset: # <<<<<<<<<<<<<< * # if variable has scale_factor and add_offset attributes, rescale. * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset') and\ */ } /* "netCDF4/_netCDF4.pyx":3683 * elif hasattr(self, 'add_offset') and self.add_offset != 0.0: * data = data + self.add_offset * return data # <<<<<<<<<<<<<< * * def _toma(self,data): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); __pyx_r = __pyx_v_data; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3604 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * * def __getitem__(self, elem): # <<<<<<<<<<<<<< * # This special method is used to index the netCDF variable * # using the "extended slice syntax". The extended slice syntax */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_count); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_put_ind); __Pyx_XDECREF(__pyx_v_datashape); __Pyx_XDECREF(__pyx_v_data); __Pyx_XDECREF(__pyx_v_squeeze); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_datout); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3685 * return data * * def _toma(self,data): # <<<<<<<<<<<<<< * cdef int ierr, no_fill * # private function for creating a masked array, masking missing_values */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_45_toma(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_45_toma(PyObject *__pyx_v_self, PyObject *__pyx_v_data) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_toma (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_44_toma(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_data)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_44_toma(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_data) { int __pyx_v_ierr; int __pyx_v_no_fill; PyObject *__pyx_v_totalmask = NULL; PyObject *__pyx_v_fill_value = NULL; PyObject *__pyx_v_mval = NULL; PyObject *__pyx_v_hasmval = NULL; PyObject *__pyx_v_mvalisnan = NULL; PyObject *__pyx_v_m = NULL; PyObject *__pyx_v_mask = NULL; PyObject *__pyx_v_fval = NULL; PyObject *__pyx_v_fvalisnan = NULL; PyObject *__pyx_v_fillval = NULL; PyObject *__pyx_v_has_fillval = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); char *__pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_toma", 0); __Pyx_INCREF(__pyx_v_data); /* "netCDF4/_netCDF4.pyx":3689 * # private function for creating a masked array, masking missing_values * # and/or _FillValues. * totalmask = numpy.zeros(data.shape, numpy.bool) # <<<<<<<<<<<<<< * fill_value = None * if hasattr(self, 'missing_value'): */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_totalmask = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3690 * # and/or _FillValues. * totalmask = numpy.zeros(data.shape, numpy.bool) * fill_value = None # <<<<<<<<<<<<<< * if hasattr(self, 'missing_value'): * mval = numpy.array(self.missing_value, self.dtype) */ __Pyx_INCREF(Py_None); __pyx_v_fill_value = Py_None; /* "netCDF4/_netCDF4.pyx":3691 * totalmask = numpy.zeros(data.shape, numpy.bool) * fill_value = None * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<< * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ */ __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3692 * fill_value = None * if hasattr(self, 'missing_value'): * mval = numpy.array(self.missing_value, self.dtype) # <<<<<<<<<<<<<< * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_6 = 1; } } __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_v_self->dtype); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_mval = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3693 * if hasattr(self, 'missing_value'): * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_big, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { goto __pyx_L6_next_or; } else { } __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L5_bool_binop_done; } __pyx_L6_next_or:; /* "netCDF4/_netCDF4.pyx":3694 * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): # <<<<<<<<<<<<<< * mval.byteswap(True) * if mval.shape == (): # mval a scalar. */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_little, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __pyx_t_8; __pyx_L5_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3693 * if hasattr(self, 'missing_value'): * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) */ if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3695 * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) # <<<<<<<<<<<<<< * if mval.shape == (): # mval a scalar. * hasmval = data==mval */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mval, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3693 * if hasattr(self, 'missing_value'): * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":3696 * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) * if mval.shape == (): # mval a scalar. # <<<<<<<<<<<<<< * hasmval = data==mval * # is scalar missing value a NaN? */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_mval, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3697 * mval.byteswap(True) * if mval.shape == (): # mval a scalar. * hasmval = data==mval # <<<<<<<<<<<<<< * # is scalar missing value a NaN? * try: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_data, __pyx_v_mval, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_hasmval = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3699 * hasmval = data==mval * # is scalar missing value a NaN? * try: # <<<<<<<<<<<<<< * mvalisnan = numpy.isnan(mval) * except TypeError: # isnan fails on some dtypes (issue 206) */ { __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "netCDF4/_netCDF4.pyx":3700 * # is scalar missing value a NaN? * try: * mvalisnan = numpy.isnan(mval) # <<<<<<<<<<<<<< * except TypeError: # isnan fails on some dtypes (issue 206) * mvalisnan = False */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L10_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L10_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_7) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_mval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L10_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L10_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_mval); __Pyx_GIVEREF(__pyx_v_mval); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_mval); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L10_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_mvalisnan = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3699 * hasmval = data==mval * # is scalar missing value a NaN? * try: # <<<<<<<<<<<<<< * mvalisnan = numpy.isnan(mval) * except TypeError: # isnan fails on some dtypes (issue 206) */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L17_try_end; __pyx_L10_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3701 * try: * mvalisnan = numpy.isnan(mval) * except TypeError: # isnan fails on some dtypes (issue 206) # <<<<<<<<<<<<<< * mvalisnan = False * else: # mval a vector. */ __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_13) { __Pyx_AddTraceback("netCDF4._netCDF4.Variable._toma", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); /* "netCDF4/_netCDF4.pyx":3702 * mvalisnan = numpy.isnan(mval) * except TypeError: # isnan fails on some dtypes (issue 206) * mvalisnan = False # <<<<<<<<<<<<<< * else: # mval a vector. * hasmval = numpy.zeros(data.shape, numpy.bool) */ __Pyx_INCREF(Py_False); __Pyx_XDECREF_SET(__pyx_v_mvalisnan, Py_False); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L11_exception_handled; } goto __pyx_L12_except_error; __pyx_L12_except_error:; /* "netCDF4/_netCDF4.pyx":3699 * hasmval = data==mval * # is scalar missing value a NaN? * try: # <<<<<<<<<<<<<< * mvalisnan = numpy.isnan(mval) * except TypeError: # isnan fails on some dtypes (issue 206) */ __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L11_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L17_try_end:; } /* "netCDF4/_netCDF4.pyx":3696 * (self.endian() == 'little' and is_native_big): * mval.byteswap(True) * if mval.shape == (): # mval a scalar. # <<<<<<<<<<<<<< * hasmval = data==mval * # is scalar missing value a NaN? */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":3704 * mvalisnan = False * else: # mval a vector. * hasmval = numpy.zeros(data.shape, numpy.bool) # <<<<<<<<<<<<<< * for m in mval: * m = numpy.array(m) */ /*else*/ { __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_bool); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_hasmval = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3705 * else: # mval a vector. * hasmval = numpy.zeros(data.shape, numpy.bool) * for m in mval: # <<<<<<<<<<<<<< * m = numpy.array(m) * hasmval += data == m */ if (likely(PyList_CheckExact(__pyx_v_mval)) || PyTuple_CheckExact(__pyx_v_mval)) { __pyx_t_3 = __pyx_v_mval; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_14 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_mval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_14)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3706 * hasmval = numpy.zeros(data.shape, numpy.bool) * for m in mval: * m = numpy.array(m) # <<<<<<<<<<<<<< * hasmval += data == m * if mval.shape == () and mvalisnan: */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_m); __Pyx_GIVEREF(__pyx_v_m); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_m); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3707 * for m in mval: * m = numpy.array(m) * hasmval += data == m # <<<<<<<<<<<<<< * if mval.shape == () and mvalisnan: * mask = numpy.isnan(data) */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_data, __pyx_v_m, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_hasmval, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_hasmval, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3705 * else: # mval a vector. * hasmval = numpy.zeros(data.shape, numpy.bool) * for m in mval: # <<<<<<<<<<<<<< * m = numpy.array(m) * hasmval += data == m */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":3708 * m = numpy.array(m) * hasmval += data == m * if mval.shape == () and mvalisnan: # <<<<<<<<<<<<<< * mask = numpy.isnan(data) * elif hasmval.any(): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mval, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L23_bool_binop_done; } if (unlikely(!__pyx_v_mvalisnan)) { __Pyx_RaiseUnboundLocalError("mvalisnan"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_mvalisnan); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __pyx_t_8; __pyx_L23_bool_binop_done:; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3709 * hasmval += data == m * if mval.shape == () and mvalisnan: * mask = numpy.isnan(data) # <<<<<<<<<<<<<< * elif hasmval.any(): * mask = hasmval */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isnan); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_data); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mask = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3708 * m = numpy.array(m) * hasmval += data == m * if mval.shape == () and mvalisnan: # <<<<<<<<<<<<<< * mask = numpy.isnan(data) * elif hasmval.any(): */ goto __pyx_L22; } /* "netCDF4/_netCDF4.pyx":3710 * if mval.shape == () and mvalisnan: * mask = numpy.isnan(data) * elif hasmval.any(): # <<<<<<<<<<<<<< * mask = hasmval * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hasmval, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3711 * mask = numpy.isnan(data) * elif hasmval.any(): * mask = hasmval # <<<<<<<<<<<<<< * else: * mask = None */ __Pyx_INCREF(__pyx_v_hasmval); __pyx_v_mask = __pyx_v_hasmval; /* "netCDF4/_netCDF4.pyx":3710 * if mval.shape == () and mvalisnan: * mask = numpy.isnan(data) * elif hasmval.any(): # <<<<<<<<<<<<<< * mask = hasmval * else: */ goto __pyx_L22; } /* "netCDF4/_netCDF4.pyx":3713 * mask = hasmval * else: * mask = None # <<<<<<<<<<<<<< * if mask is not None: * fill_value = mval */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_mask = Py_None; } __pyx_L22:; /* "netCDF4/_netCDF4.pyx":3714 * else: * mask = None * if mask is not None: # <<<<<<<<<<<<<< * fill_value = mval * totalmask += mask */ __pyx_t_9 = (__pyx_v_mask != Py_None); __pyx_t_8 = (__pyx_t_9 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3715 * mask = None * if mask is not None: * fill_value = mval # <<<<<<<<<<<<<< * totalmask += mask * if hasattr(self, '_FillValue'): */ __Pyx_INCREF(__pyx_v_mval); __Pyx_DECREF_SET(__pyx_v_fill_value, __pyx_v_mval); /* "netCDF4/_netCDF4.pyx":3716 * if mask is not None: * fill_value = mval * totalmask += mask # <<<<<<<<<<<<<< * if hasattr(self, '_FillValue'): * fval = numpy.array(self._FillValue, self.dtype) */ __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mask); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3716; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3714 * else: * mask = None * if mask is not None: # <<<<<<<<<<<<<< * fill_value = mval * totalmask += mask */ } /* "netCDF4/_netCDF4.pyx":3691 * totalmask = numpy.zeros(data.shape, numpy.bool) * fill_value = None * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<< * mval = numpy.array(self.missing_value, self.dtype) * if (self.endian() == 'big' and is_native_little) or\ */ } /* "netCDF4/_netCDF4.pyx":3717 * fill_value = mval * totalmask += mask * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<< * fval = numpy.array(self._FillValue, self.dtype) * # byte swap the _FillValue if endian-ness of the variable */ __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3718 * totalmask += mask * if hasattr(self, '_FillValue'): * fval = numpy.array(self._FillValue, self.dtype) # <<<<<<<<<<<<<< * # byte swap the _FillValue if endian-ness of the variable * # is not native. */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_self->dtype); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fval = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3721 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fval.byteswap(True) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_big, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_8) { goto __pyx_L29_next_or; } else { } __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L28_bool_binop_done; } __pyx_L29_next_or:; /* "netCDF4/_netCDF4.pyx":3722 * # is not native. * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): # <<<<<<<<<<<<<< * fval.byteswap(True) * # is _FillValue a NaN? */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_little, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L28_bool_binop_done; } __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_8; __pyx_L28_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3721 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fval.byteswap(True) */ if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3723 * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): * fval.byteswap(True) # <<<<<<<<<<<<<< * # is _FillValue a NaN? * try: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fval, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3721 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fval.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":3725 * fval.byteswap(True) * # is _FillValue a NaN? * try: # <<<<<<<<<<<<<< * fvalisnan = numpy.isnan(fval) * except: # isnan fails on some dtypes (issue 202) */ { __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "netCDF4/_netCDF4.pyx":3726 * # is _FillValue a NaN? * try: * fvalisnan = numpy.isnan(fval) # <<<<<<<<<<<<<< * except: # isnan fails on some dtypes (issue 202) * fvalisnan = False */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L32_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L32_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L32_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L32_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_fval); __Pyx_GIVEREF(__pyx_v_fval); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_fval); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L32_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_fvalisnan = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3725 * fval.byteswap(True) * # is _FillValue a NaN? * try: # <<<<<<<<<<<<<< * fvalisnan = numpy.isnan(fval) * except: # isnan fails on some dtypes (issue 202) */ } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L39_try_end; __pyx_L32_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3727 * try: * fvalisnan = numpy.isnan(fval) * except: # isnan fails on some dtypes (issue 202) # <<<<<<<<<<<<<< * fvalisnan = False * if fvalisnan: */ /*except:*/ { __Pyx_AddTraceback("netCDF4._netCDF4.Variable._toma", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_1); /* "netCDF4/_netCDF4.pyx":3728 * fvalisnan = numpy.isnan(fval) * except: # isnan fails on some dtypes (issue 202) * fvalisnan = False # <<<<<<<<<<<<<< * if fvalisnan: * mask = numpy.isnan(data) */ __Pyx_INCREF(Py_False); __Pyx_XDECREF_SET(__pyx_v_fvalisnan, Py_False); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L33_exception_handled; } __pyx_L34_except_error:; /* "netCDF4/_netCDF4.pyx":3725 * fval.byteswap(True) * # is _FillValue a NaN? * try: # <<<<<<<<<<<<<< * fvalisnan = numpy.isnan(fval) * except: # isnan fails on some dtypes (issue 202) */ __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); goto __pyx_L1_error; __pyx_L33_exception_handled:; __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10); __pyx_L39_try_end:; } /* "netCDF4/_netCDF4.pyx":3729 * except: # isnan fails on some dtypes (issue 202) * fvalisnan = False * if fvalisnan: # <<<<<<<<<<<<<< * mask = numpy.isnan(data) * elif (data == fval).any(): */ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_fvalisnan); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3730 * fvalisnan = False * if fvalisnan: * mask = numpy.isnan(data) # <<<<<<<<<<<<<< * elif (data == fval).any(): * mask = data==fval */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_isnan); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3729 * except: # isnan fails on some dtypes (issue 202) * fvalisnan = False * if fvalisnan: # <<<<<<<<<<<<<< * mask = numpy.isnan(data) * elif (data == fval).any(): */ goto __pyx_L42; } /* "netCDF4/_netCDF4.pyx":3731 * if fvalisnan: * mask = numpy.isnan(data) * elif (data == fval).any(): # <<<<<<<<<<<<<< * mask = data==fval * else: */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3732 * mask = numpy.isnan(data) * elif (data == fval).any(): * mask = data==fval # <<<<<<<<<<<<<< * else: * mask = None */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fval, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3731 * if fvalisnan: * mask = numpy.isnan(data) * elif (data == fval).any(): # <<<<<<<<<<<<<< * mask = data==fval * else: */ goto __pyx_L42; } /* "netCDF4/_netCDF4.pyx":3734 * mask = data==fval * else: * mask = None # <<<<<<<<<<<<<< * if mask is not None: * if fill_value is None: */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_mask, Py_None); } __pyx_L42:; /* "netCDF4/_netCDF4.pyx":3735 * else: * mask = None * if mask is not None: # <<<<<<<<<<<<<< * if fill_value is None: * fill_value = fval */ __pyx_t_9 = (__pyx_v_mask != Py_None); __pyx_t_8 = (__pyx_t_9 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3736 * mask = None * if mask is not None: * if fill_value is None: # <<<<<<<<<<<<<< * fill_value = fval * totalmask += mask */ __pyx_t_8 = (__pyx_v_fill_value == Py_None); __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3737 * if mask is not None: * if fill_value is None: * fill_value = fval # <<<<<<<<<<<<<< * totalmask += mask * # issue 209: don't return masked array if variable filling */ __Pyx_INCREF(__pyx_v_fval); __Pyx_DECREF_SET(__pyx_v_fill_value, __pyx_v_fval); /* "netCDF4/_netCDF4.pyx":3736 * mask = None * if mask is not None: * if fill_value is None: # <<<<<<<<<<<<<< * fill_value = fval * totalmask += mask */ } /* "netCDF4/_netCDF4.pyx":3738 * if fill_value is None: * fill_value = fval * totalmask += mask # <<<<<<<<<<<<<< * # issue 209: don't return masked array if variable filling * # is disabled. */ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":3735 * else: * mask = None * if mask is not None: # <<<<<<<<<<<<<< * if fill_value is None: * fill_value = fval */ } /* "netCDF4/_netCDF4.pyx":3717 * fill_value = mval * totalmask += mask * if hasattr(self, '_FillValue'): # <<<<<<<<<<<<<< * fval = numpy.array(self._FillValue, self.dtype) * # byte swap the _FillValue if endian-ness of the variable */ goto __pyx_L26; } /* "netCDF4/_netCDF4.pyx":3742 * # is disabled. * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":3743 * else: * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_var_fill(__pyx_v_self->_grpid, __pyx_v_self->_varid, (&__pyx_v_no_fill), NULL); } /* "netCDF4/_netCDF4.pyx":3742 * # is disabled. * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L47; } __pyx_L47:; } } /* "netCDF4/_netCDF4.pyx":3744 * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # if no_fill is not 1, and not a byte variable, then use default fill value. */ __pyx_t_9 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3745 * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # if no_fill is not 1, and not a byte variable, then use default fill value. * # from http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c/Fill-Values.html#Fill-Values */ __pyx_t_15 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_15, 0, strlen(__pyx_t_15), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3744 * with nogil: * ierr = nc_inq_var_fill(self._grpid,self._varid,&no_fill,NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # if no_fill is not 1, and not a byte variable, then use default fill value. */ } /* "netCDF4/_netCDF4.pyx":3758 * # small to assume one of the values should appear as a missing * # value unless a _FillValue attribute is set explicitly." * if no_fill != 1 and self.dtype.str[1:] not in ['u1','i1']: # <<<<<<<<<<<<<< * fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype) * # byte swap the _FillValue if endian-ness of the variable */ __pyx_t_8 = ((__pyx_v_no_fill != 1) != 0); if (__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; goto __pyx_L50_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__57, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_16 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_u1, Py_NE)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_16) { } else { __pyx_t_8 = __pyx_t_16; goto __pyx_L52_bool_binop_done; } __pyx_t_16 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_i1, Py_NE)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __pyx_t_16; __pyx_L52_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_16 = (__pyx_t_8 != 0); __pyx_t_9 = __pyx_t_16; __pyx_L50_bool_binop_done:; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3759 * # value unless a _FillValue attribute is set explicitly." * if no_fill != 1 and self.dtype.str[1:] not in ['u1','i1']: * fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype) # <<<<<<<<<<<<<< * # byte swap the _FillValue if endian-ness of the variable * # is not native. */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__58, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_6 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_self->dtype); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_fillval = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3762 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fillval.byteswap(True) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_16 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_big, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_16) { goto __pyx_L56_next_or; } else { } __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_16) { } else { __pyx_t_9 = __pyx_t_16; goto __pyx_L55_bool_binop_done; } __pyx_L56_next_or:; /* "netCDF4/_netCDF4.pyx":3763 * # is not native. * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): # <<<<<<<<<<<<<< * fillval.byteswap(True) * has_fillval = data == fillval */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_1) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_16 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_little, Py_EQ)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_16) { } else { __pyx_t_9 = __pyx_t_16; goto __pyx_L55_bool_binop_done; } __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_16; __pyx_L55_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3762 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fillval.byteswap(True) */ if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3764 * if (self.endian() == 'big' and is_native_little) or\ * (self.endian() == 'little' and is_native_big): * fillval.byteswap(True) # <<<<<<<<<<<<<< * has_fillval = data == fillval * # if data is an array scalar, has_fillval will be a boolean. */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fillval, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3762 * # byte swap the _FillValue if endian-ness of the variable * # is not native. * if (self.endian() == 'big' and is_native_little) or\ # <<<<<<<<<<<<<< * (self.endian() == 'little' and is_native_big): * fillval.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":3765 * (self.endian() == 'little' and is_native_big): * fillval.byteswap(True) * has_fillval = data == fillval # <<<<<<<<<<<<<< * # if data is an array scalar, has_fillval will be a boolean. * # in that case convert to an array. */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fillval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_has_fillval = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3768 * # if data is an array scalar, has_fillval will be a boolean. * # in that case convert to an array. * if type(has_fillval) == bool: has_fillval=numpy.asarray(has_fillval) # <<<<<<<<<<<<<< * if has_fillval.any(): * mask=data==fillval */ __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_has_fillval)), ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_has_fillval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_has_fillval); __Pyx_GIVEREF(__pyx_v_has_fillval); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_has_fillval); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_has_fillval, __pyx_t_2); __pyx_t_2 = 0; } /* "netCDF4/_netCDF4.pyx":3769 * # in that case convert to an array. * if type(has_fillval) == bool: has_fillval=numpy.asarray(has_fillval) * if has_fillval.any(): # <<<<<<<<<<<<<< * mask=data==fillval * if fill_value is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_has_fillval, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_4) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3770 * if type(has_fillval) == bool: has_fillval=numpy.asarray(has_fillval) * if has_fillval.any(): * mask=data==fillval # <<<<<<<<<<<<<< * if fill_value is None: * fill_value = fillval */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_data, __pyx_v_fillval, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3771 * if has_fillval.any(): * mask=data==fillval * if fill_value is None: # <<<<<<<<<<<<<< * fill_value = fillval * totalmask += mask */ __pyx_t_9 = (__pyx_v_fill_value == Py_None); __pyx_t_16 = (__pyx_t_9 != 0); if (__pyx_t_16) { /* "netCDF4/_netCDF4.pyx":3772 * mask=data==fillval * if fill_value is None: * fill_value = fillval # <<<<<<<<<<<<<< * totalmask += mask * # all values where data == missing_value or _FillValue are */ __Pyx_INCREF(__pyx_v_fillval); __Pyx_DECREF_SET(__pyx_v_fill_value, __pyx_v_fillval); /* "netCDF4/_netCDF4.pyx":3771 * if has_fillval.any(): * mask=data==fillval * if fill_value is None: # <<<<<<<<<<<<<< * fill_value = fillval * totalmask += mask */ } /* "netCDF4/_netCDF4.pyx":3773 * if fill_value is None: * fill_value = fillval * totalmask += mask # <<<<<<<<<<<<<< * # all values where data == missing_value or _FillValue are * # masked. fill_value set to missing_value if it exists, */ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_totalmask, __pyx_v_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_totalmask, __pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3769 * # in that case convert to an array. * if type(has_fillval) == bool: has_fillval=numpy.asarray(has_fillval) * if has_fillval.any(): # <<<<<<<<<<<<<< * mask=data==fillval * if fill_value is None: */ } /* "netCDF4/_netCDF4.pyx":3758 * # small to assume one of the values should appear as a missing * # value unless a _FillValue attribute is set explicitly." * if no_fill != 1 and self.dtype.str[1:] not in ['u1','i1']: # <<<<<<<<<<<<<< * fillval = numpy.array(default_fillvals[self.dtype.str[1:]],self.dtype) * # byte swap the _FillValue if endian-ness of the variable */ } } __pyx_L26:; /* "netCDF4/_netCDF4.pyx":3777 * # masked. fill_value set to missing_value if it exists, * # otherwise _FillValue. * if fill_value is not None: # <<<<<<<<<<<<<< * data = ma.masked_array(data,mask=totalmask,fill_value=fill_value) * return data */ __pyx_t_16 = (__pyx_v_fill_value != Py_None); __pyx_t_9 = (__pyx_t_16 != 0); if (__pyx_t_9) { /* "netCDF4/_netCDF4.pyx":3778 * # otherwise _FillValue. * if fill_value is not None: * data = ma.masked_array(data,mask=totalmask,fill_value=fill_value) # <<<<<<<<<<<<<< * return data * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_masked_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data); __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_mask, __pyx_v_totalmask) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fill_value, __pyx_v_fill_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3777 * # masked. fill_value set to missing_value if it exists, * # otherwise _FillValue. * if fill_value is not None: # <<<<<<<<<<<<<< * data = ma.masked_array(data,mask=totalmask,fill_value=fill_value) * return data */ } /* "netCDF4/_netCDF4.pyx":3779 * if fill_value is not None: * data = ma.masked_array(data,mask=totalmask,fill_value=fill_value) * return data # <<<<<<<<<<<<<< * * def _assign_vlen(self, elem, data): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); __pyx_r = __pyx_v_data; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3685 * return data * * def _toma(self,data): # <<<<<<<<<<<<<< * cdef int ierr, no_fill * # private function for creating a masked array, masking missing_values */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._toma", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_totalmask); __Pyx_XDECREF(__pyx_v_fill_value); __Pyx_XDECREF(__pyx_v_mval); __Pyx_XDECREF(__pyx_v_hasmval); __Pyx_XDECREF(__pyx_v_mvalisnan); __Pyx_XDECREF(__pyx_v_m); __Pyx_XDECREF(__pyx_v_mask); __Pyx_XDECREF(__pyx_v_fval); __Pyx_XDECREF(__pyx_v_fvalisnan); __Pyx_XDECREF(__pyx_v_fillval); __Pyx_XDECREF(__pyx_v_has_fillval); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3781 * return data * * def _assign_vlen(self, elem, data): # <<<<<<<<<<<<<< * """private method to assign data to a single item in a VLEN variable""" * cdef size_t *startp */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_47_assign_vlen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_46_assign_vlen[] = "private method to assign data to a single item in a VLEN variable"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_47_assign_vlen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_elem = 0; PyObject *__pyx_v_data = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_assign_vlen (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elem,&__pyx_n_s_data,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elem)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_assign_vlen", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_assign_vlen") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_elem = values[0]; __pyx_v_data = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_assign_vlen", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3781; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._assign_vlen", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_46_assign_vlen(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_elem, __pyx_v_data); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_46_assign_vlen(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data) { size_t *__pyx_v_startp; size_t *__pyx_v_countp; int __pyx_v_ndims; int __pyx_v_n; nc_vlen_t *__pyx_v_vldata; char **__pyx_v_strdata; PyArrayObject *__pyx_v_data2 = 0; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_elemnew = NULL; PyObject *__pyx_v_e = NULL; PyObject *__pyx_v_enew = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_count = NULL; PyObject *__pyx_v_bytestr = NULL; int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8 = NULL; int __pyx_t_9; size_t __pyx_t_10; char *__pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_assign_vlen", 0); __Pyx_INCREF(__pyx_v_elem); /* "netCDF4/_netCDF4.pyx":3789 * cdef char **strdata * cdef ndarray data2 * if not self._isvlen: # <<<<<<<<<<<<<< * raise TypeError('_assign_vlen method only for use with VLEN variables') * ndims = self.ndim */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3790 * cdef ndarray data2 * if not self._isvlen: * raise TypeError('_assign_vlen method only for use with VLEN variables') # <<<<<<<<<<<<<< * ndims = self.ndim * msg="single element VLEN slices must be specified by integers only" */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3790; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3789 * cdef char **strdata * cdef ndarray data2 * if not self._isvlen: # <<<<<<<<<<<<<< * raise TypeError('_assign_vlen method only for use with VLEN variables') * ndims = self.ndim */ } /* "netCDF4/_netCDF4.pyx":3791 * if not self._isvlen: * raise TypeError('_assign_vlen method only for use with VLEN variables') * ndims = self.ndim # <<<<<<<<<<<<<< * msg="single element VLEN slices must be specified by integers only" * # check to see that elem is a tuple of integers. */ __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_self->ndim); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ndims = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":3792 * raise TypeError('_assign_vlen method only for use with VLEN variables') * ndims = self.ndim * msg="single element VLEN slices must be specified by integers only" # <<<<<<<<<<<<<< * # check to see that elem is a tuple of integers. * # handle negative integers. */ __Pyx_INCREF(__pyx_kp_s_single_element_VLEN_slices_must); __pyx_v_msg = __pyx_kp_s_single_element_VLEN_slices_must; /* "netCDF4/_netCDF4.pyx":3795 * # check to see that elem is a tuple of integers. * # handle negative integers. * if isinstance(elem, int): # <<<<<<<<<<<<<< * if ndims > 1: * raise IndexError(msg) */ __pyx_t_2 = PyInt_Check(__pyx_v_elem); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3796 * # handle negative integers. * if isinstance(elem, int): * if ndims > 1: # <<<<<<<<<<<<<< * raise IndexError(msg) * if elem < 0: */ __pyx_t_1 = ((__pyx_v_ndims > 1) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3797 * if isinstance(elem, int): * if ndims > 1: * raise IndexError(msg) # <<<<<<<<<<<<<< * if elem < 0: * if self.shape[0]+elem >= 0: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3796 * # handle negative integers. * if isinstance(elem, int): * if ndims > 1: # <<<<<<<<<<<<<< * raise IndexError(msg) * if elem < 0: */ } /* "netCDF4/_netCDF4.pyx":3798 * if ndims > 1: * raise IndexError(msg) * if elem < 0: # <<<<<<<<<<<<<< * if self.shape[0]+elem >= 0: * elem = self.shape[0]+elem */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_elem, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3799 * raise IndexError(msg) * if elem < 0: * if self.shape[0]+elem >= 0: # <<<<<<<<<<<<<< * elem = self.shape[0]+elem * else: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_elem); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3800 * if elem < 0: * if self.shape[0]+elem >= 0: * elem = self.shape[0]+elem # <<<<<<<<<<<<<< * else: * raise IndexError("Illegal index") */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_elem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3799 * raise IndexError(msg) * if elem < 0: * if self.shape[0]+elem >= 0: # <<<<<<<<<<<<<< * elem = self.shape[0]+elem * else: */ goto __pyx_L7; } /* "netCDF4/_netCDF4.pyx":3802 * elem = self.shape[0]+elem * else: * raise IndexError("Illegal index") # <<<<<<<<<<<<<< * elif isinstance(elem, tuple): * if len(elem) != ndims: */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; /* "netCDF4/_netCDF4.pyx":3798 * if ndims > 1: * raise IndexError(msg) * if elem < 0: # <<<<<<<<<<<<<< * if self.shape[0]+elem >= 0: * elem = self.shape[0]+elem */ } /* "netCDF4/_netCDF4.pyx":3795 * # check to see that elem is a tuple of integers. * # handle negative integers. * if isinstance(elem, int): # <<<<<<<<<<<<<< * if ndims > 1: * raise IndexError(msg) */ goto __pyx_L4; } /* "netCDF4/_netCDF4.pyx":3803 * else: * raise IndexError("Illegal index") * elif isinstance(elem, tuple): # <<<<<<<<<<<<<< * if len(elem) != ndims: * raise IndexError("Illegal index") */ __pyx_t_1 = PyTuple_Check(__pyx_v_elem); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3804 * raise IndexError("Illegal index") * elif isinstance(elem, tuple): * if len(elem) != ndims: # <<<<<<<<<<<<<< * raise IndexError("Illegal index") * elemnew = [] */ __pyx_t_6 = PyObject_Length(__pyx_v_elem); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_6 != __pyx_v_ndims) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3805 * elif isinstance(elem, tuple): * if len(elem) != ndims: * raise IndexError("Illegal index") # <<<<<<<<<<<<<< * elemnew = [] * for n,e in enumerate(elem): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3805; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3804 * raise IndexError("Illegal index") * elif isinstance(elem, tuple): * if len(elem) != ndims: # <<<<<<<<<<<<<< * raise IndexError("Illegal index") * elemnew = [] */ } /* "netCDF4/_netCDF4.pyx":3806 * if len(elem) != ndims: * raise IndexError("Illegal index") * elemnew = [] # <<<<<<<<<<<<<< * for n,e in enumerate(elem): * if not isinstance(e, int): */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_elemnew = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3807 * raise IndexError("Illegal index") * elemnew = [] * for n,e in enumerate(elem): # <<<<<<<<<<<<<< * if not isinstance(e, int): * raise IndexError(msg) */ __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_elem)) || PyTuple_CheckExact(__pyx_v_elem)) { __pyx_t_3 = __pyx_v_elem; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_elem); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_5); __pyx_t_5 = 0; __pyx_v_n = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); /* "netCDF4/_netCDF4.pyx":3808 * elemnew = [] * for n,e in enumerate(elem): * if not isinstance(e, int): # <<<<<<<<<<<<<< * raise IndexError(msg) * elif e < 0: */ __pyx_t_2 = PyInt_Check(__pyx_v_e); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3809 * for n,e in enumerate(elem): * if not isinstance(e, int): * raise IndexError(msg) # <<<<<<<<<<<<<< * elif e < 0: * enew = self.shape[n]+e */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3808 * elemnew = [] * for n,e in enumerate(elem): * if not isinstance(e, int): # <<<<<<<<<<<<<< * raise IndexError(msg) * elif e < 0: */ } /* "netCDF4/_netCDF4.pyx":3810 * if not isinstance(e, int): * raise IndexError(msg) * elif e < 0: # <<<<<<<<<<<<<< * enew = self.shape[n]+e * if enew < 0: */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_e, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3811 * raise IndexError(msg) * elif e < 0: * enew = self.shape[n]+e # <<<<<<<<<<<<<< * if enew < 0: * raise IndexError("Illegal index") */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_v_e); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_enew, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":3812 * elif e < 0: * enew = self.shape[n]+e * if enew < 0: # <<<<<<<<<<<<<< * raise IndexError("Illegal index") * else: */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_enew, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3813 * enew = self.shape[n]+e * if enew < 0: * raise IndexError("Illegal index") # <<<<<<<<<<<<<< * else: * elemnew.append(self.shape[n]+e) */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3812 * elif e < 0: * enew = self.shape[n]+e * if enew < 0: # <<<<<<<<<<<<<< * raise IndexError("Illegal index") * else: */ } /* "netCDF4/_netCDF4.pyx":3815 * raise IndexError("Illegal index") * else: * elemnew.append(self.shape[n]+e) # <<<<<<<<<<<<<< * else: * elemnew.append(e) */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_v_e); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_elemnew, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "netCDF4/_netCDF4.pyx":3810 * if not isinstance(e, int): * raise IndexError(msg) * elif e < 0: # <<<<<<<<<<<<<< * enew = self.shape[n]+e * if enew < 0: */ goto __pyx_L11; } /* "netCDF4/_netCDF4.pyx":3817 * elemnew.append(self.shape[n]+e) * else: * elemnew.append(e) # <<<<<<<<<<<<<< * elem = tuple(elemnew) * else: */ /*else*/ { __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_elemnew, __pyx_v_e); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; /* "netCDF4/_netCDF4.pyx":3807 * raise IndexError("Illegal index") * elemnew = [] * for n,e in enumerate(elem): # <<<<<<<<<<<<<< * if not isinstance(e, int): * raise IndexError(msg) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3818 * else: * elemnew.append(e) * elem = tuple(elemnew) # <<<<<<<<<<<<<< * else: * raise IndexError(msg) */ __pyx_t_3 = PyList_AsTuple(__pyx_v_elemnew); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_elem, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3803 * else: * raise IndexError("Illegal index") * elif isinstance(elem, tuple): # <<<<<<<<<<<<<< * if len(elem) != ndims: * raise IndexError("Illegal index") */ goto __pyx_L4; } /* "netCDF4/_netCDF4.pyx":3820 * elem = tuple(elemnew) * else: * raise IndexError(msg) # <<<<<<<<<<<<<< * # set start, count * if isinstance(elem, tuple): */ /*else*/ { __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; /* "netCDF4/_netCDF4.pyx":3822 * raise IndexError(msg) * # set start, count * if isinstance(elem, tuple): # <<<<<<<<<<<<<< * start = list(elem) * else: */ __pyx_t_1 = PyTuple_Check(__pyx_v_elem); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3823 * # set start, count * if isinstance(elem, tuple): * start = list(elem) # <<<<<<<<<<<<<< * else: * start = [elem] */ __pyx_t_8 = PySequence_List(__pyx_v_elem); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_v_start = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":3822 * raise IndexError(msg) * # set start, count * if isinstance(elem, tuple): # <<<<<<<<<<<<<< * start = list(elem) * else: */ goto __pyx_L13; } /* "netCDF4/_netCDF4.pyx":3825 * start = list(elem) * else: * start = [elem] # <<<<<<<<<<<<<< * count = [1]*ndims * startp = malloc(sizeof(size_t) * ndims) */ /*else*/ { __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_elem); __pyx_v_start = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; } __pyx_L13:; /* "netCDF4/_netCDF4.pyx":3826 * else: * start = [elem] * count = [1]*ndims # <<<<<<<<<<<<<< * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) */ __pyx_t_8 = PyList_New(1 * ((__pyx_v_ndims<0) ? 0:__pyx_v_ndims)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_ndims; __pyx_temp++) { __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyList_SET_ITEM(__pyx_t_8, __pyx_temp, __pyx_int_1); } } __pyx_v_count = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":3827 * start = [elem] * count = [1]*ndims * startp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * countp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: */ __pyx_v_startp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":3828 * count = [1]*ndims * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * startp[n] = start[n] */ __pyx_v_countp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":3829 * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * startp[n] = start[n] * countp[n] = count[n] */ __pyx_t_4 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":3830 * countp = malloc(sizeof(size_t) * ndims) * for n from 0 <= n < ndims: * startp[n] = start[n] # <<<<<<<<<<<<<< * countp[n] = count[n] * if self.dtype == str: # VLEN string */ __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_start, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; (__pyx_v_startp[__pyx_v_n]) = __pyx_t_10; /* "netCDF4/_netCDF4.pyx":3831 * for n from 0 <= n < ndims: * startp[n] = start[n] * countp[n] = count[n] # <<<<<<<<<<<<<< * if self.dtype == str: # VLEN string * strdata = malloc(sizeof(char *)) */ __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_count, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; (__pyx_v_countp[__pyx_v_n]) = __pyx_t_10; } /* "netCDF4/_netCDF4.pyx":3832 * startp[n] = start[n] * countp[n] = count[n] * if self.dtype == str: # VLEN string # <<<<<<<<<<<<<< * strdata = malloc(sizeof(char *)) * bytestr = _strencode(data) */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3833 * countp[n] = count[n] * if self.dtype == str: # VLEN string * strdata = malloc(sizeof(char *)) # <<<<<<<<<<<<<< * bytestr = _strencode(data) * strdata[0] = bytestr */ __pyx_v_strdata = ((char **)malloc((sizeof(char *)))); /* "netCDF4/_netCDF4.pyx":3834 * if self.dtype == str: # VLEN string * strdata = malloc(sizeof(char *)) * bytestr = _strencode(data) # <<<<<<<<<<<<<< * strdata[0] = bytestr * ierr = nc_put_vara(self._grpid, self._varid, */ __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_data, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_v_bytestr = __pyx_t_8; __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":3835 * strdata = malloc(sizeof(char *)) * bytestr = _strencode(data) * strdata[0] = bytestr # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, strdata) */ __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_strdata[0]) = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":3836 * bytestr = _strencode(data) * strdata[0] = bytestr * ierr = nc_put_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, strdata) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_put_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_strdata); /* "netCDF4/_netCDF4.pyx":3838 * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, strdata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3839 * startp, countp, strdata) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * free(strdata) * else: # regular VLEN */ __pyx_t_11 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_8 = __Pyx_decode_c_string(__pyx_t_11, 0, strlen(__pyx_t_11), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3838 * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, strdata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) */ } /* "netCDF4/_netCDF4.pyx":3840 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) # <<<<<<<<<<<<<< * else: # regular VLEN * if data.dtype != self.dtype: */ free(__pyx_v_strdata); /* "netCDF4/_netCDF4.pyx":3832 * startp[n] = start[n] * countp[n] = count[n] * if self.dtype == str: # VLEN string # <<<<<<<<<<<<<< * strdata = malloc(sizeof(char *)) * bytestr = _strencode(data) */ goto __pyx_L16; } /* "netCDF4/_netCDF4.pyx":3842 * free(strdata) * else: # regular VLEN * if data.dtype != self.dtype: # <<<<<<<<<<<<<< * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype)) * data2 = data */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_self->dtype, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3843 * else: # regular VLEN * if data.dtype != self.dtype: * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype)) # <<<<<<<<<<<<<< * data2 = data * vldata = malloc(sizeof(nc_vlen_t)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_wrong_data_type_should_be_s_got, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3842 * free(strdata) * else: # regular VLEN * if data.dtype != self.dtype: # <<<<<<<<<<<<<< * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype)) * data2 = data */ } /* "netCDF4/_netCDF4.pyx":3844 * if data.dtype != self.dtype: * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype)) * data2 = data # <<<<<<<<<<<<<< * vldata = malloc(sizeof(nc_vlen_t)) * vldata[0].len = PyArray_SIZE(data2) */ if (!(likely(((__pyx_v_data) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_data, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_v_data; __Pyx_INCREF(__pyx_t_3); __pyx_v_data2 = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":3845 * raise TypeError("wrong data type: should be %s, got %s" % (self.dtype,data.dtype)) * data2 = data * vldata = malloc(sizeof(nc_vlen_t)) # <<<<<<<<<<<<<< * vldata[0].len = PyArray_SIZE(data2) * vldata[0].p = data2.data */ __pyx_v_vldata = ((nc_vlen_t *)malloc((sizeof(nc_vlen_t)))); /* "netCDF4/_netCDF4.pyx":3846 * data2 = data * vldata = malloc(sizeof(nc_vlen_t)) * vldata[0].len = PyArray_SIZE(data2) # <<<<<<<<<<<<<< * vldata[0].p = data2.data * ierr = nc_put_vara(self._grpid, self._varid, */ (__pyx_v_vldata[0]).len = PyArray_SIZE(__pyx_v_data2); /* "netCDF4/_netCDF4.pyx":3847 * vldata = malloc(sizeof(nc_vlen_t)) * vldata[0].len = PyArray_SIZE(data2) * vldata[0].p = data2.data # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, vldata) */ __pyx_t_11 = __pyx_v_data2->data; (__pyx_v_vldata[0]).p = __pyx_t_11; /* "netCDF4/_netCDF4.pyx":3848 * vldata[0].len = PyArray_SIZE(data2) * vldata[0].p = data2.data * ierr = nc_put_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, vldata) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_put_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_vldata); /* "netCDF4/_netCDF4.pyx":3850 * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, vldata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(vldata) */ __pyx_t_2 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":3851 * startp, countp, vldata) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * free(vldata) * free(startp) */ __pyx_t_11 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_11, 0, strlen(__pyx_t_11), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3850 * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, vldata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(vldata) */ } /* "netCDF4/_netCDF4.pyx":3852 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(vldata) # <<<<<<<<<<<<<< * free(startp) * free(countp) */ free(__pyx_v_vldata); } __pyx_L16:; /* "netCDF4/_netCDF4.pyx":3853 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(vldata) * free(startp) # <<<<<<<<<<<<<< * free(countp) * */ free(__pyx_v_startp); /* "netCDF4/_netCDF4.pyx":3854 * free(vldata) * free(startp) * free(countp) # <<<<<<<<<<<<<< * * def __setitem__(self, elem, data): */ free(__pyx_v_countp); /* "netCDF4/_netCDF4.pyx":3781 * return data * * def _assign_vlen(self, elem, data): # <<<<<<<<<<<<<< * """private method to assign data to a single item in a VLEN variable""" * cdef size_t *startp */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._assign_vlen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_data2); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_elemnew); __Pyx_XDECREF(__pyx_v_e); __Pyx_XDECREF(__pyx_v_enew); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_count); __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3856 * free(countp) * * def __setitem__(self, elem, data): # <<<<<<<<<<<<<< * # This special method is used to assign to the netCDF variable * # using "extended slice syntax". The extended slice syntax */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_49__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_49__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_48__setitem__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_elem), ((PyObject *)__pyx_v_data)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_48__setitem__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_elem, PyObject *__pyx_v_data) { PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_test = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_count = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_v_put_ind = NULL; PyObject *__pyx_v_datashape = NULL; PyObject *__pyx_v_fillval = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_dataput = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); PyObject *(*__pyx_t_12)(PyObject *); Py_ssize_t __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_elem); __Pyx_INCREF(__pyx_v_data); /* "netCDF4/_netCDF4.pyx":3863 * # to use. * * if self._isvlen: # if vlen, should be object array (don't try casting) # <<<<<<<<<<<<<< * if self.dtype == str: * # for string vars, if data is not an array */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3864 * * if self._isvlen: # if vlen, should be object array (don't try casting) * if self.dtype == str: # <<<<<<<<<<<<<< * # for string vars, if data is not an array * # assume it is a python string and raise an error */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3868 * # assume it is a python string and raise an error * # if it is an array, but not an object array. * if not hasattr(data,'ndim'): # <<<<<<<<<<<<<< * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ */ __pyx_t_1 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3870 * if not hasattr(data,'ndim'): * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ __pyx_t_2 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_elem)), ((PyObject *)Py_TYPE(__pyx_builtin_Ellipsis)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L7_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":3871 * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 # <<<<<<<<<<<<<< * self._assign_vlen(elem, data) * return */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3870 * if not hasattr(data,'ndim'): * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ __pyx_t_1 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_3 = __pyx_t_1; __pyx_L7_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3871 * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 # <<<<<<<<<<<<<< * self._assign_vlen(elem, data) * return */ __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_elem, __pyx_int_0); /* "netCDF4/_netCDF4.pyx":3870 * if not hasattr(data,'ndim'): * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ } /* "netCDF4/_netCDF4.pyx":3872 * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) # <<<<<<<<<<<<<< * return * elif data.dtype.kind in ['S', 'U']: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assign_vlen); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_4 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_v_elem); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_v_data); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3873 * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) * return # <<<<<<<<<<<<<< * elif data.dtype.kind in ['S', 'U']: * if ma.isMA(data): */ __pyx_r = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3868 * # assume it is a python string and raise an error * # if it is an array, but not an object array. * if not hasattr(data,'ndim'): # <<<<<<<<<<<<<< * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ */ } /* "netCDF4/_netCDF4.pyx":3874 * self._assign_vlen(elem, data) * return * elif data.dtype.kind in ['S', 'U']: # <<<<<<<<<<<<<< * if ma.isMA(data): * msg='masked arrays cannot be assigned by VLEN str slices' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_U, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_1; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3875 * return * elif data.dtype.kind in ['S', 'U']: * if ma.isMA(data): # <<<<<<<<<<<<<< * msg='masked arrays cannot be assigned by VLEN str slices' * raise TypeError(msg) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isMA); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3876 * elif data.dtype.kind in ['S', 'U']: * if ma.isMA(data): * msg='masked arrays cannot be assigned by VLEN str slices' # <<<<<<<<<<<<<< * raise TypeError(msg) * data = data.astype(object) */ __Pyx_INCREF(__pyx_kp_s_masked_arrays_cannot_be_assigned); __pyx_v_msg = __pyx_kp_s_masked_arrays_cannot_be_assigned; /* "netCDF4/_netCDF4.pyx":3877 * if ma.isMA(data): * msg='masked arrays cannot be assigned by VLEN str slices' * raise TypeError(msg) # <<<<<<<<<<<<<< * data = data.astype(object) * elif data.dtype.kind != 'O': */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3875 * return * elif data.dtype.kind in ['S', 'U']: * if ma.isMA(data): # <<<<<<<<<<<<<< * msg='masked arrays cannot be assigned by VLEN str slices' * raise TypeError(msg) */ } /* "netCDF4/_netCDF4.pyx":3878 * msg='masked arrays cannot be assigned by VLEN str slices' * raise TypeError(msg) * data = data.astype(object) # <<<<<<<<<<<<<< * elif data.dtype.kind != 'O': * msg = ('only numpy string, unicode or object arrays can ' */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_builtin_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_builtin_object); __Pyx_GIVEREF(__pyx_builtin_object); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_builtin_object); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3874 * self._assign_vlen(elem, data) * return * elif data.dtype.kind in ['S', 'U']: # <<<<<<<<<<<<<< * if ma.isMA(data): * msg='masked arrays cannot be assigned by VLEN str slices' */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":3879 * raise TypeError(msg) * data = data.astype(object) * elif data.dtype.kind != 'O': # <<<<<<<<<<<<<< * msg = ('only numpy string, unicode or object arrays can ' * 'be assigned to VLEN str var slices') */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3880 * data = data.astype(object) * elif data.dtype.kind != 'O': * msg = ('only numpy string, unicode or object arrays can ' # <<<<<<<<<<<<<< * 'be assigned to VLEN str var slices') * raise TypeError(msg) */ __Pyx_INCREF(__pyx_kp_s_only_numpy_string_unicode_or_obj); __pyx_v_msg = __pyx_kp_s_only_numpy_string_unicode_or_obj; /* "netCDF4/_netCDF4.pyx":3882 * msg = ('only numpy string, unicode or object arrays can ' * 'be assigned to VLEN str var slices') * raise TypeError(msg) # <<<<<<<<<<<<<< * else: * # for non-string vlen arrays, if data is not multi-dim, or */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3879 * raise TypeError(msg) * data = data.astype(object) * elif data.dtype.kind != 'O': # <<<<<<<<<<<<<< * msg = ('only numpy string, unicode or object arrays can ' * 'be assigned to VLEN str var slices') */ } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":3864 * * if self._isvlen: # if vlen, should be object array (don't try casting) * if self.dtype == str: # <<<<<<<<<<<<<< * # for string vars, if data is not an array * # assume it is a python string and raise an error */ goto __pyx_L4; } /* "netCDF4/_netCDF4.pyx":3887 * # not an object array, assume it represents a single element * # of the vlen var. * if not hasattr(data,'ndim') or data.dtype.kind != 'O': # <<<<<<<<<<<<<< * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ */ /*else*/ { __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((!(__pyx_t_3 != 0)) != 0); if (!__pyx_t_8) { } else { __pyx_t_1 = __pyx_t_8; goto __pyx_L13_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __pyx_t_8; __pyx_L13_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3889 * if not hasattr(data,'ndim') or data.dtype.kind != 'O': * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_elem)), ((PyObject *)Py_TYPE(__pyx_builtin_Ellipsis)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { } else { __pyx_t_1 = __pyx_t_8; goto __pyx_L16_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":3890 * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 # <<<<<<<<<<<<<< * self._assign_vlen(elem, data) * return */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3889 * if not hasattr(data,'ndim') or data.dtype.kind != 'O': * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ __pyx_t_8 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_1 = __pyx_t_8; __pyx_L16_bool_binop_done:; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3890 * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 # <<<<<<<<<<<<<< * self._assign_vlen(elem, data) * return */ __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_elem, __pyx_int_0); /* "netCDF4/_netCDF4.pyx":3889 * if not hasattr(data,'ndim') or data.dtype.kind != 'O': * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ # <<<<<<<<<<<<<< * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) */ } /* "netCDF4/_netCDF4.pyx":3891 * if type(elem) == type(Ellipsis) and not\ * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) # <<<<<<<<<<<<<< * return * */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assign_vlen); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_4 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_v_elem); __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_data); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3892 * len(self.dimensions): elem = 0 * self._assign_vlen(elem, data) * return # <<<<<<<<<<<<<< * * # A numpy array is needed. Convert if necessary. */ __pyx_r = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":3887 * # not an object array, assume it represents a single element * # of the vlen var. * if not hasattr(data,'ndim') or data.dtype.kind != 'O': # <<<<<<<<<<<<<< * # issue 458, allow Ellipsis to be used for scalar var * if type(elem) == type(Ellipsis) and not\ */ } } __pyx_L4:; /* "netCDF4/_netCDF4.pyx":3863 * # to use. * * if self._isvlen: # if vlen, should be object array (don't try casting) # <<<<<<<<<<<<<< * if self.dtype == str: * # for string vars, if data is not an array */ } /* "netCDF4/_netCDF4.pyx":3896 * # A numpy array is needed. Convert if necessary. * # assume it's a numpy or masked array if it has an 'ndim' attribute. * if not hasattr(data,'ndim'): # <<<<<<<<<<<<<< * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ */ __pyx_t_1 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3898 * if not hasattr(data,'ndim'): * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ # <<<<<<<<<<<<<< * hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): * data = numpy.array(data,numpy.float) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_1) { goto __pyx_L21_next_or; } else { } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__pyx_t_1 != 0); if (!__pyx_t_3) { goto __pyx_L21_next_or; } else { } /* "netCDF4/_netCDF4.pyx":3899 * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ * hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * data = numpy.array(data,numpy.float) * else: */ __pyx_t_3 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_3 != 0); if (!__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L20_bool_binop_done; } __pyx_L21_next_or:; __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_1 != 0); __pyx_t_8 = __pyx_t_3; __pyx_L20_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3898 * if not hasattr(data,'ndim'): * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ # <<<<<<<<<<<<<< * hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): * data = numpy.array(data,numpy.float) */ if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3900 * if self.scale and self.dtype.kind in 'iu' and \ * hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): * data = numpy.array(data,numpy.float) # <<<<<<<<<<<<<< * else: * data = numpy.array(data,self.dtype) */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_4 = 1; } } __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_v_data); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3900; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3898 * if not hasattr(data,'ndim'): * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ # <<<<<<<<<<<<<< * hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): * data = numpy.array(data,numpy.float) */ goto __pyx_L19; } /* "netCDF4/_netCDF4.pyx":3902 * data = numpy.array(data,numpy.float) * else: * data = numpy.array(data,self.dtype) # <<<<<<<<<<<<<< * * # for Enum variable, make sure data is valid. */ /*else*/ { __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_4 = 1; } } __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_data); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_self->dtype); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3902; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L19:; /* "netCDF4/_netCDF4.pyx":3896 * # A numpy array is needed. Convert if necessary. * # assume it's a numpy or masked array if it has an 'ndim' attribute. * if not hasattr(data,'ndim'): # <<<<<<<<<<<<<< * # if auto scaling is to be done, don't cast to an integer yet. * if self.scale and self.dtype.kind in 'iu' and \ */ } /* "netCDF4/_netCDF4.pyx":3905 * * # for Enum variable, make sure data is valid. * if self._isenum: # <<<<<<<<<<<<<< * test = numpy.zeros(data.shape,numpy.bool) * for val in self.datatype.enum_dict.values(): */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3906 * # for Enum variable, make sure data is valid. * if self._isenum: * test = numpy.zeros(data.shape,numpy.bool) # <<<<<<<<<<<<<< * for val in self.datatype.enum_dict.values(): * test += data == val */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_bool); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_test = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3907 * if self._isenum: * test = numpy.zeros(data.shape,numpy.bool) * for val in self.datatype.enum_dict.values(): # <<<<<<<<<<<<<< * test += data == val * if not numpy.all(test): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_datatype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_enum_dict); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_10) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_11 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3907; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3908 * test = numpy.zeros(data.shape,numpy.bool) * for val in self.datatype.enum_dict.values(): * test += data == val # <<<<<<<<<<<<<< * if not numpy.all(test): * msg="trying to assign illegal value to Enum variable" */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_data, __pyx_v_val, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_test, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_test, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":3907 * if self._isenum: * test = numpy.zeros(data.shape,numpy.bool) * for val in self.datatype.enum_dict.values(): # <<<<<<<<<<<<<< * test += data == val * if not numpy.all(test): */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3909 * for val in self.datatype.enum_dict.values(): * test += data == val * if not numpy.all(test): # <<<<<<<<<<<<<< * msg="trying to assign illegal value to Enum variable" * raise ValueError(msg) */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_all); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_10) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_test); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_test); __Pyx_GIVEREF(__pyx_v_test); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_test); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = ((!__pyx_t_8) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3910 * test += data == val * if not numpy.all(test): * msg="trying to assign illegal value to Enum variable" # <<<<<<<<<<<<<< * raise ValueError(msg) * */ __Pyx_INCREF(__pyx_kp_s_trying_to_assign_illegal_value_t); __pyx_v_msg = __pyx_kp_s_trying_to_assign_illegal_value_t; /* "netCDF4/_netCDF4.pyx":3911 * if not numpy.all(test): * msg="trying to assign illegal value to Enum variable" * raise ValueError(msg) # <<<<<<<<<<<<<< * * start, count, stride, put_ind =\ */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_msg); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":3909 * for val in self.datatype.enum_dict.values(): * test += data == val * if not numpy.all(test): # <<<<<<<<<<<<<< * msg="trying to assign illegal value to Enum variable" * raise ValueError(msg) */ } /* "netCDF4/_netCDF4.pyx":3905 * * # for Enum variable, make sure data is valid. * if self._isenum: # <<<<<<<<<<<<<< * test = numpy.zeros(data.shape,numpy.bool) * for val in self.datatype.enum_dict.values(): */ } /* "netCDF4/_netCDF4.pyx":3914 * * start, count, stride, put_ind =\ * _StartCountStride(elem,self.shape,self.dimensions,self._grp,datashape=data.shape,put=True) # <<<<<<<<<<<<<< * datashape = _out_array_shape(count) * */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_StartCountStride); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_elem); __Pyx_GIVEREF(__pyx_v_elem); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_elem); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7); __Pyx_INCREF(__pyx_v_self->_grp); __Pyx_GIVEREF(__pyx_v_self->_grp); PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_self->_grp); __pyx_t_2 = 0; __pyx_t_7 = 0; __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_datashape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_put, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_10 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_10,&__pyx_t_5,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_10,&__pyx_t_5,&__pyx_t_9}; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_6); if (unlikely(!item)) goto __pyx_L28_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L29_unpacking_done; __pyx_L28_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L29_unpacking_done:; } /* "netCDF4/_netCDF4.pyx":3913 * raise ValueError(msg) * * start, count, stride, put_ind =\ # <<<<<<<<<<<<<< * _StartCountStride(elem,self.shape,self.dimensions,self._grp,datashape=data.shape,put=True) * datashape = _out_array_shape(count) */ __pyx_v_start = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_count = __pyx_t_10; __pyx_t_10 = 0; __pyx_v_stride = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_put_ind = __pyx_t_9; __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3915 * start, count, stride, put_ind =\ * _StartCountStride(elem,self.shape,self.dimensions,self._grp,datashape=data.shape,put=True) * datashape = _out_array_shape(count) # <<<<<<<<<<<<<< * * # if a numpy scalar, create an array of the right size */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_out_array_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_5) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_count); __Pyx_GIVEREF(__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_count); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_datashape = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":3919 * # if a numpy scalar, create an array of the right size * # and fill with scalar values. * if data.shape == (): # <<<<<<<<<<<<<< * data = numpy.tile(data,datashape) * # reshape data array by adding extra singleton dimensions */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3920 * # and fill with scalar values. * if data.shape == (): * data = numpy.tile(data,datashape) # <<<<<<<<<<<<<< * # reshape data array by adding extra singleton dimensions * # if needed to conform with start,count,stride. */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tile); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_data); __Pyx_INCREF(__pyx_v_datashape); __Pyx_GIVEREF(__pyx_v_datashape); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_datashape); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3919 * # if a numpy scalar, create an array of the right size * # and fill with scalar values. * if data.shape == (): # <<<<<<<<<<<<<< * data = numpy.tile(data,datashape) * # reshape data array by adding extra singleton dimensions */ } /* "netCDF4/_netCDF4.pyx":3923 * # reshape data array by adding extra singleton dimensions * # if needed to conform with start,count,stride. * if len(data.shape) != len(datashape): # <<<<<<<<<<<<<< * # create a view so shape in caller is not modified (issue 90) * data = data.view() */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_13 = PyObject_Length(__pyx_v_datashape); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = ((__pyx_t_4 != __pyx_t_13) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3925 * if len(data.shape) != len(datashape): * # create a view so shape in caller is not modified (issue 90) * data = data.view() # <<<<<<<<<<<<<< * data.shape = tuple(datashape) * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_view); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3926 * # create a view so shape in caller is not modified (issue 90) * data = data.view() * data.shape = tuple(datashape) # <<<<<<<<<<<<<< * * # Reshape these arrays so we can iterate over them. */ __pyx_t_9 = PySequence_Tuple(__pyx_v_datashape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); if (__Pyx_PyObject_SetAttrStr(__pyx_v_data, __pyx_n_s_shape, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3923 * # reshape data array by adding extra singleton dimensions * # if needed to conform with start,count,stride. * if len(data.shape) != len(datashape): # <<<<<<<<<<<<<< * # create a view so shape in caller is not modified (issue 90) * data = data.view() */ } /* "netCDF4/_netCDF4.pyx":3929 * * # Reshape these arrays so we can iterate over them. * start = start.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_start, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_3) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_5 = __pyx_v_self->ndim; goto __pyx_L32_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L32_bool_binop_done:; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3930 * # Reshape these arrays so we can iterate over them. * start = start.reshape((-1, self.ndim or 1)) * count = count.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * stride = stride.reshape((-1, self.ndim or 1)) * put_ind = put_ind.reshape((-1, self.ndim or 1)) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_count, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_3) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_7 = __pyx_v_self->ndim; goto __pyx_L34_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L34_bool_binop_done:; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_7) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3931 * start = start.reshape((-1, self.ndim or 1)) * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * put_ind = put_ind.reshape((-1, self.ndim or 1)) * */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_stride, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_3) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_5 = __pyx_v_self->ndim; goto __pyx_L36_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L36_bool_binop_done:; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_stride, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3932 * count = count.reshape((-1, self.ndim or 1)) * stride = stride.reshape((-1, self.ndim or 1)) * put_ind = put_ind.reshape((-1, self.ndim or 1)) # <<<<<<<<<<<<<< * * if 'least_significant_digit' in self.ncattrs(): */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_put_ind, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->ndim); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_3) { } else { __Pyx_INCREF(__pyx_v_self->ndim); __pyx_t_7 = __pyx_v_self->ndim; goto __pyx_L38_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __pyx_t_2; __pyx_t_2 = 0; __pyx_L38_bool_binop_done:; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_7) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_put_ind, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3934 * put_ind = put_ind.reshape((-1, self.ndim or 1)) * * if 'least_significant_digit' in self.ncattrs(): # <<<<<<<<<<<<<< * data = _quantize(data,self.least_significant_digit) * # if auto_scale mode set to True, (through */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ncattrs); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_least_significant_digit, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = (__pyx_t_3 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3935 * * if 'least_significant_digit' in self.ncattrs(): * data = _quantize(data,self.least_significant_digit) # <<<<<<<<<<<<<< * # if auto_scale mode set to True, (through * # a call to set_auto_scale or set_auto_maskandscale), */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_quantize); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_least_significant_digit); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_13 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_13 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_13, __pyx_v_data); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_13, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_9); __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":3934 * put_ind = put_ind.reshape((-1, self.ndim or 1)) * * if 'least_significant_digit' in self.ncattrs(): # <<<<<<<<<<<<<< * data = _quantize(data,self.least_significant_digit) * # if auto_scale mode set to True, (through */ } /* "netCDF4/_netCDF4.pyx":3944 * # missing_value/_Fill_Value. * # ignore if not a primitive or enum data type (not compound or vlen). * if self.mask and (self._isprimitive or self._isenum): # <<<<<<<<<<<<<< * # use missing_value as fill value. * # if no missing value set, use _FillValue. */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->mask); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { } else { __pyx_t_8 = __pyx_t_3; goto __pyx_L42_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_3) { } else { __pyx_t_8 = __pyx_t_3; goto __pyx_L42_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __pyx_t_3; __pyx_L42_bool_binop_done:; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3947 * # use missing_value as fill value. * # if no missing value set, use _FillValue. * if hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * # if not masked, create a masked array. * if not ma.isMA(data): data = self._toma(data) */ __pyx_t_3 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_3 != 0); if (!__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L46_bool_binop_done; } __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_1 != 0); __pyx_t_8 = __pyx_t_3; __pyx_L46_bool_binop_done:; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3949 * if hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): * # if not masked, create a masked array. * if not ma.isMA(data): data = self._toma(data) # <<<<<<<<<<<<<< * if self.scale and self._isprimitive: * # pack non-masked values using scale_factor and add_offset */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_isMA); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_10) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_3 = ((!__pyx_t_8) != 0); if (__pyx_t_3) { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toma); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_5) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_data); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_9); __pyx_t_9 = 0; } /* "netCDF4/_netCDF4.pyx":3947 * # use missing_value as fill value. * # if no missing value set, use _FillValue. * if hasattr(self, 'scale_factor') or hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * # if not masked, create a masked array. * if not ma.isMA(data): data = self._toma(data) */ } /* "netCDF4/_netCDF4.pyx":3944 * # missing_value/_Fill_Value. * # ignore if not a primitive or enum data type (not compound or vlen). * if self.mask and (self._isprimitive or self._isenum): # <<<<<<<<<<<<<< * # use missing_value as fill value. * # if no missing value set, use _FillValue. */ } /* "netCDF4/_netCDF4.pyx":3950 * # if not masked, create a masked array. * if not ma.isMA(data): data = self._toma(data) * if self.scale and self._isprimitive: # <<<<<<<<<<<<<< * # pack non-masked values using scale_factor and add_offset * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->scale); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { } else { __pyx_t_3 = __pyx_t_8; goto __pyx_L50_bool_binop_done; } __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_8; __pyx_L50_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3952 * if self.scale and self._isprimitive: * # pack non-masked values using scale_factor and add_offset * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * data = (data - self.add_offset)/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) */ __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_8 != 0); if (__pyx_t_1) { } else { __pyx_t_3 = __pyx_t_1; goto __pyx_L53_bool_binop_done; } __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_t_1 != 0); __pyx_t_3 = __pyx_t_8; __pyx_L53_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3953 * # pack non-masked values using scale_factor and add_offset * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): * data = (data - self.add_offset)/self.scale_factor # <<<<<<<<<<<<<< * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'scale_factor'): */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyNumber_Subtract(__pyx_v_data, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":3954 * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): * data = (data - self.add_offset)/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) # <<<<<<<<<<<<<< * elif hasattr(self, 'scale_factor'): * data = data/self.scale_factor */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_10, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = (__pyx_t_3 != 0); if (__pyx_t_8) { __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_around); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_9) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_10); __pyx_t_10 = 0; } /* "netCDF4/_netCDF4.pyx":3952 * if self.scale and self._isprimitive: * # pack non-masked values using scale_factor and add_offset * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * data = (data - self.add_offset)/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) */ goto __pyx_L52; } /* "netCDF4/_netCDF4.pyx":3955 * data = (data - self.add_offset)/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'scale_factor'): # <<<<<<<<<<<<<< * data = data/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) */ __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_8 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3956 * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'scale_factor'): * data = data/self.scale_factor # <<<<<<<<<<<<<< * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'add_offset'): */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale_factor); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3957 * elif hasattr(self, 'scale_factor'): * data = data/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) # <<<<<<<<<<<<<< * elif hasattr(self, 'add_offset'): * data = data - self.add_offset */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = (__pyx_t_3 != 0); if (__pyx_t_8) { __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_around); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_10) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7); __pyx_t_7 = 0; } /* "netCDF4/_netCDF4.pyx":3955 * data = (data - self.add_offset)/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'scale_factor'): # <<<<<<<<<<<<<< * data = data/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) */ goto __pyx_L52; } /* "netCDF4/_netCDF4.pyx":3958 * data = data/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * data = data - self.add_offset * if self.dtype.kind in 'iu': data = numpy.around(data) */ __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = (__pyx_t_8 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":3959 * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'add_offset'): * data = data - self.add_offset # <<<<<<<<<<<<<< * if self.dtype.kind in 'iu': data = numpy.around(data) * if ma.isMA(data): */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_offset); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyNumber_Subtract(__pyx_v_data, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3960 * elif hasattr(self, 'add_offset'): * data = data - self.add_offset * if self.dtype.kind in 'iu': data = numpy.around(data) # <<<<<<<<<<<<<< * if ma.isMA(data): * # if underlying data in masked regions of masked array */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_n_s_iu, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (__pyx_t_3 != 0); if (__pyx_t_8) { __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_around); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_7) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_data); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; } /* "netCDF4/_netCDF4.pyx":3958 * data = data/self.scale_factor * if self.dtype.kind in 'iu': data = numpy.around(data) * elif hasattr(self, 'add_offset'): # <<<<<<<<<<<<<< * data = data - self.add_offset * if self.dtype.kind in 'iu': data = numpy.around(data) */ } __pyx_L52:; /* "netCDF4/_netCDF4.pyx":3961 * data = data - self.add_offset * if self.dtype.kind in 'iu': data = numpy.around(data) * if ma.isMA(data): # <<<<<<<<<<<<<< * # if underlying data in masked regions of masked array * # corresponds to missing values, don't fill masked array - */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_ma); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_isMA); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_9) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_INCREF(__pyx_v_data); __Pyx_GIVEREF(__pyx_v_data); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3965 * # corresponds to missing values, don't fill masked array - * # just use underlying data instead * if hasattr(self, 'missing_value') and \ # <<<<<<<<<<<<<< * numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)): * data = data.data */ __pyx_t_3 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { } else { __pyx_t_8 = __pyx_t_1; goto __pyx_L60_bool_binop_done; } /* "netCDF4/_netCDF4.pyx":3966 * # just use underlying data instead * if hasattr(self, 'missing_value') and \ * numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)): # <<<<<<<<<<<<<< * data = data.data * else: */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_all); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_in1d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_mask); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_14 = PyObject_GetItem(__pyx_t_9, __pyx_t_6); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_13 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_13 = 1; } } __pyx_t_15 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_13, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_13, __pyx_t_6); __pyx_t_14 = 0; __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_2) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __pyx_t_1; __pyx_L60_bool_binop_done:; /* "netCDF4/_netCDF4.pyx":3965 * # corresponds to missing values, don't fill masked array - * # just use underlying data instead * if hasattr(self, 'missing_value') and \ # <<<<<<<<<<<<<< * numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)): * data = data.data */ if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3967 * if hasattr(self, 'missing_value') and \ * numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)): * data = data.data # <<<<<<<<<<<<<< * else: * if hasattr(self, 'missing_value'): */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3965 * # corresponds to missing values, don't fill masked array - * # just use underlying data instead * if hasattr(self, 'missing_value') and \ # <<<<<<<<<<<<<< * numpy.all(numpy.in1d(data.data[data.mask],self.missing_value)): * data = data.data */ goto __pyx_L59; } /* "netCDF4/_netCDF4.pyx":3969 * data = data.data * else: * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<< * # if missing value is a scalar, use it as fill_value. * # if missing value is a vector, raise an exception */ /*else*/ { __pyx_t_8 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = (__pyx_t_8 != 0); if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3973 * # if missing value is a vector, raise an exception * # since we then don't know how to fill in masked values. * if numpy.array(self.missing_value).shape == (): # <<<<<<<<<<<<<< * fillval = self.missing_value * else: */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } if (!__pyx_t_10) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_t_15, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3974 * # since we then don't know how to fill in masked values. * if numpy.array(self.missing_value).shape == (): * fillval = self.missing_value # <<<<<<<<<<<<<< * else: * msg="cannot assign fill_value for masked array when missing_value attribute is not a scalar" */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_missing_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_v_fillval = __pyx_t_5; __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":3973 * # if missing value is a vector, raise an exception * # since we then don't know how to fill in masked values. * if numpy.array(self.missing_value).shape == (): # <<<<<<<<<<<<<< * fillval = self.missing_value * else: */ goto __pyx_L63; } /* "netCDF4/_netCDF4.pyx":3976 * fillval = self.missing_value * else: * msg="cannot assign fill_value for masked array when missing_value attribute is not a scalar" # <<<<<<<<<<<<<< * raise RuntimeError(msg) * if numpy.array(fillval).shape != (): */ /*else*/ { __Pyx_INCREF(__pyx_kp_s_cannot_assign_fill_value_for_mas); __pyx_v_msg = __pyx_kp_s_cannot_assign_fill_value_for_mas; /* "netCDF4/_netCDF4.pyx":3977 * else: * msg="cannot assign fill_value for masked array when missing_value attribute is not a scalar" * raise RuntimeError(msg) # <<<<<<<<<<<<<< * if numpy.array(fillval).shape != (): * fillval = fillval[0] */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_msg); __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_15, 0, 0, 0); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L63:; /* "netCDF4/_netCDF4.pyx":3978 * msg="cannot assign fill_value for masked array when missing_value attribute is not a scalar" * raise RuntimeError(msg) * if numpy.array(fillval).shape != (): # <<<<<<<<<<<<<< * fillval = fillval[0] * elif hasattr(self, '_FillValue'): */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_fillval); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_INCREF(__pyx_v_fillval); __Pyx_GIVEREF(__pyx_v_fillval); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_fillval); __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = PyObject_RichCompare(__pyx_t_2, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":3979 * raise RuntimeError(msg) * if numpy.array(fillval).shape != (): * fillval = fillval[0] # <<<<<<<<<<<<<< * elif hasattr(self, '_FillValue'): * fillval = self._FillValue */ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_fillval, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF_SET(__pyx_v_fillval, __pyx_t_15); __pyx_t_15 = 0; /* "netCDF4/_netCDF4.pyx":3978 * msg="cannot assign fill_value for masked array when missing_value attribute is not a scalar" * raise RuntimeError(msg) * if numpy.array(fillval).shape != (): # <<<<<<<<<<<<<< * fillval = fillval[0] * elif hasattr(self, '_FillValue'): */ } /* "netCDF4/_netCDF4.pyx":3969 * data = data.data * else: * if hasattr(self, 'missing_value'): # <<<<<<<<<<<<<< * # if missing value is a scalar, use it as fill_value. * # if missing value is a vector, raise an exception */ goto __pyx_L62; } /* "netCDF4/_netCDF4.pyx":3980 * if numpy.array(fillval).shape != (): * fillval = fillval[0] * elif hasattr(self, '_FillValue'): # <<<<<<<<<<<<<< * fillval = self._FillValue * else: */ __pyx_t_1 = PyObject_HasAttr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = (__pyx_t_1 != 0); if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3981 * fillval = fillval[0] * elif hasattr(self, '_FillValue'): * fillval = self._FillValue # <<<<<<<<<<<<<< * else: * fillval = default_fillvals[self.dtype.str[1:]] */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_FillValue); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_v_fillval = __pyx_t_15; __pyx_t_15 = 0; /* "netCDF4/_netCDF4.pyx":3980 * if numpy.array(fillval).shape != (): * fillval = fillval[0] * elif hasattr(self, '_FillValue'): # <<<<<<<<<<<<<< * fillval = self._FillValue * else: */ goto __pyx_L62; } /* "netCDF4/_netCDF4.pyx":3983 * fillval = self._FillValue * else: * fillval = default_fillvals[self.dtype.str[1:]] # <<<<<<<<<<<<<< * data = data.filled(fill_value=fillval) * */ /*else*/ { __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_fillvals); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->dtype, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__64, 1, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem(__pyx_t_15, __pyx_t_7); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_fillval = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L62:; /* "netCDF4/_netCDF4.pyx":3984 * else: * fillval = default_fillvals[self.dtype.str[1:]] * data = data.filled(fill_value=fillval) # <<<<<<<<<<<<<< * * # Fill output array with data chunks. */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_filled); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fill_value, __pyx_v_fillval) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_15); __pyx_t_15 = 0; } __pyx_L59:; /* "netCDF4/_netCDF4.pyx":3961 * data = data - self.add_offset * if self.dtype.kind in 'iu': data = numpy.around(data) * if ma.isMA(data): # <<<<<<<<<<<<<< * # if underlying data in masked regions of masked array * # corresponds to missing values, don't fill masked array - */ } /* "netCDF4/_netCDF4.pyx":3950 * # if not masked, create a masked array. * if not ma.isMA(data): data = self._toma(data) * if self.scale and self._isprimitive: # <<<<<<<<<<<<<< * # pack non-masked values using scale_factor and add_offset * if hasattr(self, 'scale_factor') and hasattr(self, 'add_offset'): */ } /* "netCDF4/_netCDF4.pyx":3987 * * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): # <<<<<<<<<<<<<< * dataput = data[tuple(i)] * if dataput.size == 0: continue # nothing to write */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_13 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_13 = 1; } } __pyx_t_5 = PyTuple_New(4+__pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_start); __Pyx_GIVEREF(__pyx_v_start); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_13, __pyx_v_start); __Pyx_INCREF(__pyx_v_count); __Pyx_GIVEREF(__pyx_v_count); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_v_count); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_13, __pyx_v_stride); __Pyx_INCREF(__pyx_v_put_ind); __Pyx_GIVEREF(__pyx_v_put_ind); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_13, __pyx_v_put_ind); __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(PyList_CheckExact(__pyx_t_15)) || PyTuple_CheckExact(__pyx_t_15)) { __pyx_t_7 = __pyx_t_15; __Pyx_INCREF(__pyx_t_7); __pyx_t_13 = 0; __pyx_t_11 = NULL; } else { __pyx_t_13 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_15 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); #endif } else { if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_15 = PySequence_ITEM(__pyx_t_7, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); #endif } } else { __pyx_t_15 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_15)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_15); } if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { PyObject* sequence = __pyx_t_15; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_10 = PyList_GET_ITEM(sequence, 2); __pyx_t_6 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_10,&__pyx_t_6}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_10,&__pyx_t_6}; __pyx_t_14 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_12 = Py_TYPE(__pyx_t_14)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_12(__pyx_t_14); if (unlikely(!item)) goto __pyx_L67_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_14), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L68_unpacking_done; __pyx_L67_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L68_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":3988 * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): * dataput = data[tuple(i)] # <<<<<<<<<<<<<< * if dataput.size == 0: continue # nothing to write * # convert array scalar to regular array with one element. */ __pyx_t_15 = PySequence_Tuple(__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_t_15); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF_SET(__pyx_v_dataput, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":3989 * for (a,b,c,i) in zip(start, count, stride, put_ind): * dataput = data[tuple(i)] * if dataput.size == 0: continue # nothing to write # <<<<<<<<<<<<<< * # convert array scalar to regular array with one element. * if dataput.shape == (): */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_15 = __Pyx_PyInt_EqObjC(__pyx_t_6, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (__pyx_t_8) { goto __pyx_L65_continue; } /* "netCDF4/_netCDF4.pyx":3991 * if dataput.size == 0: continue # nothing to write * # convert array scalar to regular array with one element. * if dataput.shape == (): # <<<<<<<<<<<<<< * if self._isvlen: * dataput=numpy.array(dataput,'O') */ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_shape); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = PyObject_RichCompare(__pyx_t_15, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3992 * # convert array scalar to regular array with one element. * if dataput.shape == (): * if self._isvlen: # <<<<<<<<<<<<<< * dataput=numpy.array(dataput,'O') * else: */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { /* "netCDF4/_netCDF4.pyx":3993 * if dataput.shape == (): * if self._isvlen: * dataput=numpy.array(dataput,'O') # <<<<<<<<<<<<<< * else: * dataput=numpy.array(dataput,dataput.dtype) */ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_4 = 1; } } __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_dataput); __Pyx_GIVEREF(__pyx_v_dataput); PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_dataput); __Pyx_INCREF(__pyx_n_s_O); __Pyx_GIVEREF(__pyx_n_s_O); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_n_s_O); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_dataput, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":3992 * # convert array scalar to regular array with one element. * if dataput.shape == (): * if self._isvlen: # <<<<<<<<<<<<<< * dataput=numpy.array(dataput,'O') * else: */ goto __pyx_L71; } /* "netCDF4/_netCDF4.pyx":3995 * dataput=numpy.array(dataput,'O') * else: * dataput=numpy.array(dataput,dataput.dtype) # <<<<<<<<<<<<<< * self._put(dataput,a,b,c) * */ /*else*/ { __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_dataput, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_INCREF(__pyx_v_dataput); __Pyx_GIVEREF(__pyx_v_dataput); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_dataput); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_dataput, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L71:; /* "netCDF4/_netCDF4.pyx":3991 * if dataput.size == 0: continue # nothing to write * # convert array scalar to regular array with one element. * if dataput.shape == (): # <<<<<<<<<<<<<< * if self._isvlen: * dataput=numpy.array(dataput,'O') */ } /* "netCDF4/_netCDF4.pyx":3996 * else: * dataput=numpy.array(dataput,dataput.dtype) * self._put(dataput,a,b,c) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_put_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } __pyx_t_10 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_dataput); __Pyx_GIVEREF(__pyx_v_dataput); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_dataput); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_v_a); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_v_b); __Pyx_INCREF(__pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_4, __pyx_v_c); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":3987 * * # Fill output array with data chunks. * for (a,b,c,i) in zip(start, count, stride, put_ind): # <<<<<<<<<<<<<< * dataput = data[tuple(i)] * if dataput.size == 0: continue # nothing to write */ __pyx_L65_continue:; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":3856 * free(countp) * * def __setitem__(self, elem, data): # <<<<<<<<<<<<<< * # This special method is used to assign to the netCDF variable * # using "extended slice syntax". The extended slice syntax */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_test); __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_count); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_put_ind); __Pyx_XDECREF(__pyx_v_datashape); __Pyx_XDECREF(__pyx_v_fillval); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_c); __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_dataput); __Pyx_XDECREF(__pyx_v_elem); __Pyx_XDECREF(__pyx_v_data); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":3999 * * * def __len__(self): # <<<<<<<<<<<<<< * if not self.shape: * raise TypeError('len() of unsized object') */ /* Python wrapper */ static Py_ssize_t __pyx_pw_7netCDF4_8_netCDF4_8Variable_51__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_7netCDF4_8_netCDF4_8Variable_51__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_50__len__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_7netCDF4_8_netCDF4_8Variable_50__len__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "netCDF4/_netCDF4.pyx":4000 * * def __len__(self): * if not self.shape: # <<<<<<<<<<<<<< * raise TypeError('len() of unsized object') * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4001 * def __len__(self): * if not self.shape: * raise TypeError('len() of unsized object') # <<<<<<<<<<<<<< * else: * return self.shape[0] */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4000 * * def __len__(self): * if not self.shape: # <<<<<<<<<<<<<< * raise TypeError('len() of unsized object') * else: */ } /* "netCDF4/_netCDF4.pyx":4003 * raise TypeError('len() of unsized object') * else: * return self.shape[0] # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":3999 * * * def __len__(self): # <<<<<<<<<<<<<< * if not self.shape: * raise TypeError('len() of unsized object') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4006 * * * def assignValue(self,val): # <<<<<<<<<<<<<< * """ * **`assignValue(self, val)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_53assignValue(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_52assignValue[] = "\n**`assignValue(self, val)`**\n\nassign a value to a scalar variable. Provided for compatibility with\nScientific.IO.NetCDF, can also be done by assigning to an Ellipsis slice ([...])."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_53assignValue(PyObject *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assignValue (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_52assignValue(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_val)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_52assignValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_val) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assignValue", 0); /* "netCDF4/_netCDF4.pyx":4012 * assign a value to a scalar variable. Provided for compatibility with * Scientific.IO.NetCDF, can also be done by assigning to an Ellipsis slice ([...]).""" * if len(self.dimensions): # <<<<<<<<<<<<<< * raise IndexError('to assign values to a non-scalar variable, use a slice') * self[:]=val */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4013 * Scientific.IO.NetCDF, can also be done by assigning to an Ellipsis slice ([...]).""" * if len(self.dimensions): * raise IndexError('to assign values to a non-scalar variable, use a slice') # <<<<<<<<<<<<<< * self[:]=val * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4012 * assign a value to a scalar variable. Provided for compatibility with * Scientific.IO.NetCDF, can also be done by assigning to an Ellipsis slice ([...]).""" * if len(self.dimensions): # <<<<<<<<<<<<<< * raise IndexError('to assign values to a non-scalar variable, use a slice') * self[:]=val */ } /* "netCDF4/_netCDF4.pyx":4014 * if len(self.dimensions): * raise IndexError('to assign values to a non-scalar variable, use a slice') * self[:]=val # <<<<<<<<<<<<<< * * def getValue(self): */ if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self), __pyx_v_val, 0, 0, NULL, NULL, &__pyx_slice__67, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4006 * * * def assignValue(self,val): # <<<<<<<<<<<<<< * """ * **`assignValue(self, val)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.assignValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4016 * self[:]=val * * def getValue(self): # <<<<<<<<<<<<<< * """ * **`getValue(self)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_55getValue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_54getValue[] = "\n**`getValue(self)`**\n\nget the value of a scalar variable. Provided for compatibility with\nScientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...])."; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_55getValue(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_54getValue(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_54getValue(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 0); /* "netCDF4/_netCDF4.pyx":4022 * get the value of a scalar variable. Provided for compatibility with * Scientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...]).""" * if len(self.dimensions): # <<<<<<<<<<<<<< * raise IndexError('to retrieve values from a non-scalar variable, use slicing') * return self[slice(None)] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4023 * Scientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...]).""" * if len(self.dimensions): * raise IndexError('to retrieve values from a non-scalar variable, use slicing') # <<<<<<<<<<<<<< * return self[slice(None)] * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4022 * get the value of a scalar variable. Provided for compatibility with * Scientific.IO.NetCDF, can also be done by slicing with an Ellipsis ([...]).""" * if len(self.dimensions): # <<<<<<<<<<<<<< * raise IndexError('to retrieve values from a non-scalar variable, use slicing') * return self[slice(None)] */ } /* "netCDF4/_netCDF4.pyx":4024 * if len(self.dimensions): * raise IndexError('to retrieve values from a non-scalar variable, use slicing') * return self[slice(None)] # <<<<<<<<<<<<<< * * def set_auto_maskandscale(self,maskandscale): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_slice__69); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4016 * self[:]=val * * def getValue(self): # <<<<<<<<<<<<<< * """ * **`getValue(self)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4026 * return self[slice(None)] * * def set_auto_maskandscale(self,maskandscale): # <<<<<<<<<<<<<< * """ * **`set_auto_maskandscale(self,maskandscale)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_57set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_maskandscale); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_56set_auto_maskandscale[] = "\n**`set_auto_maskandscale(self,maskandscale)`**\n\nturn on or off automatic conversion of variable data to and\nfrom masked arrays and automatic packing/unpacking of variable\ndata using `scale_factor` and `add_offset` attributes.\n\nIf `maskandscale` is set to `True`, when data is read from a variable\nit is converted to a masked array if any of the values are exactly\nequal to the either the netCDF _FillValue or the value specified by the\nmissing_value variable attribute. The fill_value of the masked array\nis set to the missing_value attribute (if it exists), otherwise\nthe netCDF _FillValue attribute (which has a default value\nfor each data type). When data is written to a variable, the masked\narray is converted back to a regular numpy array by replacing all the\nmasked values by the fill_value of the masked array.\n\nIf `maskandscale` is set to `True`, and the variable has a\n`scale_factor` or an `add_offset` attribute, then data read\nfrom that variable is unpacked using::\n\n data = self.scale_factor*data + self.add_offset\n\nWhen data is written to a variable it is packed using::\n\n data = (data - self.add_offset)/self.scale_factor\n\nIf either scale_factor is present, but add_offset is missing, add_offset\nis assumed zero. If add_offset is present, but scale_factor is missing,\nscale_factor is assumed to be one.\nFor more information on how `scale_factor` and `add_offset` can be\nused to provide simple compression, see the\n[PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml).\n\nThe default value of `maskandscale` is `True`\n(automatic conversions are performed).\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_57set_auto_maskandscale(PyObject *__pyx_v_self, PyObject *__pyx_v_maskandscale) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_maskandscale (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_56set_auto_maskandscale(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_maskandscale)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_56set_auto_maskandscale(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_maskandscale) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_maskandscale", 0); /* "netCDF4/_netCDF4.pyx":4064 * (automatic conversions are performed). * """ * if maskandscale: # <<<<<<<<<<<<<< * self.scale = True * self.mask = True */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_maskandscale); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":4065 * """ * if maskandscale: * self.scale = True # <<<<<<<<<<<<<< * self.mask = True * else: */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_True; /* "netCDF4/_netCDF4.pyx":4066 * if maskandscale: * self.scale = True * self.mask = True # <<<<<<<<<<<<<< * else: * self.scale = False */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_True; /* "netCDF4/_netCDF4.pyx":4064 * (automatic conversions are performed). * """ * if maskandscale: # <<<<<<<<<<<<<< * self.scale = True * self.mask = True */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4068 * self.mask = True * else: * self.scale = False # <<<<<<<<<<<<<< * self.mask = False * */ /*else*/ { __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_False; /* "netCDF4/_netCDF4.pyx":4069 * else: * self.scale = False * self.mask = False # <<<<<<<<<<<<<< * * def set_auto_scale(self,scale): */ __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_False; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4026 * return self[slice(None)] * * def set_auto_maskandscale(self,maskandscale): # <<<<<<<<<<<<<< * """ * **`set_auto_maskandscale(self,maskandscale)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.set_auto_maskandscale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4071 * self.mask = False * * def set_auto_scale(self,scale): # <<<<<<<<<<<<<< * """ * **`set_auto_scale(self,scale)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_59set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_scale); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_58set_auto_scale[] = "\n**`set_auto_scale(self,scale)`**\n\nturn on or off automatic packing/unpacking of variable\ndata using `scale_factor` and `add_offset` attributes.\n\nIf `scale` is set to `True`, and the variable has a\n`scale_factor` or an `add_offset` attribute, then data read\nfrom that variable is unpacked using::\n\n data = self.scale_factor*data + self.add_offset\n\nWhen data is written to a variable it is packed using::\n\n data = (data - self.add_offset)/self.scale_factor\n\nIf either scale_factor is present, but add_offset is missing, add_offset\nis assumed zero. If add_offset is present, but scale_factor is missing,\nscale_factor is assumed to be one.\nFor more information on how `scale_factor` and `add_offset` can be\nused to provide simple compression, see the\n[PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml).\n\nThe default value of `scale` is `True`\n(automatic conversions are performed).\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_59set_auto_scale(PyObject *__pyx_v_self, PyObject *__pyx_v_scale) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_scale (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_58set_auto_scale(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_scale)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_58set_auto_scale(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_scale) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_scale", 0); /* "netCDF4/_netCDF4.pyx":4098 * (automatic conversions are performed). * """ * if scale: # <<<<<<<<<<<<<< * self.scale = True * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_scale); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4098; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":4099 * """ * if scale: * self.scale = True # <<<<<<<<<<<<<< * else: * self.scale = False */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_True; /* "netCDF4/_netCDF4.pyx":4098 * (automatic conversions are performed). * """ * if scale: # <<<<<<<<<<<<<< * self.scale = True * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4101 * self.scale = True * else: * self.scale = False # <<<<<<<<<<<<<< * * def set_auto_mask(self,mask): */ /*else*/ { __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_False; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4071 * self.mask = False * * def set_auto_scale(self,scale): # <<<<<<<<<<<<<< * """ * **`set_auto_scale(self,scale)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.set_auto_scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4103 * self.scale = False * * def set_auto_mask(self,mask): # <<<<<<<<<<<<<< * """ * **`set_auto_mask(self,mask)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_61set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_mask); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_60set_auto_mask[] = "\n**`set_auto_mask(self,mask)`**\n\nturn on or off automatic conversion of variable data to and\nfrom masked arrays .\n\nIf `mask` is set to `True`, when data is read from a variable\nit is converted to a masked array if any of the values are exactly\nequal to the either the netCDF _FillValue or the value specified by the\nmissing_value variable attribute. The fill_value of the masked array\nis set to the missing_value attribute (if it exists), otherwise\nthe netCDF _FillValue attribute (which has a default value\nfor each data type). When data is written to a variable, the masked\narray is converted back to a regular numpy array by replacing all the\nmasked values by the fill_value of the masked array.\n\nThe default value of `mask` is `True`\n(automatic conversions are performed).\n "; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_61set_auto_mask(PyObject *__pyx_v_self, PyObject *__pyx_v_mask) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_auto_mask (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_60set_auto_mask(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_mask)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_60set_auto_mask(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_mask) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_auto_mask", 0); /* "netCDF4/_netCDF4.pyx":4123 * (automatic conversions are performed). * """ * if mask: # <<<<<<<<<<<<<< * self.mask = True * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mask); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "netCDF4/_netCDF4.pyx":4124 * """ * if mask: * self.mask = True # <<<<<<<<<<<<<< * else: * self.mask = False */ __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_True; /* "netCDF4/_netCDF4.pyx":4123 * (automatic conversions are performed). * """ * if mask: # <<<<<<<<<<<<<< * self.mask = True * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4126 * self.mask = True * else: * self.mask = False # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_False; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4103 * self.scale = False * * def set_auto_mask(self,mask): # <<<<<<<<<<<<<< * """ * **`set_auto_mask(self,mask)`** */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable.set_auto_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4129 * * * def _put(self,ndarray data,start,count,stride): # <<<<<<<<<<<<<< * """Private method to put data into a netCDF variable""" * cdef int ierr, ndims */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_63_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_62_put[] = "Private method to put data into a netCDF variable"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_63_put(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_data = 0; PyObject *__pyx_v_start = 0; PyObject *__pyx_v_count = 0; PyObject *__pyx_v_stride = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_put (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_start,&__pyx_n_s_count,&__pyx_n_s_stride,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_put", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_put", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stride)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_put", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_put") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_data = ((PyArrayObject *)values[0]); __pyx_v_start = values[1]; __pyx_v_count = values[2]; __pyx_v_stride = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_put", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7netCDF4_8_netCDF4_ndarray, 1, "data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_62_put(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_data, __pyx_v_start, __pyx_v_count, __pyx_v_stride); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_62_put(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyArrayObject *__pyx_v_data, PyObject *__pyx_v_start, PyObject *__pyx_v_count, PyObject *__pyx_v_stride) { int __pyx_v_ierr; int __pyx_v_ndims; npy_intp __pyx_v_totelem; size_t *__pyx_v_startp; size_t *__pyx_v_countp; ptrdiff_t *__pyx_v_stridep; char **__pyx_v_strdata; void *__pyx_v_elptr; char *__pyx_v_databuff; PyArrayObject *__pyx_v_dataarr = 0; nc_vlen_t *__pyx_v_vldata; long __pyx_v_negstride; PyObject *__pyx_v_sl = NULL; PyObject *__pyx_v_n = NULL; npy_intp __pyx_v_dataelem; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; long __pyx_t_7; size_t __pyx_t_8; ptrdiff_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; char *__pyx_t_14; PyObject *(*__pyx_t_15)(PyObject *); npy_intp __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_put", 0); __Pyx_INCREF((PyObject *)__pyx_v_data); /* "netCDF4/_netCDF4.pyx":4142 * cdef nc_vlen_t *vldata * # rank of variable. * ndims = len(self.dimensions) # <<<<<<<<<<<<<< * # make sure data is contiguous. * # if not, make a local copy. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndims = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4145 * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(data): # <<<<<<<<<<<<<< * data = data.copy() * # fill up startp,countp,stridep. */ __pyx_t_3 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_data) != 0)) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4146 * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(data): * data = data.copy() # <<<<<<<<<<<<<< * # fill up startp,countp,stridep. * totelem = 1 */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4145 * # make sure data is contiguous. * # if not, make a local copy. * if not PyArray_ISCONTIGUOUS(data): # <<<<<<<<<<<<<< * data = data.copy() * # fill up startp,countp,stridep. */ } /* "netCDF4/_netCDF4.pyx":4148 * data = data.copy() * # fill up startp,countp,stridep. * totelem = 1 # <<<<<<<<<<<<<< * negstride = 0 * sl = [] */ __pyx_v_totelem = 1; /* "netCDF4/_netCDF4.pyx":4149 * # fill up startp,countp,stridep. * totelem = 1 * negstride = 0 # <<<<<<<<<<<<<< * sl = [] * startp = malloc(sizeof(size_t) * ndims) */ __pyx_v_negstride = 0; /* "netCDF4/_netCDF4.pyx":4150 * totelem = 1 * negstride = 0 * sl = [] # <<<<<<<<<<<<<< * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sl = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4151 * negstride = 0 * sl = [] * startp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) */ __pyx_v_startp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4152 * sl = [] * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: */ __pyx_v_countp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4153 * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 */ __pyx_v_stridep = ((ptrdiff_t *)malloc(((sizeof(ptrdiff_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4154 * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * count[n] = abs(count[n]) # make -1 into +1 * countp[n] = count[n] */ __pyx_t_6 = __pyx_v_ndims; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7++) { __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4155 * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 # <<<<<<<<<<<<<< * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) */ __pyx_t_1 = PyObject_GetItem(__pyx_v_count, __pyx_v_n); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(__pyx_v_count, __pyx_v_n, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4156 * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 * countp[n] = count[n] # <<<<<<<<<<<<<< * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: */ __pyx_t_4 = PyObject_GetItem(__pyx_v_count, __pyx_v_n); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_countp[__pyx_t_2]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4158 * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: # <<<<<<<<<<<<<< * negstride = 1 * stridep[n] = -stride[n] */ __pyx_t_4 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4159 * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: * negstride = 1 # <<<<<<<<<<<<<< * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) */ __pyx_v_negstride = 1; /* "netCDF4/_netCDF4.pyx":4160 * if stride[n] < 0: * negstride = 1 * stridep[n] = -stride[n] # <<<<<<<<<<<<<< * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] */ __pyx_t_1 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_ptrdiff_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (ptrdiff_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_stridep[__pyx_t_2]) = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4161 * negstride = 1 * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) # <<<<<<<<<<<<<< * stride[n] = -stride[n] * sl.append(slice(None, None, -1)) # this slice will reverse the data */ __pyx_t_4 = PyObject_GetItem(__pyx_v_start, __pyx_v_n); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_GetItem(__pyx_v_count, __pyx_v_n); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_10); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_startp[__pyx_t_2]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4162 * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] # <<<<<<<<<<<<<< * sl.append(slice(None, None, -1)) # this slice will reverse the data * else: */ __pyx_t_10 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_5 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(PyObject_SetItem(__pyx_v_stride, __pyx_v_n, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":4163 * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] * sl.append(slice(None, None, -1)) # this slice will reverse the data # <<<<<<<<<<<<<< * else: * startp[n] = start[n] */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sl, __pyx_slice__70); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4158 * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: # <<<<<<<<<<<<<< * negstride = 1 * stridep[n] = -stride[n] */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":4165 * sl.append(slice(None, None, -1)) # this slice will reverse the data * else: * startp[n] = start[n] # <<<<<<<<<<<<<< * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) */ /*else*/ { __pyx_t_5 = PyObject_GetItem(__pyx_v_start, __pyx_v_n); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_startp[__pyx_t_2]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4166 * else: * startp[n] = start[n] * stridep[n] = stride[n] # <<<<<<<<<<<<<< * sl.append(slice(None,None, 1)) * totelem = totelem*countp[n] */ __pyx_t_5 = PyObject_GetItem(__pyx_v_stride, __pyx_v_n); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_As_ptrdiff_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (ptrdiff_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} (__pyx_v_stridep[__pyx_t_2]) = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4167 * startp[n] = start[n] * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) # <<<<<<<<<<<<<< * totelem = totelem*countp[n] * # check to see that size of data array is what is expected */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sl, __pyx_slice__71); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; /* "netCDF4/_netCDF4.pyx":4168 * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) * totelem = totelem*countp[n] # <<<<<<<<<<<<<< * # check to see that size of data array is what is expected * # for slice given. */ __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_totelem = (__pyx_v_totelem * (__pyx_v_countp[__pyx_t_2])); __pyx_t_7 = __Pyx_PyInt_As_long(__pyx_v_n); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":4154 * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * count[n] = abs(count[n]) # make -1 into +1 * countp[n] = count[n] */ __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":4171 * # check to see that size of data array is what is expected * # for slice given. * dataelem = PyArray_SIZE(data) # <<<<<<<<<<<<<< * if totelem != dataelem: * raise IndexError('size of data array does not conform to slice') */ __pyx_v_dataelem = PyArray_SIZE(__pyx_v_data); /* "netCDF4/_netCDF4.pyx":4172 * # for slice given. * dataelem = PyArray_SIZE(data) * if totelem != dataelem: # <<<<<<<<<<<<<< * raise IndexError('size of data array does not conform to slice') * if negstride: */ __pyx_t_3 = ((__pyx_v_totelem != __pyx_v_dataelem) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4173 * dataelem = PyArray_SIZE(data) * if totelem != dataelem: * raise IndexError('size of data array does not conform to slice') # <<<<<<<<<<<<<< * if negstride: * # reverse data along axes with negative strides. */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4172 * # for slice given. * dataelem = PyArray_SIZE(data) * if totelem != dataelem: # <<<<<<<<<<<<<< * raise IndexError('size of data array does not conform to slice') * if negstride: */ } /* "netCDF4/_netCDF4.pyx":4174 * if totelem != dataelem: * raise IndexError('size of data array does not conform to slice') * if negstride: # <<<<<<<<<<<<<< * # reverse data along axes with negative strides. * data = data[sl].copy() # make sure a copy is made. */ __pyx_t_3 = (__pyx_v_negstride != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4176 * if negstride: * # reverse data along axes with negative strides. * data = data[sl].copy() # make sure a copy is made. # <<<<<<<<<<<<<< * if self._isprimitive or self._iscompound or self._isenum: * # primitive, enum or compound data type. */ __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_v_sl); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (__pyx_t_10) { __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":4174 * if totelem != dataelem: * raise IndexError('size of data array does not conform to slice') * if negstride: # <<<<<<<<<<<<<< * # reverse data along axes with negative strides. * data = data[sl].copy() # make sure a copy is made. */ } /* "netCDF4/_netCDF4.pyx":4177 * # reverse data along axes with negative strides. * data = data[sl].copy() # make sure a copy is made. * if self._isprimitive or self._iscompound or self._isenum: # <<<<<<<<<<<<<< * # primitive, enum or compound data type. * # if data type of array doesn't match variable, */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L10_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_iscompound); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L10_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_12; __pyx_L10_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4181 * # if data type of array doesn't match variable, * # try to cast the data. * if self.dtype != data.dtype: # <<<<<<<<<<<<<< * data = data.astype(self.dtype) # cast data, if necessary. * # make sure byte-order of data matches byte-order of netcdf */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->dtype, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4182 * # try to cast the data. * if self.dtype != data.dtype: * data = data.astype(self.dtype) # cast data, if necessary. # <<<<<<<<<<<<<< * # make sure byte-order of data matches byte-order of netcdf * # variable. */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_astype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_10) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_self->dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_self->dtype); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4181 * # if data type of array doesn't match variable, * # try to cast the data. * if self.dtype != data.dtype: # <<<<<<<<<<<<<< * data = data.astype(self.dtype) # cast data, if necessary. * # make sure byte-order of data matches byte-order of netcdf */ } /* "netCDF4/_netCDF4.pyx":4185 * # make sure byte-order of data matches byte-order of netcdf * # variable. * if self.endian() == 'native': # <<<<<<<<<<<<<< * if is_native_little and data.dtype.byteorder == '>': * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_native, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4186 * # variable. * if self.endian() == 'native': * if is_native_little and data.dtype.byteorder == '>': # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '<': */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L16_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__15, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_12; __pyx_L16_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4187 * if self.endian() == 'native': * if is_native_little and data.dtype.byteorder == '>': * data.byteswap(True) # <<<<<<<<<<<<<< * if is_native_big and data.dtype.byteorder == '<': * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4186 * # variable. * if self.endian() == 'native': * if is_native_little and data.dtype.byteorder == '>': # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '<': */ } /* "netCDF4/_netCDF4.pyx":4188 * if is_native_little and data.dtype.byteorder == '>': * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '<': # <<<<<<<<<<<<<< * data.byteswap(True) * if self.endian() == 'big': */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L19_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__14, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_12; __pyx_L19_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4189 * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '<': * data.byteswap(True) # <<<<<<<<<<<<<< * if self.endian() == 'big': * if is_native_big and data.dtype.byteorder not in ['=','|']: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4188 * if is_native_little and data.dtype.byteorder == '>': * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '<': # <<<<<<<<<<<<<< * data.byteswap(True) * if self.endian() == 'big': */ } /* "netCDF4/_netCDF4.pyx":4185 * # make sure byte-order of data matches byte-order of netcdf * # variable. * if self.endian() == 'native': # <<<<<<<<<<<<<< * if is_native_little and data.dtype.byteorder == '>': * data.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":4190 * if is_native_big and data.dtype.byteorder == '<': * data.byteswap(True) * if self.endian() == 'big': # <<<<<<<<<<<<<< * if is_native_big and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_big, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4191 * data.byteswap(True) * if self.endian() == 'big': * if is_native_big and data.dtype.byteorder not in ['=','|']: # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_little and data.dtype.byteorder == '=': */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L23_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__36, Py_NE)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L25_bool_binop_done; } __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__37, Py_NE)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = __pyx_t_13; __pyx_L25_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = (__pyx_t_12 != 0); __pyx_t_3 = __pyx_t_13; __pyx_L23_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4192 * if self.endian() == 'big': * if is_native_big and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) # <<<<<<<<<<<<<< * if is_native_little and data.dtype.byteorder == '=': * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4191 * data.byteswap(True) * if self.endian() == 'big': * if is_native_big and data.dtype.byteorder not in ['=','|']: # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_little and data.dtype.byteorder == '=': */ } /* "netCDF4/_netCDF4.pyx":4193 * if is_native_big and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) * if is_native_little and data.dtype.byteorder == '=': # <<<<<<<<<<<<<< * data.byteswap(True) * if self.endian() == 'little': */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_13) { } else { __pyx_t_3 = __pyx_t_13; goto __pyx_L28_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__36, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_13; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4194 * data.byteswap(True) * if is_native_little and data.dtype.byteorder == '=': * data.byteswap(True) # <<<<<<<<<<<<<< * if self.endian() == 'little': * if is_native_little and data.dtype.byteorder not in ['=','|']: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4193 * if is_native_big and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) * if is_native_little and data.dtype.byteorder == '=': # <<<<<<<<<<<<<< * data.byteswap(True) * if self.endian() == 'little': */ } /* "netCDF4/_netCDF4.pyx":4190 * if is_native_big and data.dtype.byteorder == '<': * data.byteswap(True) * if self.endian() == 'big': # <<<<<<<<<<<<<< * if is_native_big and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":4195 * if is_native_little and data.dtype.byteorder == '=': * data.byteswap(True) * if self.endian() == 'little': # <<<<<<<<<<<<<< * if is_native_little and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_endian); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_little, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4196 * data.byteswap(True) * if self.endian() == 'little': * if is_native_little and data.dtype.byteorder not in ['=','|']: # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '=': */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_little); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_13) { } else { __pyx_t_3 = __pyx_t_13; goto __pyx_L32_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__36, Py_NE)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_12) { } else { __pyx_t_13 = __pyx_t_12; goto __pyx_L34_bool_binop_done; } __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__37, Py_NE)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __pyx_t_12; __pyx_L34_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_12 = (__pyx_t_13 != 0); __pyx_t_3 = __pyx_t_12; __pyx_L32_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4197 * if self.endian() == 'little': * if is_native_little and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) # <<<<<<<<<<<<<< * if is_native_big and data.dtype.byteorder == '=': * data.byteswap(True) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4196 * data.byteswap(True) * if self.endian() == 'little': * if is_native_little and data.dtype.byteorder not in ['=','|']: # <<<<<<<<<<<<<< * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '=': */ } /* "netCDF4/_netCDF4.pyx":4198 * if is_native_little and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '=': # <<<<<<<<<<<<<< * data.byteswap(True) * # strides all 1 or scalar variable, use put_vara (faster) */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_native_big); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L37_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__36, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __pyx_t_12; __pyx_L37_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4199 * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '=': * data.byteswap(True) # <<<<<<<<<<<<<< * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_byteswap); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4198 * if is_native_little and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) * if is_native_big and data.dtype.byteorder == '=': # <<<<<<<<<<<<<< * data.byteswap(True) * # strides all 1 or scalar variable, use put_vara (faster) */ } /* "netCDF4/_netCDF4.pyx":4195 * if is_native_little and data.dtype.byteorder == '=': * data.byteswap(True) * if self.endian() == 'little': # <<<<<<<<<<<<<< * if is_native_little and data.dtype.byteorder not in ['=','|']: * data.byteswap(True) */ } /* "netCDF4/_netCDF4.pyx":4201 * data.byteswap(True) * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, data.data) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stride); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L40_bool_binop_done; } __pyx_t_12 = ((__pyx_v_ndims == 0) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L40_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4202 * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: * ierr = nc_put_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, data.data) * else: */ __pyx_v_ierr = nc_put_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_data->data); /* "netCDF4/_netCDF4.pyx":4201 * data.byteswap(True) * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, data.data) */ goto __pyx_L39; } /* "netCDF4/_netCDF4.pyx":4205 * startp, countp, data.data) * else: * ierr = nc_put_vars(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, stridep, data.data) * if ierr != NC_NOERR: */ /*else*/ { /* "netCDF4/_netCDF4.pyx":4206 * else: * ierr = nc_put_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_put_vars(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_stridep, __pyx_v_data->data); } __pyx_L39:; /* "netCDF4/_netCDF4.pyx":4207 * ierr = nc_put_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4208 * startp, countp, stridep, data.data) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * elif self._isvlen: * if data.dtype.char !='O': */ __pyx_t_14 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_14, 0, strlen(__pyx_t_14), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4207 * ierr = nc_put_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: */ } /* "netCDF4/_netCDF4.pyx":4177 * # reverse data along axes with negative strides. * data = data[sl].copy() # make sure a copy is made. * if self._isprimitive or self._iscompound or self._isenum: # <<<<<<<<<<<<<< * # primitive, enum or compound data type. * # if data type of array doesn't match variable, */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":4209 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: # <<<<<<<<<<<<<< * if data.dtype.char !='O': * raise TypeError('data to put in string variable must be an object array containing Python strings') */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4210 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: * if data.dtype.char !='O': # <<<<<<<<<<<<<< * raise TypeError('data to put in string variable must be an object array containing Python strings') * # flatten data array. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_char); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_O, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4211 * elif self._isvlen: * if data.dtype.char !='O': * raise TypeError('data to put in string variable must be an object array containing Python strings') # <<<<<<<<<<<<<< * # flatten data array. * data = data.flatten() */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4210 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: * if data.dtype.char !='O': # <<<<<<<<<<<<<< * raise TypeError('data to put in string variable must be an object array containing Python strings') * # flatten data array. */ } /* "netCDF4/_netCDF4.pyx":4213 * raise TypeError('data to put in string variable must be an object array containing Python strings') * # flatten data array. * data = data.flatten() # <<<<<<<<<<<<<< * if self.dtype == str: * # convert all elements from strings to bytes */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_flatten); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_5) { __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4214 * # flatten data array. * data = data.flatten() * if self.dtype == str: # <<<<<<<<<<<<<< * # convert all elements from strings to bytes * for n in range(data.shape[0]): */ __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4216 * if self.dtype == str: * # convert all elements from strings to bytes * for n in range(data.shape[0]): # <<<<<<<<<<<<<< * data[n] = _strencode(data[n]) * # vlen string (NC_STRING) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_15 = NULL; } else { __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_15(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4217 * # convert all elements from strings to bytes * for n in range(data.shape[0]): * data[n] = _strencode(data[n]) # <<<<<<<<<<<<<< * # vlen string (NC_STRING) * # loop over elements of object array, put data buffer for */ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_v_n); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_data), __pyx_v_n, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":4216 * if self.dtype == str: * # convert all elements from strings to bytes * for n in range(data.shape[0]): # <<<<<<<<<<<<<< * data[n] = _strencode(data[n]) * # vlen string (NC_STRING) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4222 * # each element in struct. * # allocate struct array to hold vlen data. * strdata = malloc(sizeof(char *)*totelem) # <<<<<<<<<<<<<< * for i from 0<=imalloc(sizeof(char *)*totelem) * for i from 0<=imalloc(sizeof(char *)*totelem) * for i from 0<=i_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_strdata); /* "netCDF4/_netCDF4.pyx":4226 * strdata[i] = data[i] * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, strdata) */ goto __pyx_L49; } /* "netCDF4/_netCDF4.pyx":4230 * startp, countp, strdata) * else: * raise IndexError('strides must all be 1 for string variables') # <<<<<<<<<<<<<< * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L49:; /* "netCDF4/_netCDF4.pyx":4233 * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4234 * # startp, countp, stridep, strdata) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * free(strdata) * else: */ __pyx_t_14 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_14, 0, strlen(__pyx_t_14), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4233 * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) */ } /* "netCDF4/_netCDF4.pyx":4235 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(strdata) # <<<<<<<<<<<<<< * else: * # regular vlen. */ free(__pyx_v_strdata); /* "netCDF4/_netCDF4.pyx":4214 * # flatten data array. * data = data.flatten() * if self.dtype == str: # <<<<<<<<<<<<<< * # convert all elements from strings to bytes * for n in range(data.shape[0]): */ goto __pyx_L44; } /* "netCDF4/_netCDF4.pyx":4240 * # loop over elements of object array, put data buffer for * # each element in struct. * databuff = data.data # <<<<<<<<<<<<<< * # allocate struct array to hold vlen data. * vldata = malloc(totelem*sizeof(nc_vlen_t)) */ /*else*/ { __pyx_t_14 = __pyx_v_data->data; __pyx_v_databuff = __pyx_t_14; /* "netCDF4/_netCDF4.pyx":4242 * databuff = data.data * # allocate struct array to hold vlen data. * vldata = malloc(totelem*sizeof(nc_vlen_t)) # <<<<<<<<<<<<<< * for i from 0<=idatabuff)[0] */ __pyx_v_vldata = ((nc_vlen_t *)malloc((((size_t)__pyx_v_totelem) * (sizeof(nc_vlen_t))))); /* "netCDF4/_netCDF4.pyx":4243 * # allocate struct array to hold vlen data. * vldata = malloc(totelem*sizeof(nc_vlen_t)) * for i from 0<=idatabuff)[0] * dataarr = elptr */ __pyx_t_16 = __pyx_v_totelem; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_16; __pyx_v_i++) { /* "netCDF4/_netCDF4.pyx":4244 * vldata = malloc(totelem*sizeof(nc_vlen_t)) * for i from 0<=idatabuff)[0] # <<<<<<<<<<<<<< * dataarr = elptr * if self.dtype != dataarr.dtype.str[1:]: */ __pyx_v_elptr = (((void **)__pyx_v_databuff)[0]); /* "netCDF4/_netCDF4.pyx":4245 * for i from 0<=idatabuff)[0] * dataarr = elptr # <<<<<<<<<<<<<< * if self.dtype != dataarr.dtype.str[1:]: * #dataarr = dataarr.astype(self.dtype) # cast data, if necessary. */ __pyx_t_1 = ((PyObject *)__pyx_v_elptr); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dataarr, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4246 * elptr = (databuff)[0] * dataarr = elptr * if self.dtype != dataarr.dtype.str[1:]: # <<<<<<<<<<<<<< * #dataarr = dataarr.astype(self.dtype) # cast data, if necessary. * # casting doesn't work ?? just raise TypeError */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dataarr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__81, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->dtype, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4249 * #dataarr = dataarr.astype(self.dtype) # cast data, if necessary. * # casting doesn't work ?? just raise TypeError * raise TypeError("wrong data type in object array: should be %s, got %s" % (self.dtype,dataarr.dtype)) # <<<<<<<<<<<<<< * vldata[i].len = PyArray_SIZE(dataarr) * vldata[i].p = dataarr.data */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dataarr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_wrong_data_type_in_object_array, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4246 * elptr = (databuff)[0] * dataarr = elptr * if self.dtype != dataarr.dtype.str[1:]: # <<<<<<<<<<<<<< * #dataarr = dataarr.astype(self.dtype) # cast data, if necessary. * # casting doesn't work ?? just raise TypeError */ } /* "netCDF4/_netCDF4.pyx":4250 * # casting doesn't work ?? just raise TypeError * raise TypeError("wrong data type in object array: should be %s, got %s" % (self.dtype,dataarr.dtype)) * vldata[i].len = PyArray_SIZE(dataarr) # <<<<<<<<<<<<<< * vldata[i].p = dataarr.data * databuff = databuff + data.strides[0] */ (__pyx_v_vldata[__pyx_v_i]).len = PyArray_SIZE(__pyx_v_dataarr); /* "netCDF4/_netCDF4.pyx":4251 * raise TypeError("wrong data type in object array: should be %s, got %s" % (self.dtype,dataarr.dtype)) * vldata[i].len = PyArray_SIZE(dataarr) * vldata[i].p = dataarr.data # <<<<<<<<<<<<<< * databuff = databuff + data.strides[0] * # strides all 1 or scalar variable, use put_vara (faster) */ __pyx_t_14 = __pyx_v_dataarr->data; (__pyx_v_vldata[__pyx_v_i]).p = __pyx_t_14; /* "netCDF4/_netCDF4.pyx":4252 * vldata[i].len = PyArray_SIZE(dataarr) * vldata[i].p = dataarr.data * databuff = databuff + data.strides[0] # <<<<<<<<<<<<<< * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: */ __pyx_v_databuff = (__pyx_v_databuff + (__pyx_v_data->strides[0])); } /* "netCDF4/_netCDF4.pyx":4254 * databuff = databuff + data.strides[0] * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, vldata) */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stride); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_12) { } else { __pyx_t_3 = __pyx_t_12; goto __pyx_L57_bool_binop_done; } __pyx_t_12 = ((__pyx_v_ndims == 0) != 0); __pyx_t_3 = __pyx_t_12; __pyx_L57_bool_binop_done:; if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4255 * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: * ierr = nc_put_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, vldata) * else: */ __pyx_v_ierr = nc_put_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_vldata); /* "netCDF4/_netCDF4.pyx":4254 * databuff = databuff + data.strides[0] * # strides all 1 or scalar variable, use put_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * ierr = nc_put_vara(self._grpid, self._varid, * startp, countp, vldata) */ goto __pyx_L56; } /* "netCDF4/_netCDF4.pyx":4258 * startp, countp, vldata) * else: * raise IndexError('strides must all be 1 for vlen variables') # <<<<<<<<<<<<<< * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L56:; /* "netCDF4/_netCDF4.pyx":4261 * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # free the pointer array. */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4262 * # startp, countp, stridep, vldata) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # free the pointer array. * free(vldata) */ __pyx_t_14 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_14, 0, strlen(__pyx_t_14), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4261 * #ierr = nc_put_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # free the pointer array. */ } /* "netCDF4/_netCDF4.pyx":4264 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # free the pointer array. * free(vldata) # <<<<<<<<<<<<<< * free(startp) * free(countp) */ free(__pyx_v_vldata); } __pyx_L44:; /* "netCDF4/_netCDF4.pyx":4209 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: # <<<<<<<<<<<<<< * if data.dtype.char !='O': * raise TypeError('data to put in string variable must be an object array containing Python strings') */ } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":4265 * # free the pointer array. * free(vldata) * free(startp) # <<<<<<<<<<<<<< * free(countp) * free(stridep) */ free(__pyx_v_startp); /* "netCDF4/_netCDF4.pyx":4266 * free(vldata) * free(startp) * free(countp) # <<<<<<<<<<<<<< * free(stridep) * */ free(__pyx_v_countp); /* "netCDF4/_netCDF4.pyx":4267 * free(startp) * free(countp) * free(stridep) # <<<<<<<<<<<<<< * * def _get(self,start,count,stride): */ free(__pyx_v_stridep); /* "netCDF4/_netCDF4.pyx":4129 * * * def _put(self,ndarray data,start,count,stride): # <<<<<<<<<<<<<< * """Private method to put data into a netCDF variable""" * cdef int ierr, ndims */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._put", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dataarr); __Pyx_XDECREF(__pyx_v_sl); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF((PyObject *)__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4269 * free(stridep) * * def _get(self,start,count,stride): # <<<<<<<<<<<<<< * """Private method to retrieve data from a netCDF variable""" * cdef int ierr, ndims */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_65_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8Variable_64_get[] = "Private method to retrieve data from a netCDF variable"; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_65_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_start = 0; PyObject *__pyx_v_count = 0; PyObject *__pyx_v_stride = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_get (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_count,&__pyx_n_s_stride,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_count)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_get", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stride)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_get", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_start = values[0]; __pyx_v_count = values[1]; __pyx_v_stride = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_get", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_64_get(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), __pyx_v_start, __pyx_v_count, __pyx_v_stride); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_64_get(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_count, PyObject *__pyx_v_stride) { int __pyx_v_ierr; int __pyx_v_ndims; size_t *__pyx_v_startp; size_t *__pyx_v_countp; ptrdiff_t *__pyx_v_stridep; PyArrayObject *__pyx_v_data = 0; PyArrayObject *__pyx_v_dataarr = 0; char **__pyx_v_strdata; nc_vlen_t *__pyx_v_vldata; PyObject *__pyx_v_shapeout = NULL; int __pyx_v_squeeze_out; PyObject *__pyx_v_lendim = NULL; long __pyx_v_negstride; PyObject *__pyx_v_sl = NULL; long __pyx_v_n; PyObject *__pyx_v_totelem = NULL; long __pyx_v_i; size_t __pyx_v_arrlen; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; size_t __pyx_t_8; ptrdiff_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_t_12; char *__pyx_t_13; long __pyx_t_14; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get", 0); /* "netCDF4/_netCDF4.pyx":4282 * # and not a slice so the resulting array * # should be 'squeezed' to remove the singleton dimension. * shapeout = () # <<<<<<<<<<<<<< * squeeze_out = False * for lendim in count: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_shapeout = __pyx_empty_tuple; /* "netCDF4/_netCDF4.pyx":4283 * # should be 'squeezed' to remove the singleton dimension. * shapeout = () * squeeze_out = False # <<<<<<<<<<<<<< * for lendim in count: * if lendim == -1: */ __pyx_v_squeeze_out = 0; /* "netCDF4/_netCDF4.pyx":4284 * shapeout = () * squeeze_out = False * for lendim in count: # <<<<<<<<<<<<<< * if lendim == -1: * shapeout = shapeout + (1,) */ if (likely(PyList_CheckExact(__pyx_v_count)) || PyTuple_CheckExact(__pyx_v_count)) { __pyx_t_1 = __pyx_v_count; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_lendim, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4285 * squeeze_out = False * for lendim in count: * if lendim == -1: # <<<<<<<<<<<<<< * shapeout = shapeout + (1,) * squeeze_out = True */ __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_lendim, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4286 * for lendim in count: * if lendim == -1: * shapeout = shapeout + (1,) # <<<<<<<<<<<<<< * squeeze_out = True * else: */ __pyx_t_4 = PyNumber_Add(__pyx_v_shapeout, __pyx_tuple__83); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_shapeout, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4287 * if lendim == -1: * shapeout = shapeout + (1,) * squeeze_out = True # <<<<<<<<<<<<<< * else: * shapeout = shapeout + (lendim,) */ __pyx_v_squeeze_out = 1; /* "netCDF4/_netCDF4.pyx":4285 * squeeze_out = False * for lendim in count: * if lendim == -1: # <<<<<<<<<<<<<< * shapeout = shapeout + (1,) * squeeze_out = True */ goto __pyx_L5; } /* "netCDF4/_netCDF4.pyx":4289 * squeeze_out = True * else: * shapeout = shapeout + (lendim,) # <<<<<<<<<<<<<< * # rank of variable. * ndims = len(self.dimensions) */ /*else*/ { __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_lendim); __Pyx_GIVEREF(__pyx_v_lendim); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lendim); __pyx_t_6 = PyNumber_Add(__pyx_v_shapeout, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_shapeout, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; /* "netCDF4/_netCDF4.pyx":4284 * shapeout = () * squeeze_out = False * for lendim in count: # <<<<<<<<<<<<<< * if lendim == -1: * shapeout = shapeout + (1,) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4291 * shapeout = shapeout + (lendim,) * # rank of variable. * ndims = len(self.dimensions) # <<<<<<<<<<<<<< * # fill up startp,countp,stridep. * negstride = 0 */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ndims = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4293 * ndims = len(self.dimensions) * # fill up startp,countp,stridep. * negstride = 0 # <<<<<<<<<<<<<< * sl = [] * startp = malloc(sizeof(size_t) * ndims) */ __pyx_v_negstride = 0; /* "netCDF4/_netCDF4.pyx":4294 * # fill up startp,countp,stridep. * negstride = 0 * sl = [] # <<<<<<<<<<<<<< * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_sl = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4295 * negstride = 0 * sl = [] * startp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) */ __pyx_v_startp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4296 * sl = [] * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) # <<<<<<<<<<<<<< * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: */ __pyx_v_countp = ((size_t *)malloc(((sizeof(size_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4297 * startp = malloc(sizeof(size_t) * ndims) * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 */ __pyx_v_stridep = ((ptrdiff_t *)malloc(((sizeof(ptrdiff_t)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4298 * countp = malloc(sizeof(size_t) * ndims) * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * count[n] = abs(count[n]) # make -1 into +1 * countp[n] = count[n] */ __pyx_t_7 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_7; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":4299 * stridep = malloc(sizeof(ptrdiff_t) * ndims) * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 # <<<<<<<<<<<<<< * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_count, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_count, __pyx_v_n, __pyx_t_6, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4300 * for n from 0 <= n < ndims: * count[n] = abs(count[n]) # make -1 into +1 * countp[n] = count[n] # <<<<<<<<<<<<<< * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_count, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_countp[__pyx_v_n]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4302 * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: # <<<<<<<<<<<<<< * negstride = 1 * stridep[n] = -stride[n] */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_stride, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4303 * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: * negstride = 1 # <<<<<<<<<<<<<< * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) */ __pyx_v_negstride = 1; /* "netCDF4/_netCDF4.pyx":4304 * if stride[n] < 0: * negstride = 1 * stridep[n] = -stride[n] # <<<<<<<<<<<<<< * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_stride, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __Pyx_PyInt_As_ptrdiff_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (ptrdiff_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_stridep[__pyx_v_n]) = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4305 * negstride = 1 * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) # <<<<<<<<<<<<<< * stride[n] = -stride[n] * sl.append(slice(None, None, -1)) # this slice will reverse the data */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_start, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_stride, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_count, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_10); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; (__pyx_v_startp[__pyx_v_n]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4306 * stridep[n] = -stride[n] * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] # <<<<<<<<<<<<<< * sl.append(slice(None, None, -1)) # this slice will reverse the data * else: */ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_stride, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_stride, __pyx_v_n, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4307 * startp[n] = start[n]+stride[n]*(count[n]-1) * stride[n] = -stride[n] * sl.append(slice(None, None, -1)) # this slice will reverse the data # <<<<<<<<<<<<<< * else: * startp[n] = start[n] */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sl, __pyx_slice__84); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4302 * countp[n] = count[n] * # for neg strides, reverse order (then flip that axis after data read in) * if stride[n] < 0: # <<<<<<<<<<<<<< * negstride = 1 * stridep[n] = -stride[n] */ goto __pyx_L8; } /* "netCDF4/_netCDF4.pyx":4309 * sl.append(slice(None, None, -1)) # this slice will reverse the data * else: * startp[n] = start[n] # <<<<<<<<<<<<<< * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) */ /*else*/ { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_start, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_4); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_startp[__pyx_v_n]) = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4310 * else: * startp[n] = start[n] * stridep[n] = stride[n] # <<<<<<<<<<<<<< * sl.append(slice(None,None, 1)) * if self._isprimitive or self._iscompound or self._isenum: */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_stride, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_ptrdiff_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (ptrdiff_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_stridep[__pyx_v_n]) = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4311 * startp[n] = start[n] * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) # <<<<<<<<<<<<<< * if self._isprimitive or self._iscompound or self._isenum: * data = numpy.empty(shapeout, self.dtype) */ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sl, __pyx_slice__85); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L8:; } /* "netCDF4/_netCDF4.pyx":4312 * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) * if self._isprimitive or self._iscompound or self._isenum: # <<<<<<<<<<<<<< * data = numpy.empty(shapeout, self.dtype) * # strides all 1 or scalar variable, use get_vara (faster) */ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isprimitive); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_12) { } else { __pyx_t_5 = __pyx_t_12; goto __pyx_L10_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_iscompound); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_12) { } else { __pyx_t_5 = __pyx_t_12; goto __pyx_L10_bool_binop_done; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isenum); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __pyx_t_12; __pyx_L10_bool_binop_done:; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4313 * sl.append(slice(None,None, 1)) * if self._isprimitive or self._iscompound or self._isenum: * data = numpy.empty(shapeout, self.dtype) # <<<<<<<<<<<<<< * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_shapeout); __Pyx_GIVEREF(__pyx_v_shapeout); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_2, __pyx_v_shapeout); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_2, __pyx_v_self->dtype); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_data = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4315 * data = numpy.empty(shapeout, self.dtype) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_stride); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_12) { } else { __pyx_t_5 = __pyx_t_12; goto __pyx_L14_bool_binop_done; } __pyx_t_12 = ((__pyx_v_ndims == 0) != 0); __pyx_t_5 = __pyx_t_12; __pyx_L14_bool_binop_done:; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4316 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, data.data) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4317 * if sum(stride) == ndims or ndims == 0: * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, data.data) * else: */ __pyx_v_ierr = nc_get_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_data->data); } /* "netCDF4/_netCDF4.pyx":4316 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, data.data) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L18; } __pyx_L18:; } } /* "netCDF4/_netCDF4.pyx":4315 * data = numpy.empty(shapeout, self.dtype) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ goto __pyx_L13; } /* "netCDF4/_netCDF4.pyx":4320 * startp, countp, data.data) * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4321 * else: * with nogil: * ierr = nc_get_vars(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, stridep, data.data) * if ierr == NC_EINVALCOORDS: */ __pyx_v_ierr = nc_get_vars(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_stridep, __pyx_v_data->data); } /* "netCDF4/_netCDF4.pyx":4320 * startp, countp, data.data) * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } } __pyx_L13:; /* "netCDF4/_netCDF4.pyx":4323 * ierr = nc_get_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ __pyx_t_5 = ((__pyx_v_ierr == NC_EINVALCOORDS) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4324 * startp, countp, stridep, data.data) * if ierr == NC_EINVALCOORDS: * raise IndexError # <<<<<<<<<<<<<< * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4323 * ierr = nc_get_vars(self._grpid, self._varid, * startp, countp, stridep, data.data) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":4325 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4326 * raise IndexError * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * elif self._isvlen: * # allocate array of correct primitive type. */ __pyx_t_13 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4325 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: */ } /* "netCDF4/_netCDF4.pyx":4312 * stridep[n] = stride[n] * sl.append(slice(None,None, 1)) * if self._isprimitive or self._iscompound or self._isenum: # <<<<<<<<<<<<<< * data = numpy.empty(shapeout, self.dtype) * # strides all 1 or scalar variable, use get_vara (faster) */ goto __pyx_L9; } /* "netCDF4/_netCDF4.pyx":4327 * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: # <<<<<<<<<<<<<< * # allocate array of correct primitive type. * data = numpy.empty(shapeout, 'O') */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_isvlen); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4329 * elif self._isvlen: * # allocate array of correct primitive type. * data = numpy.empty(shapeout, 'O') # <<<<<<<<<<<<<< * # flatten data array. * data = data.flatten() */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_2 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_shapeout); __Pyx_GIVEREF(__pyx_v_shapeout); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_2, __pyx_v_shapeout); __Pyx_INCREF(__pyx_n_s_O); __Pyx_GIVEREF(__pyx_n_s_O); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_2, __pyx_n_s_O); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4331 * data = numpy.empty(shapeout, 'O') * # flatten data array. * data = data.flatten() # <<<<<<<<<<<<<< * totelem = PyArray_SIZE(data) * if self.dtype == str: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_flatten); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4332 * # flatten data array. * data = data.flatten() * totelem = PyArray_SIZE(data) # <<<<<<<<<<<<<< * if self.dtype == str: * # vlen string (NC_STRING) */ __pyx_t_1 = __Pyx_PyInt_From_npy_intp(PyArray_SIZE(__pyx_v_data)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_totelem = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4333 * data = data.flatten() * totelem = PyArray_SIZE(data) * if self.dtype == str: # <<<<<<<<<<<<<< * # vlen string (NC_STRING) * # allocate pointer array to hold string data. */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4336 * # vlen string (NC_STRING) * # allocate pointer array to hold string data. * strdata = malloc(sizeof(char *) * totelem) # <<<<<<<<<<<<<< * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: */ __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(char *))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_v_totelem); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_strdata = ((char **)malloc(__pyx_t_8)); /* "netCDF4/_netCDF4.pyx":4338 * strdata = malloc(sizeof(char *) * totelem) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_stride); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (!__pyx_t_12) { } else { __pyx_t_5 = __pyx_t_12; goto __pyx_L25_bool_binop_done; } __pyx_t_12 = ((__pyx_v_ndims == 0) != 0); __pyx_t_5 = __pyx_t_12; __pyx_L25_bool_binop_done:; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4339 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, strdata) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4340 * if sum(stride) == ndims or ndims == 0: * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, strdata) * else: */ __pyx_v_ierr = nc_get_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_strdata); } /* "netCDF4/_netCDF4.pyx":4339 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, strdata) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L29; } __pyx_L29:; } } /* "netCDF4/_netCDF4.pyx":4338 * strdata = malloc(sizeof(char *) * totelem) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ goto __pyx_L24; } /* "netCDF4/_netCDF4.pyx":4344 * else: * # FIXME: is this a bug in netCDF4? * raise IndexError('strides must all be 1 for string variables') # <<<<<<<<<<<<<< * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) */ /*else*/ { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L24:; /* "netCDF4/_netCDF4.pyx":4347 * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ __pyx_t_5 = ((__pyx_v_ierr == NC_EINVALCOORDS) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4348 * # startp, countp, stridep, strdata) * if ierr == NC_EINVALCOORDS: * raise IndexError # <<<<<<<<<<<<<< * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4347 * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, strdata) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":4349 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over elements of object array, fill array with */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4350 * raise IndexError * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # loop over elements of object array, fill array with * # contents of strdata. */ __pyx_t_13 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_10 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4349 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over elements of object array, fill array with */ } /* "netCDF4/_netCDF4.pyx":4353 * # loop over elements of object array, fill array with * # contents of strdata. * for i from 0<=imalloc(totelem*sizeof(nc_vlen_t)) # <<<<<<<<<<<<<< * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: */ /*else*/ { __pyx_t_10 = __Pyx_PyInt_FromSize_t((sizeof(nc_vlen_t))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = PyNumber_Multiply(__pyx_v_totelem, __pyx_t_10); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_15); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_v_vldata = ((nc_vlen_t *)malloc(__pyx_t_8)); /* "netCDF4/_netCDF4.pyx":4366 * vldata = malloc(totelem*sizeof(nc_vlen_t)) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_stride); __Pyx_GIVEREF(__pyx_v_stride); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_stride); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ndims); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_6 = PyObject_RichCompare(__pyx_t_10, __pyx_t_15, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_12) { } else { __pyx_t_5 = __pyx_t_12; goto __pyx_L34_bool_binop_done; } __pyx_t_12 = ((__pyx_v_ndims == 0) != 0); __pyx_t_5 = __pyx_t_12; __pyx_L34_bool_binop_done:; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4367 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, vldata) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4368 * if sum(stride) == ndims or ndims == 0: * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, # <<<<<<<<<<<<<< * startp, countp, vldata) * else: */ __pyx_v_ierr = nc_get_vara(__pyx_v_self->_grpid, __pyx_v_self->_varid, __pyx_v_startp, __pyx_v_countp, __pyx_v_vldata); } /* "netCDF4/_netCDF4.pyx":4367 * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_get_vara(self._grpid, self._varid, * startp, countp, vldata) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L38; } __pyx_L38:; } } /* "netCDF4/_netCDF4.pyx":4366 * vldata = malloc(totelem*sizeof(nc_vlen_t)) * # strides all 1 or scalar variable, use get_vara (faster) * if sum(stride) == ndims or ndims == 0: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_get_vara(self._grpid, self._varid, */ goto __pyx_L33; } /* "netCDF4/_netCDF4.pyx":4371 * startp, countp, vldata) * else: * raise IndexError('strides must all be 1 for vlen variables') # <<<<<<<<<<<<<< * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L33:; /* "netCDF4/_netCDF4.pyx":4374 * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ __pyx_t_5 = ((__pyx_v_ierr == NC_EINVALCOORDS) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4375 * # startp, countp, stridep, vldata) * if ierr == NC_EINVALCOORDS: * raise IndexError # <<<<<<<<<<<<<< * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4374 * #ierr = nc_get_vars(self._grpid, self._varid, * # startp, countp, stridep, vldata) * if ierr == NC_EINVALCOORDS: # <<<<<<<<<<<<<< * raise IndexError * elif ierr != NC_NOERR: */ } /* "netCDF4/_netCDF4.pyx":4376 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over elements of object array, fill array with */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4377 * raise IndexError * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * # loop over elements of object array, fill array with * # contents of vlarray struct, put array in object array. */ __pyx_t_13 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_13, 0, strlen(__pyx_t_13), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4376 * if ierr == NC_EINVALCOORDS: * raise IndexError * elif ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * # loop over elements of object array, fill array with */ } /* "netCDF4/_netCDF4.pyx":4380 * # loop over elements of object array, fill array with * # contents of vlarray struct, put array in object array. * for i from 0<=ivldata[i].p */ __pyx_t_8 = (__pyx_v_vldata[__pyx_v_i]).len; __pyx_v_arrlen = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4382 * for i from 0<=ivldata[i].p * memcpy(dataarr.data, vldata[i].p, dataarr.nbytes) */ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_15 = __Pyx_PyInt_FromSize_t(__pyx_v_arrlen); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_1 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_2 = 1; } } __pyx_t_4 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_15); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_v_self->dtype); __pyx_t_15 = 0; __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_dataarr, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4384 * dataarr = numpy.empty(arrlen, self.dtype) * #dataarr.data = vldata[i].p * memcpy(dataarr.data, vldata[i].p, dataarr.nbytes) # <<<<<<<<<<<<<< * data[i] = dataarr * # reshape the output array */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dataarr), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; memcpy(((void *)__pyx_v_dataarr->data), (__pyx_v_vldata[__pyx_v_i]).p, __pyx_t_8); /* "netCDF4/_netCDF4.pyx":4385 * #dataarr.data = vldata[i].p * memcpy(dataarr.data, vldata[i].p, dataarr.nbytes) * data[i] = dataarr # <<<<<<<<<<<<<< * # reshape the output array * data = numpy.reshape(data, shapeout) */ if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_data), __pyx_v_i, ((PyObject *)__pyx_v_dataarr), long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "netCDF4/_netCDF4.pyx":4387 * data[i] = dataarr * # reshape the output array * data = numpy.reshape(data, shapeout) # <<<<<<<<<<<<<< * # free vlen data internally allocated in netcdf C lib * ierr = nc_free_vlens(totelem, vldata) */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; __pyx_t_2 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_2 = 1; } } __pyx_t_15 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_data)); __Pyx_GIVEREF(((PyObject *)__pyx_v_data)); PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_2, ((PyObject *)__pyx_v_data)); __Pyx_INCREF(__pyx_v_shapeout); __Pyx_GIVEREF(__pyx_v_shapeout); PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_2, __pyx_v_shapeout); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4389 * data = numpy.reshape(data, shapeout) * # free vlen data internally allocated in netcdf C lib * ierr = nc_free_vlens(totelem, vldata) # <<<<<<<<<<<<<< * # free the pointer array * free(vldata) */ __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_v_totelem); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ierr = nc_free_vlens(__pyx_t_8, __pyx_v_vldata); /* "netCDF4/_netCDF4.pyx":4391 * ierr = nc_free_vlens(totelem, vldata) * # free the pointer array * free(vldata) # <<<<<<<<<<<<<< * free(startp) * free(countp) */ free(__pyx_v_vldata); } __pyx_L23:; /* "netCDF4/_netCDF4.pyx":4327 * elif ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * elif self._isvlen: # <<<<<<<<<<<<<< * # allocate array of correct primitive type. * data = numpy.empty(shapeout, 'O') */ } __pyx_L9:; /* "netCDF4/_netCDF4.pyx":4392 * # free the pointer array * free(vldata) * free(startp) # <<<<<<<<<<<<<< * free(countp) * free(stridep) */ free(__pyx_v_startp); /* "netCDF4/_netCDF4.pyx":4393 * free(vldata) * free(startp) * free(countp) # <<<<<<<<<<<<<< * free(stridep) * if negstride: */ free(__pyx_v_countp); /* "netCDF4/_netCDF4.pyx":4394 * free(startp) * free(countp) * free(stridep) # <<<<<<<<<<<<<< * if negstride: * # reverse data along axes with negative strides. */ free(__pyx_v_stridep); /* "netCDF4/_netCDF4.pyx":4395 * free(countp) * free(stridep) * if negstride: # <<<<<<<<<<<<<< * # reverse data along axes with negative strides. * data = data[sl].copy() # make a copy so data is contiguous. */ __pyx_t_5 = (__pyx_v_negstride != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4397 * if negstride: * # reverse data along axes with negative strides. * data = data[sl].copy() # make a copy so data is contiguous. # <<<<<<<<<<<<<< * if not self.dimensions: * return data[0] # a scalar */ if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_data), __pyx_v_sl); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_15))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_15, function); } } if (__pyx_t_4) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_15); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7netCDF4_8_netCDF4_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4395 * free(countp) * free(stridep) * if negstride: # <<<<<<<<<<<<<< * # reverse data along axes with negative strides. * data = data[sl].copy() # make a copy so data is contiguous. */ } /* "netCDF4/_netCDF4.pyx":4398 * # reverse data along axes with negative strides. * data = data[sl].copy() # make a copy so data is contiguous. * if not self.dimensions: # <<<<<<<<<<<<<< * return data[0] # a scalar * elif squeeze_out: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dimensions); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = ((!__pyx_t_5) != 0); if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":4399 * data = data[sl].copy() # make a copy so data is contiguous. * if not self.dimensions: * return data[0] # a scalar # <<<<<<<<<<<<<< * elif squeeze_out: * return numpy.squeeze(data) */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_data), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4398 * # reverse data along axes with negative strides. * data = data[sl].copy() # make a copy so data is contiguous. * if not self.dimensions: # <<<<<<<<<<<<<< * return data[0] # a scalar * elif squeeze_out: */ } /* "netCDF4/_netCDF4.pyx":4400 * if not self.dimensions: * return data[0] # a scalar * elif squeeze_out: # <<<<<<<<<<<<<< * return numpy.squeeze(data) * else: */ __pyx_t_12 = (__pyx_v_squeeze_out != 0); if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":4401 * return data[0] # a scalar * elif squeeze_out: * return numpy.squeeze(data) # <<<<<<<<<<<<<< * else: * return data */ __Pyx_XDECREF(__pyx_r); __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_15); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_squeeze); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_15 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_15) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_data)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_15); __pyx_t_15 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_data)); __Pyx_GIVEREF(((PyObject *)__pyx_v_data)); PyTuple_SET_ITEM(__pyx_t_10, 0+1, ((PyObject *)__pyx_v_data)); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4400 * if not self.dimensions: * return data[0] # a scalar * elif squeeze_out: # <<<<<<<<<<<<<< * return numpy.squeeze(data) * else: */ } /* "netCDF4/_netCDF4.pyx":4403 * return numpy.squeeze(data) * else: * return data # <<<<<<<<<<<<<< * * # Compound datatype support. */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_v_data)) { __Pyx_RaiseUnboundLocalError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_INCREF(((PyObject *)__pyx_v_data)); __pyx_r = ((PyObject *)__pyx_v_data); goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4269 * free(stridep) * * def _get(self,start,count,stride): # <<<<<<<<<<<<<< * """Private method to retrieve data from a netCDF variable""" * cdef int ierr, ndims */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_data); __Pyx_XDECREF((PyObject *)__pyx_v_dataarr); __Pyx_XDECREF(__pyx_v_shapeout); __Pyx_XDECREF(__pyx_v_lendim); __Pyx_XDECREF(__pyx_v_sl); __Pyx_XDECREF(__pyx_v_totelem); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2817 * **`size`**: The number of stored elements. * """ * cdef public int _varid, _grpid, _nunlimdim # <<<<<<<<<<<<<< * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\ * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype, __orthogonal_indexing__ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_varid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._varid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_varid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_varid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_varid = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._varid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._grpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_6_grpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_6_grpid_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_grpid = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._grpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_nunlimdim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.Variable._nunlimdim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_10_nunlimdim_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_nunlimdim = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.Variable._nunlimdim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2818 * """ * cdef public int _varid, _grpid, _nunlimdim * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\ # <<<<<<<<<<<<<< * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype, __orthogonal_indexing__ * # Docstrings for class variables (used by pdoc). */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_name); __pyx_r = __pyx_v_self->_name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5_name_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5_name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_name); __Pyx_DECREF(__pyx_v_self->_name); __pyx_v_self->_name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->ndim); __pyx_r = __pyx_v_self->ndim; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->ndim); __Pyx_DECREF(__pyx_v_self->ndim); __pyx_v_self->ndim = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4ndim_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4ndim_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->ndim); __Pyx_DECREF(__pyx_v_self->ndim); __pyx_v_self->ndim = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dtype); __pyx_r = __pyx_v_self->dtype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5dtype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->mask); __pyx_r = __pyx_v_self->mask; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4mask_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4mask_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->mask); __Pyx_DECREF(__pyx_v_self->mask); __pyx_v_self->mask = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->scale); __pyx_r = __pyx_v_self->scale; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_5scale_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_5scale_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->scale); __Pyx_DECREF(__pyx_v_self->scale); __pyx_v_self->scale = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_isprimitive); __pyx_r = __pyx_v_self->_isprimitive; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_isprimitive); __Pyx_DECREF(__pyx_v_self->_isprimitive); __pyx_v_self->_isprimitive = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_12_isprimitive_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_12_isprimitive_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_isprimitive); __Pyx_DECREF(__pyx_v_self->_isprimitive); __pyx_v_self->_isprimitive = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_iscompound); __pyx_r = __pyx_v_self->_iscompound; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_iscompound); __Pyx_DECREF(__pyx_v_self->_iscompound); __pyx_v_self->_iscompound = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_11_iscompound_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_11_iscompound_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_iscompound); __Pyx_DECREF(__pyx_v_self->_iscompound); __pyx_v_self->_iscompound = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":2819 * cdef public int _varid, _grpid, _nunlimdim * cdef public _name, ndim, dtype, mask, scale, _isprimitive, _iscompound,\ * _isvlen, _isenum, _grp, _cmptype, _vltype, _enumtype, __orthogonal_indexing__ # <<<<<<<<<<<<<< * # Docstrings for class variables (used by pdoc). * __pdoc__['Variable.dimensions'] = \ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_isvlen); __pyx_r = __pyx_v_self->_isvlen; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_isvlen); __Pyx_DECREF(__pyx_v_self->_isvlen); __pyx_v_self->_isvlen = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isvlen_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isvlen_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_isvlen); __Pyx_DECREF(__pyx_v_self->_isvlen); __pyx_v_self->_isvlen = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_isenum); __pyx_r = __pyx_v_self->_isenum; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_isenum); __Pyx_DECREF(__pyx_v_self->_isenum); __pyx_v_self->_isenum = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_isenum_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_isenum_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_isenum); __Pyx_DECREF(__pyx_v_self->_isenum); __pyx_v_self->_isenum = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_grp); __pyx_r = __pyx_v_self->_grp; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_4_grp_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_4_grp_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_grp); __Pyx_DECREF(__pyx_v_self->_grp); __pyx_v_self->_grp = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_cmptype); __pyx_r = __pyx_v_self->_cmptype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_cmptype); __Pyx_DECREF(__pyx_v_self->_cmptype); __pyx_v_self->_cmptype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_8_cmptype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_8_cmptype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_cmptype); __Pyx_DECREF(__pyx_v_self->_cmptype); __pyx_v_self->_cmptype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_vltype); __pyx_r = __pyx_v_self->_vltype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_vltype); __Pyx_DECREF(__pyx_v_self->_vltype); __pyx_v_self->_vltype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_7_vltype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_7_vltype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_vltype); __Pyx_DECREF(__pyx_v_self->_vltype); __pyx_v_self->_vltype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_enumtype); __pyx_r = __pyx_v_self->_enumtype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->_enumtype); __Pyx_DECREF(__pyx_v_self->_enumtype); __pyx_v_self->_enumtype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_9_enumtype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_9_enumtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_enumtype); __Pyx_DECREF(__pyx_v_self->_enumtype); __pyx_v_self->_enumtype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing_____get__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing_____get__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__orthogonal_indexing__); __pyx_r = __pyx_v_self->__orthogonal_indexing__; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_Variable *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8Variable_23__orthogonal_indexing___4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_Variable *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->__orthogonal_indexing__); __Pyx_DECREF(__pyx_v_self->__orthogonal_indexing__); __pyx_v_self->__orthogonal_indexing__ = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4424 * __pdoc__['CompoundType.dtype'] = \ * """A numpy dtype object describing the compound data type.""" * def __init__(self, grp, object dt, object dtype_name, **kwargs): # <<<<<<<<<<<<<< * """ * ***`__init__(group, datatype, datatype_name)`*** */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_12CompoundType___init__[] = "\n ***`__init__(group, datatype, datatype_name)`***\n\n CompoundType constructor.\n\n **`group`**: `netCDF4.Group` instance to associate with the compound datatype.\n\n **`datatype`**: A numpy dtype object describing a structured (a.k.a record)\n array. Can be composed of homogeneous numeric or character data types, or\n other structured array data types.\n\n **`datatype_name`**: a Python string containing a description of the\n compound data type.\n\n ***Note 1***: When creating nested compound data types,\n the inner compound data types must already be associated with CompoundType\n instances (so create CompoundType instances for the innermost structures\n first).\n\n ***Note 2***: `netCDF4.CompoundType` instances should be created using the\n `netCDF4.Dataset.createCompoundType`\n method of a `netCDF4.Dataset` or `netCDF4.Group` instance, not using this class directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_12CompoundType___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grp = 0; PyObject *__pyx_v_dt = 0; PyObject *__pyx_v_dtype_name = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grp,&__pyx_n_s_dt,&__pyx_n_s_dtype_name,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_grp = values[0]; __pyx_v_dt = values[1]; __pyx_v_dtype_name = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4424; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self), __pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_kwargs) { nc_type __pyx_v_xtype; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; nc_type __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dt); /* "netCDF4/_netCDF4.pyx":4449 * """ * cdef nc_type xtype * dt = numpy.dtype(dt,align=True) # <<<<<<<<<<<<<< * if 'typeid' in kwargs: * xtype = kwargs['typeid'] */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dt); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_align, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4450 * cdef nc_type xtype * dt = numpy.dtype(dt,align=True) * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_typeid, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "netCDF4/_netCDF4.pyx":4451 * dt = numpy.dtype(dt,align=True) * if 'typeid' in kwargs: * xtype = kwargs['typeid'] # <<<<<<<<<<<<<< * else: * xtype = _def_compound(grp, dt, dtype_name) */ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_typeid); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_As_nc_type(__pyx_t_4); if (unlikely((__pyx_t_7 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_xtype = __pyx_t_7; /* "netCDF4/_netCDF4.pyx":4450 * cdef nc_type xtype * dt = numpy.dtype(dt,align=True) * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4453 * xtype = kwargs['typeid'] * else: * xtype = _def_compound(grp, dt, dtype_name) # <<<<<<<<<<<<<< * self._nc_type = xtype * self.dtype = dt */ /*else*/ { __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__def_compound(__pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = __Pyx_PyInt_As_nc_type(__pyx_t_4); if (unlikely((__pyx_t_7 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_xtype = __pyx_t_7; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4454 * else: * xtype = _def_compound(grp, dt, dtype_name) * self._nc_type = xtype # <<<<<<<<<<<<<< * self.dtype = dt * self.name = dtype_name */ __pyx_v_self->_nc_type = __pyx_v_xtype; /* "netCDF4/_netCDF4.pyx":4455 * xtype = _def_compound(grp, dt, dtype_name) * self._nc_type = xtype * self.dtype = dt # <<<<<<<<<<<<<< * self.name = dtype_name * */ __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_dt; /* "netCDF4/_netCDF4.pyx":4456 * self._nc_type = xtype * self.dtype = dt * self.name = dtype_name # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_INCREF(__pyx_v_dtype_name); __Pyx_GIVEREF(__pyx_v_dtype_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_dtype_name; /* "netCDF4/_netCDF4.pyx":4424 * __pdoc__['CompoundType.dtype'] = \ * """A numpy dtype object describing the compound data type.""" * def __init__(self, grp, object dt, object dtype_name, **kwargs): # <<<<<<<<<<<<<< * """ * ***`__init__(group, datatype, datatype_name)`*** */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dt); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4458 * self.name = dtype_name * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_3__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_2__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":4459 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4460 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4459 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":4462 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4458 * self.name = dtype_name * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4464 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ * (self.name,self.dtype) */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":4465 * * def __unicode__(self): * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ # <<<<<<<<<<<<<< * (self.name,self.dtype) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "netCDF4/_netCDF4.pyx":4466 * def __unicode__(self): * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ * (self.name,self.dtype) # <<<<<<<<<<<<<< * * cdef _def_compound(grp, object dt, object dtype_name): */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->name); __Pyx_GIVEREF(__pyx_v_self->name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->dtype); /* "netCDF4/_netCDF4.pyx":4465 * * def __unicode__(self): * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ # <<<<<<<<<<<<<< * (self.name,self.dtype) * */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_name_s_numpy_dtype_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4464 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ * (self.name,self.dtype) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4418 * the user. * """ * cdef public nc_type _nc_type # <<<<<<<<<<<<<< * cdef public dtype, name * __pdoc__['CompoundType.name'] = \ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_nc_type(__pyx_v_self->_nc_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType._nc_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations nc_type __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_nc_type(__pyx_v_value); if (unlikely((__pyx_t_1 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_nc_type = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.CompoundType._nc_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4419 * """ * cdef public nc_type _nc_type * cdef public dtype, name # <<<<<<<<<<<<<< * __pdoc__['CompoundType.name'] = \ * """String name.""" */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dtype); __pyx_r = __pyx_v_self->dtype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_5dtype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_12CompoundType_4name_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_12CompoundType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_CompoundType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4468 * (self.name,self.dtype) * * cdef _def_compound(grp, object dt, object dtype_name): # <<<<<<<<<<<<<< * # private function used to construct a netcdf compound data type * # from a numpy dtype object by CompoundType.__init__. */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_compound(PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name) { nc_type __pyx_v_xtype; nc_type __pyx_v_xtype_tmp; int __pyx_v_ierr; int __pyx_v_ndims; size_t __pyx_v_offset; size_t __pyx_v_size; char *__pyx_v_namstring; char *__pyx_v_nested_namstring; int *__pyx_v_dim_sizes; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_formats = NULL; PyObject *__pyx_v_offsets = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_format = NULL; long __pyx_v_n; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; size_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; nc_type __pyx_t_18; Py_ssize_t __pyx_t_19; int __pyx_t_20; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_def_compound", 0); /* "netCDF4/_netCDF4.pyx":4477 * cdef char *nested_namstring * cdef int *dim_sizes * bytestr = _strencode(dtype_name) # <<<<<<<<<<<<<< * namstring = bytestr * size = dt.itemsize */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_dtype_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4478 * cdef int *dim_sizes * bytestr = _strencode(dtype_name) * namstring = bytestr # <<<<<<<<<<<<<< * size = dt.itemsize * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4479 * bytestr = _strencode(dtype_name) * namstring = bytestr * size = dt.itemsize # <<<<<<<<<<<<<< * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) * if ierr != NC_NOERR: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_size = __pyx_t_3; /* "netCDF4/_netCDF4.pyx":4480 * namstring = bytestr * size = dt.itemsize * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = nc_def_compound(__pyx_t_4, __pyx_v_size, __pyx_v_namstring, (&__pyx_v_xtype)); /* "netCDF4/_netCDF4.pyx":4481 * size = dt.itemsize * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * names = list(dt.fields.keys()) */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4482 * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * names = list(dt.fields.keys()) * formats = [v[0] for v in dt.fields.values()] */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4481 * size = dt.itemsize * ierr = nc_def_compound(grp._grpid, size, namstring, &xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * names = list(dt.fields.keys()) */ } /* "netCDF4/_netCDF4.pyx":4483 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * names = list(dt.fields.keys()) # <<<<<<<<<<<<<< * formats = [v[0] for v in dt.fields.values()] * offsets = [v[1] for v in dt.fields.values()] */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_keys); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_names = __pyx_t_7; __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4484 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * names = list(dt.fields.keys()) * formats = [v[0] for v in dt.fields.values()] # <<<<<<<<<<<<<< * offsets = [v[1] for v in dt.fields.values()] * # make sure entries in lists sorted by offset. */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_values); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_10(__pyx_t_8); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_formats = __pyx_t_7; __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4485 * names = list(dt.fields.keys()) * formats = [v[0] for v in dt.fields.values()] * offsets = [v[1] for v in dt.fields.values()] # <<<<<<<<<<<<<< * # make sure entries in lists sorted by offset. * # (don't know why this is necessary, but it is for version 4.0.1) */ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } if (__pyx_t_1) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); #endif } } else { __pyx_t_8 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_8); } __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_v, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_offsets = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4488 * # make sure entries in lists sorted by offset. * # (don't know why this is necessary, but it is for version 4.0.1) * names = _sortbylist(names, offsets) # <<<<<<<<<<<<<< * formats = _sortbylist(formats, offsets) * offsets.sort() */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sortbylist); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_v_names); __Pyx_INCREF(__pyx_v_offsets); __Pyx_GIVEREF(__pyx_v_offsets); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_v_offsets); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4489 * # (don't know why this is necessary, but it is for version 4.0.1) * names = _sortbylist(names, offsets) * formats = _sortbylist(formats, offsets) # <<<<<<<<<<<<<< * offsets.sort() * for name, format, offset in zip(names, formats, offsets): */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sortbylist); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_formats); __Pyx_GIVEREF(__pyx_v_formats); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_v_formats); __Pyx_INCREF(__pyx_v_offsets); __Pyx_GIVEREF(__pyx_v_offsets); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_v_offsets); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_formats, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4490 * names = _sortbylist(names, offsets) * formats = _sortbylist(formats, offsets) * offsets.sort() # <<<<<<<<<<<<<< * for name, format, offset in zip(names, formats, offsets): * bytestr = _strencode(name) */ __pyx_t_11 = PyList_Sort(__pyx_v_offsets); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4491 * formats = _sortbylist(formats, offsets) * offsets.sort() * for name, format, offset in zip(names, formats, offsets): # <<<<<<<<<<<<<< * bytestr = _strencode(name) * namstring = bytestr */ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_zip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_1 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_v_names); __Pyx_INCREF(__pyx_v_formats); __Pyx_GIVEREF(__pyx_v_formats); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_v_formats); __Pyx_INCREF(__pyx_v_offsets); __Pyx_GIVEREF(__pyx_v_offsets); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_9, __pyx_v_offsets); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_10(__pyx_t_6); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_12 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_12); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L11_unpacking_done:; } __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_12); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_format, __pyx_t_8); __pyx_t_8 = 0; __pyx_v_offset = __pyx_t_3; /* "netCDF4/_netCDF4.pyx":4492 * offsets.sort() * for name, format, offset in zip(names, formats, offsets): * bytestr = _strencode(name) # <<<<<<<<<<<<<< * namstring = bytestr * if format.kind != 'V': # scalar primitive type */ __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4493 * for name, format, offset in zip(names, formats, offsets): * bytestr = _strencode(name) * namstring = bytestr # <<<<<<<<<<<<<< * if format.kind != 'V': # scalar primitive type * try: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4494 * bytestr = _strencode(name) * namstring = bytestr * if format.kind != 'V': # scalar primitive type # <<<<<<<<<<<<<< * try: * xtype_tmp = _nptonctype[format.str[1:]] */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_kind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_n_s_V, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4495 * namstring = bytestr * if format.kind != 'V': # scalar primitive type * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.str[1:]] * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4496 * if format.kind != 'V': # scalar primitive type * try: * xtype_tmp = _nptonctype[format.str[1:]] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError('Unsupported compound type element') */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L13_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_str); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L13_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_t_12, 1, 0, NULL, NULL, &__pyx_slice__88, 1, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L13_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L13_error;}; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_18 = __Pyx_PyInt_As_nc_type(__pyx_t_12); if (unlikely((__pyx_t_18 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L13_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_v_xtype_tmp = __pyx_t_18; /* "netCDF4/_netCDF4.pyx":4495 * namstring = bytestr * if format.kind != 'V': # scalar primitive type * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.str[1:]] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L20_try_end; __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; /* "netCDF4/_netCDF4.pyx":4497 * try: * xtype_tmp = _nptonctype[format.str[1:]] * except KeyError: # <<<<<<<<<<<<<< * raise ValueError('Unsupported compound type element') * ierr = nc_insert_compound(grp._grpid, xtype, namstring, */ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_4) { __Pyx_AddTraceback("netCDF4._netCDF4._def_compound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4497; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":4498 * xtype_tmp = _nptonctype[format.str[1:]] * except KeyError: * raise ValueError('Unsupported compound type element') # <<<<<<<<<<<<<< * ierr = nc_insert_compound(grp._grpid, xtype, namstring, * offset, xtype_tmp) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4498; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4498; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;} } goto __pyx_L15_except_error; __pyx_L15_except_error:; /* "netCDF4/_netCDF4.pyx":4495 * namstring = bytestr * if format.kind != 'V': # scalar primitive type * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.str[1:]] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); goto __pyx_L1_error; __pyx_L20_try_end:; } /* "netCDF4/_netCDF4.pyx":4499 * except KeyError: * raise ValueError('Unsupported compound type element') * ierr = nc_insert_compound(grp._grpid, xtype, namstring, # <<<<<<<<<<<<<< * offset, xtype_tmp) * if ierr != NC_NOERR: */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4500 * raise ValueError('Unsupported compound type element') * ierr = nc_insert_compound(grp._grpid, xtype, namstring, * offset, xtype_tmp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_insert_compound(__pyx_t_4, __pyx_v_xtype, __pyx_v_namstring, __pyx_v_offset, __pyx_v_xtype_tmp); /* "netCDF4/_netCDF4.pyx":4501 * ierr = nc_insert_compound(grp._grpid, xtype, namstring, * offset, xtype_tmp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4502 * offset, xtype_tmp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * if format.shape == (): # nested scalar compound type */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4501 * ierr = nc_insert_compound(grp._grpid, xtype, namstring, * offset, xtype_tmp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ } /* "netCDF4/_netCDF4.pyx":4494 * bytestr = _strencode(name) * namstring = bytestr * if format.kind != 'V': # scalar primitive type # <<<<<<<<<<<<<< * try: * xtype_tmp = _nptonctype[format.str[1:]] */ goto __pyx_L12; } /* "netCDF4/_netCDF4.pyx":4504 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * if format.shape == (): # nested scalar compound type # <<<<<<<<<<<<<< * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format) */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_empty_tuple, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4506 * if format.shape == (): # nested scalar compound type * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format) # <<<<<<<<<<<<<< * bytestr = _strencode(name) * nested_namstring = bytestr */ __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__find_cmptype(__pyx_v_grp, __pyx_v_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_18 = __Pyx_PyInt_As_nc_type(__pyx_t_8); if (unlikely((__pyx_t_18 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_xtype_tmp = __pyx_t_18; /* "netCDF4/_netCDF4.pyx":4507 * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format) * bytestr = _strencode(name) # <<<<<<<<<<<<<< * nested_namstring = bytestr * ierr = nc_insert_compound(grp._grpid, xtype,\ */ __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4508 * xtype_tmp = _find_cmptype(grp, format) * bytestr = _strencode(name) * nested_namstring = bytestr # <<<<<<<<<<<<<< * ierr = nc_insert_compound(grp._grpid, xtype,\ * nested_namstring,\ */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_nested_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4509 * bytestr = _strencode(name) * nested_namstring = bytestr * ierr = nc_insert_compound(grp._grpid, xtype,\ # <<<<<<<<<<<<<< * nested_namstring,\ * offset, xtype_tmp) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4511 * ierr = nc_insert_compound(grp._grpid, xtype,\ * nested_namstring,\ * offset, xtype_tmp) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_insert_compound(__pyx_t_4, __pyx_v_xtype, __pyx_v_nested_namstring, __pyx_v_offset, __pyx_v_xtype_tmp); /* "netCDF4/_netCDF4.pyx":4512 * nested_namstring,\ * offset, xtype_tmp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: # array compound element */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4513 * offset, xtype_tmp) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: # array compound element * ndims = len(format.shape) */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_8 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4512 * nested_namstring,\ * offset, xtype_tmp) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: # array compound element */ } /* "netCDF4/_netCDF4.pyx":4504 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * if format.shape == (): # nested scalar compound type # <<<<<<<<<<<<<< * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format) */ goto __pyx_L24; } /* "netCDF4/_netCDF4.pyx":4515 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: # array compound element * ndims = len(format.shape) # <<<<<<<<<<<<<< * dim_sizes = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_19 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_ndims = __pyx_t_19; /* "netCDF4/_netCDF4.pyx":4516 * else: # array compound element * ndims = len(format.shape) * dim_sizes = malloc(sizeof(int) * ndims) # <<<<<<<<<<<<<< * for n from 0 <= n < ndims: * dim_sizes[n] = format.shape[n] */ __pyx_v_dim_sizes = ((int *)malloc(((sizeof(int)) * __pyx_v_ndims))); /* "netCDF4/_netCDF4.pyx":4517 * ndims = len(format.shape) * dim_sizes = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: # <<<<<<<<<<<<<< * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. */ __pyx_t_4 = __pyx_v_ndims; for (__pyx_v_n = 0; __pyx_v_n < __pyx_t_4; __pyx_v_n++) { /* "netCDF4/_netCDF4.pyx":4518 * dim_sizes = malloc(sizeof(int) * ndims) * for n from 0 <= n < ndims: * dim_sizes[n] = format.shape[n] # <<<<<<<<<<<<<< * if format.subdtype[0].str[1] != 'V': # primitive type. * try: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, __pyx_v_n, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_20 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; (__pyx_v_dim_sizes[__pyx_v_n]) = __pyx_t_20; } /* "netCDF4/_netCDF4.pyx":4519 * for n from 0 <= n < ndims: * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. # <<<<<<<<<<<<<< * try: * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_subdtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_str); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_V, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4520 * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] * except KeyError: */ { __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4521 * if format.subdtype[0].str[1] != 'V': # primitive type. * try: * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] # <<<<<<<<<<<<<< * except KeyError: * raise ValueError('Unsupported compound type element') */ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_subdtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;}; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_str); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_t_7, 1, 0, NULL, NULL, &__pyx_slice__90, 1, 0, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyObject_GetItem(__pyx_t_8, __pyx_t_12); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;}; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_18 = __Pyx_PyInt_As_nc_type(__pyx_t_7); if (unlikely((__pyx_t_18 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L29_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_xtype_tmp = __pyx_t_18; /* "netCDF4/_netCDF4.pyx":4520 * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L36_try_end; __pyx_L29_error:; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4522 * try: * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] * except KeyError: # <<<<<<<<<<<<<< * raise ValueError('Unsupported compound type element') * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, */ __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_4) { __Pyx_AddTraceback("netCDF4._netCDF4._def_compound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_12, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4522; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_8); /* "netCDF4/_netCDF4.pyx":4523 * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] * except KeyError: * raise ValueError('Unsupported compound type element') # <<<<<<<<<<<<<< * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, * offset,xtype_tmp,ndims,dim_sizes) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4523; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4523; __pyx_clineno = __LINE__; goto __pyx_L31_except_error;} } goto __pyx_L31_except_error; __pyx_L31_except_error:; /* "netCDF4/_netCDF4.pyx":4520 * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. * try: # <<<<<<<<<<<<<< * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_16, __pyx_t_15); goto __pyx_L1_error; __pyx_L36_try_end:; } /* "netCDF4/_netCDF4.pyx":4524 * except KeyError: * raise ValueError('Unsupported compound type element') * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, # <<<<<<<<<<<<<< * offset,xtype_tmp,ndims,dim_sizes) * if ierr != NC_NOERR: */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4525 * raise ValueError('Unsupported compound type element') * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, * offset,xtype_tmp,ndims,dim_sizes) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_insert_array_compound(__pyx_t_4, __pyx_v_xtype, __pyx_v_namstring, __pyx_v_offset, __pyx_v_xtype_tmp, __pyx_v_ndims, __pyx_v_dim_sizes); /* "netCDF4/_netCDF4.pyx":4526 * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, * offset,xtype_tmp,ndims,dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: # nested array compound type. */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4527 * offset,xtype_tmp,ndims,dim_sizes) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: # nested array compound type. * # find this compound type in this group or it's parents. */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_8 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4526 * ierr = nc_insert_array_compound(grp._grpid,xtype,namstring, * offset,xtype_tmp,ndims,dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: # nested array compound type. */ } /* "netCDF4/_netCDF4.pyx":4519 * for n from 0 <= n < ndims: * dim_sizes[n] = format.shape[n] * if format.subdtype[0].str[1] != 'V': # primitive type. # <<<<<<<<<<<<<< * try: * xtype_tmp = _nptonctype[format.subdtype[0].str[1:]] */ goto __pyx_L28; } /* "netCDF4/_netCDF4.pyx":4530 * else: # nested array compound type. * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format.subdtype[0]) # <<<<<<<<<<<<<< * bytestr = _strencode(name) * nested_namstring = bytestr */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_subdtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__find_cmptype(__pyx_v_grp, __pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_18 = __Pyx_PyInt_As_nc_type(__pyx_t_8); if (unlikely((__pyx_t_18 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_xtype_tmp = __pyx_t_18; /* "netCDF4/_netCDF4.pyx":4531 * # find this compound type in this group or it's parents. * xtype_tmp = _find_cmptype(grp, format.subdtype[0]) * bytestr = _strencode(name) # <<<<<<<<<<<<<< * nested_namstring = bytestr * ierr = nc_insert_array_compound(grp._grpid,xtype,\ */ __pyx_t_8 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_name, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4532 * xtype_tmp = _find_cmptype(grp, format.subdtype[0]) * bytestr = _strencode(name) * nested_namstring = bytestr # <<<<<<<<<<<<<< * ierr = nc_insert_array_compound(grp._grpid,xtype,\ * nested_namstring,\ */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_nested_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4533 * bytestr = _strencode(name) * nested_namstring = bytestr * ierr = nc_insert_array_compound(grp._grpid,xtype,\ # <<<<<<<<<<<<<< * nested_namstring,\ * offset,xtype_tmp,\ */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4536 * nested_namstring,\ * offset,xtype_tmp,\ * ndims,dim_sizes) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_insert_array_compound(__pyx_t_4, __pyx_v_xtype, __pyx_v_nested_namstring, __pyx_v_offset, __pyx_v_xtype_tmp, __pyx_v_ndims, __pyx_v_dim_sizes); /* "netCDF4/_netCDF4.pyx":4537 * offset,xtype_tmp,\ * ndims,dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(dim_sizes) */ __pyx_t_5 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_5) { /* "netCDF4/_netCDF4.pyx":4538 * ndims,dim_sizes) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * free(dim_sizes) * return xtype */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_8 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4537 * offset,xtype_tmp,\ * ndims,dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(dim_sizes) */ } } __pyx_L28:; /* "netCDF4/_netCDF4.pyx":4539 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(dim_sizes) # <<<<<<<<<<<<<< * return xtype * */ free(__pyx_v_dim_sizes); } __pyx_L24:; } __pyx_L12:; /* "netCDF4/_netCDF4.pyx":4491 * formats = _sortbylist(formats, offsets) * offsets.sort() * for name, format, offset in zip(names, formats, offsets): # <<<<<<<<<<<<<< * bytestr = _strencode(name) * namstring = bytestr */ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4540 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * free(dim_sizes) * return xtype # <<<<<<<<<<<<<< * * cdef _find_cmptype(grp, dtype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4468 * (self.name,self.dtype) * * cdef _def_compound(grp, object dt, object dtype_name): # <<<<<<<<<<<<<< * # private function used to construct a netcdf compound data type * # from a numpy dtype object by CompoundType.__init__. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("netCDF4._netCDF4._def_compound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_formats); __Pyx_XDECREF(__pyx_v_offsets); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4542 * return xtype * * cdef _find_cmptype(grp, dtype): # <<<<<<<<<<<<<< * # look for data type in this group and it's parents. * # return datatype id when found, if not found, raise exception. */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__find_cmptype(PyObject *__pyx_v_grp, PyObject *__pyx_v_dtype) { nc_type __pyx_v_xtype; int __pyx_v_match; CYTHON_UNUSED PyObject *__pyx_v_cmpname = NULL; PyObject *__pyx_v_cmpdt = NULL; PyObject *__pyx_v_names1 = NULL; PyObject *__pyx_v_names2 = NULL; PyObject *__pyx_v_formats1 = NULL; PyObject *__pyx_v_formats2 = NULL; PyObject *__pyx_v_parent_grp = NULL; PyObject *__pyx_v_v = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); nc_type __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_t_12; int __pyx_t_13; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; int __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_find_cmptype", 0); /* "netCDF4/_netCDF4.pyx":4546 * # return datatype id when found, if not found, raise exception. * cdef nc_type xtype * match = False # <<<<<<<<<<<<<< * for cmpname, cmpdt in grp.cmptypes.items(): * xtype = cmpdt._nc_type */ __pyx_v_match = 0; /* "netCDF4/_netCDF4.pyx":4547 * cdef nc_type xtype * match = False * for cmpname, cmpdt in grp.cmptypes.items(): # <<<<<<<<<<<<<< * xtype = cmpdt._nc_type * names1 = dtype.names; names2 = cmpdt.dtype.names */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_cmptypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_cmpname, __pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_cmpdt, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4548 * match = False * for cmpname, cmpdt in grp.cmptypes.items(): * xtype = cmpdt._nc_type # <<<<<<<<<<<<<< * names1 = dtype.names; names2 = cmpdt.dtype.names * formats1 = [v[0] for v in dtype.fields.values()] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmpdt, __pyx_n_s_nc_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_nc_type(__pyx_t_1); if (unlikely((__pyx_t_9 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xtype = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4549 * for cmpname, cmpdt in grp.cmptypes.items(): * xtype = cmpdt._nc_type * names1 = dtype.names; names2 = cmpdt.dtype.names # <<<<<<<<<<<<<< * formats1 = [v[0] for v in dtype.fields.values()] * formats2 = [v[0] for v in cmpdt.dtype.fields.values()] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_names1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmpdt, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_names2, __pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4550 * xtype = cmpdt._nc_type * names1 = dtype.names; names2 = cmpdt.dtype.names * formats1 = [v[0] for v in dtype.fields.values()] # <<<<<<<<<<<<<< * formats2 = [v[0] for v in cmpdt.dtype.fields.values()] * # match names, formats, but not offsets (they may be changed */ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_11(__pyx_t_7); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_formats1, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4551 * names1 = dtype.names; names2 = cmpdt.dtype.names * formats1 = [v[0] for v in dtype.fields.values()] * formats2 = [v[0] for v in cmpdt.dtype.fields.values()] # <<<<<<<<<<<<<< * # match names, formats, but not offsets (they may be changed * # by netcdf lib). */ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cmpdt, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fields); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_11(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_formats2, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4554 * # match names, formats, but not offsets (they may be changed * # by netcdf lib). * if names1==names2 and formats1==formats2: # <<<<<<<<<<<<<< * match = True * break */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_names1, __pyx_v_names2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_13) { } else { __pyx_t_12 = __pyx_t_13; goto __pyx_L12_bool_binop_done; } __pyx_t_6 = PyObject_RichCompare(__pyx_v_formats1, __pyx_v_formats2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_12 = __pyx_t_13; __pyx_L12_bool_binop_done:; if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":4555 * # by netcdf lib). * if names1==names2 and formats1==formats2: * match = True # <<<<<<<<<<<<<< * break * if not match: */ __pyx_v_match = 1; /* "netCDF4/_netCDF4.pyx":4556 * if names1==names2 and formats1==formats2: * match = True * break # <<<<<<<<<<<<<< * if not match: * try: */ goto __pyx_L4_break; /* "netCDF4/_netCDF4.pyx":4554 * # match names, formats, but not offsets (they may be changed * # by netcdf lib). * if names1==names2 and formats1==formats2: # <<<<<<<<<<<<<< * match = True * break */ } /* "netCDF4/_netCDF4.pyx":4547 * cdef nc_type xtype * match = False * for cmpname, cmpdt in grp.cmptypes.items(): # <<<<<<<<<<<<<< * xtype = cmpdt._nc_type * names1 = dtype.names; names2 = cmpdt.dtype.names */ } __pyx_L4_break:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4557 * match = True * break * if not match: # <<<<<<<<<<<<<< * try: * parent_grp = grp.parent */ __pyx_t_12 = ((!(__pyx_v_match != 0)) != 0); if (__pyx_t_12) { /* "netCDF4/_netCDF4.pyx":4558 * break * if not match: * try: # <<<<<<<<<<<<<< * parent_grp = grp.parent * except AttributeError: */ { __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4559 * if not match: * try: * parent_grp = grp.parent # <<<<<<<<<<<<<< * except AttributeError: * raise ValueError("cannot find compound type in this group or parent groups") */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4559; __pyx_clineno = __LINE__; goto __pyx_L15_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_v_parent_grp = __pyx_t_3; __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4558 * break * if not match: * try: # <<<<<<<<<<<<<< * parent_grp = grp.parent * except AttributeError: */ } __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L22_try_end; __pyx_L15_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4560 * try: * parent_grp = grp.parent * except AttributeError: # <<<<<<<<<<<<<< * raise ValueError("cannot find compound type in this group or parent groups") * if parent_grp is None: */ __pyx_t_17 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_17) { __Pyx_AddTraceback("netCDF4._netCDF4._find_cmptype", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4560; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_1); /* "netCDF4/_netCDF4.pyx":4561 * parent_grp = grp.parent * except AttributeError: * raise ValueError("cannot find compound type in this group or parent groups") # <<<<<<<<<<<<<< * if parent_grp is None: * raise ValueError("cannot find compound type in this group or parent groups") */ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4561; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;} } goto __pyx_L17_except_error; __pyx_L17_except_error:; /* "netCDF4/_netCDF4.pyx":4558 * break * if not match: * try: # <<<<<<<<<<<<<< * parent_grp = grp.parent * except AttributeError: */ __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); goto __pyx_L1_error; __pyx_L22_try_end:; } /* "netCDF4/_netCDF4.pyx":4562 * except AttributeError: * raise ValueError("cannot find compound type in this group or parent groups") * if parent_grp is None: # <<<<<<<<<<<<<< * raise ValueError("cannot find compound type in this group or parent groups") * else: */ __pyx_t_12 = (__pyx_v_parent_grp == Py_None); __pyx_t_13 = (__pyx_t_12 != 0); if (__pyx_t_13) { /* "netCDF4/_netCDF4.pyx":4563 * raise ValueError("cannot find compound type in this group or parent groups") * if parent_grp is None: * raise ValueError("cannot find compound type in this group or parent groups") # <<<<<<<<<<<<<< * else: * xtype = _find_cmptype(parent_grp,dtype) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4562 * except AttributeError: * raise ValueError("cannot find compound type in this group or parent groups") * if parent_grp is None: # <<<<<<<<<<<<<< * raise ValueError("cannot find compound type in this group or parent groups") * else: */ } /* "netCDF4/_netCDF4.pyx":4565 * raise ValueError("cannot find compound type in this group or parent groups") * else: * xtype = _find_cmptype(parent_grp,dtype) # <<<<<<<<<<<<<< * return xtype * */ /*else*/ { __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__find_cmptype(__pyx_v_parent_grp, __pyx_v_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_As_nc_type(__pyx_t_1); if (unlikely((__pyx_t_9 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_xtype = __pyx_t_9; } /* "netCDF4/_netCDF4.pyx":4557 * match = True * break * if not match: # <<<<<<<<<<<<<< * try: * parent_grp = grp.parent */ } /* "netCDF4/_netCDF4.pyx":4566 * else: * xtype = _find_cmptype(parent_grp,dtype) * return xtype # <<<<<<<<<<<<<< * * cdef _read_compound(group, nc_type xtype, endian=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4542 * return xtype * * cdef _find_cmptype(grp, dtype): # <<<<<<<<<<<<<< * # look for data type in this group and it's parents. * # return datatype id when found, if not found, raise exception. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4._find_cmptype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cmpname); __Pyx_XDECREF(__pyx_v_cmpdt); __Pyx_XDECREF(__pyx_v_names1); __Pyx_XDECREF(__pyx_v_names2); __Pyx_XDECREF(__pyx_v_formats1); __Pyx_XDECREF(__pyx_v_formats2); __Pyx_XDECREF(__pyx_v_parent_grp); __Pyx_XDECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4568 * return xtype * * cdef _read_compound(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a compound data type id from an existing file, * # construct a corresponding numpy dtype instance, */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_compound(PyObject *__pyx_v_group, nc_type __pyx_v_xtype, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound *__pyx_optional_args) { PyObject *__pyx_v_endian = ((PyObject *)Py_None); int __pyx_v_ierr; int __pyx_v_nf; int __pyx_v_numdims; int __pyx_v_ndim; int __pyx_v_classp; int __pyx_v__grpid; size_t __pyx_v_nfields; size_t __pyx_v_offset; nc_type __pyx_v_field_typeid; int *__pyx_v_dim_sizes; char __pyx_v_field_namstring[(NC_MAX_NAME + 1)]; char __pyx_v_cmp_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_formats = NULL; PyObject *__pyx_v_offsets = NULL; PyObject *__pyx_v_field_name = NULL; PyObject *__pyx_v_field_shape = NULL; PyObject *__pyx_v_field_type = NULL; PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_dtype_dict = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; int __pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; struct __pyx_opt_args_7netCDF4_8_netCDF4__read_compound __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_compound", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_endian = __pyx_optional_args->endian; } } /* "netCDF4/_netCDF4.pyx":4581 * cdef char cmp_namstring[NC_MAX_NAME+1] * # get name and number of fields. * _grpid = group._grpid # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4582 * # get name and number of fields. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) * if ierr != NC_NOERR: */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4583 * _grpid = group._grpid * with nogil: * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_compound(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_cmp_namstring, NULL, (&__pyx_v_nfields)); } /* "netCDF4/_netCDF4.pyx":4582 * # get name and number of fields. * _grpid = group._grpid * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":4584 * with nogil: * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = cmp_namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4585 * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = cmp_namstring.decode(default_encoding,unicode_error) * # loop over fields. */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4584 * with nogil: * ierr = nc_inq_compound(_grpid, xtype, cmp_namstring, NULL, &nfields) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = cmp_namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":4586 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = cmp_namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * # loop over fields. * names = [] */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_cmp_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4588 * name = cmp_namstring.decode(default_encoding,unicode_error) * # loop over fields. * names = [] # <<<<<<<<<<<<<< * formats = [] * offsets = [] */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_names = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4589 * # loop over fields. * names = [] * formats = [] # <<<<<<<<<<<<<< * offsets = [] * for nf from 0 <= nf < nfields: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_formats = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4590 * names = [] * formats = [] * offsets = [] # <<<<<<<<<<<<<< * for nf from 0 <= nf < nfields: * with nogil: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_offsets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4591 * formats = [] * offsets = [] * for nf from 0 <= nf < nfields: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_compound_field(_grpid, */ __pyx_t_11 = __pyx_v_nfields; for (__pyx_v_nf = 0; __pyx_v_nf < __pyx_t_11; __pyx_v_nf++) { /* "netCDF4/_netCDF4.pyx":4592 * offsets = [] * for nf from 0 <= nf < nfields: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound_field(_grpid, * xtype, */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4593 * for nf from 0 <= nf < nfields: * with nogil: * ierr = nc_inq_compound_field(_grpid, # <<<<<<<<<<<<<< * xtype, * nf, */ __pyx_v_ierr = nc_inq_compound_field(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_nf, __pyx_v_field_namstring, (&__pyx_v_offset), (&__pyx_v_field_typeid), (&__pyx_v_numdims), NULL); } /* "netCDF4/_netCDF4.pyx":4592 * offsets = [] * for nf from 0 <= nf < nfields: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound_field(_grpid, * xtype, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L13; } __pyx_L13:; } } /* "netCDF4/_netCDF4.pyx":4601 * &numdims, * NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dim_sizes = malloc(sizeof(int) * numdims) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4602 * NULL) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * dim_sizes = malloc(sizeof(int) * numdims) * with nogil: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4601 * &numdims, * NULL) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dim_sizes = malloc(sizeof(int) * numdims) */ } /* "netCDF4/_netCDF4.pyx":4603 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dim_sizes = malloc(sizeof(int) * numdims) # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_compound_field(_grpid, */ __pyx_v_dim_sizes = ((int *)malloc(((sizeof(int)) * __pyx_v_numdims))); /* "netCDF4/_netCDF4.pyx":4604 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dim_sizes = malloc(sizeof(int) * numdims) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound_field(_grpid, * xtype, */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4605 * dim_sizes = malloc(sizeof(int) * numdims) * with nogil: * ierr = nc_inq_compound_field(_grpid, # <<<<<<<<<<<<<< * xtype, * nf, */ __pyx_v_ierr = nc_inq_compound_field(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_nf, __pyx_v_field_namstring, (&__pyx_v_offset), (&__pyx_v_field_typeid), (&__pyx_v_numdims), __pyx_v_dim_sizes); } /* "netCDF4/_netCDF4.pyx":4604 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * dim_sizes = malloc(sizeof(int) * numdims) * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_compound_field(_grpid, * xtype, */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L19; } __pyx_L19:; } } /* "netCDF4/_netCDF4.pyx":4613 * &numdims, * dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * field_name = field_namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4614 * dim_sizes) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * field_name = field_namstring.decode(default_encoding,unicode_error) * names.append(field_name) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4613 * &numdims, * dim_sizes) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * field_name = field_namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":4615 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * field_name = field_namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * names.append(field_name) * offsets.append(offset) */ __pyx_t_6 = __Pyx_PyObject_FromString(__pyx_v_field_namstring); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_decode); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_9 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_field_name, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4616 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * field_name = field_namstring.decode(default_encoding,unicode_error) * names.append(field_name) # <<<<<<<<<<<<<< * offsets.append(offset) * # if numdims=0, not an array. */ __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_names, __pyx_v_field_name); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4617 * field_name = field_namstring.decode(default_encoding,unicode_error) * names.append(field_name) * offsets.append(offset) # <<<<<<<<<<<<<< * # if numdims=0, not an array. * field_shape = () */ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_offsets, __pyx_t_1); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4619 * offsets.append(offset) * # if numdims=0, not an array. * field_shape = () # <<<<<<<<<<<<<< * if numdims != 0: * for ndim from 0 <= ndim < numdims: */ __Pyx_INCREF(__pyx_empty_tuple); __Pyx_XDECREF_SET(__pyx_v_field_shape, __pyx_empty_tuple); /* "netCDF4/_netCDF4.pyx":4620 * # if numdims=0, not an array. * field_shape = () * if numdims != 0: # <<<<<<<<<<<<<< * for ndim from 0 <= ndim < numdims: * field_shape = field_shape + (dim_sizes[ndim],) */ __pyx_t_3 = ((__pyx_v_numdims != 0) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4621 * field_shape = () * if numdims != 0: * for ndim from 0 <= ndim < numdims: # <<<<<<<<<<<<<< * field_shape = field_shape + (dim_sizes[ndim],) * free(dim_sizes) */ __pyx_t_2 = __pyx_v_numdims; for (__pyx_v_ndim = 0; __pyx_v_ndim < __pyx_t_2; __pyx_v_ndim++) { /* "netCDF4/_netCDF4.pyx":4622 * if numdims != 0: * for ndim from 0 <= ndim < numdims: * field_shape = field_shape + (dim_sizes[ndim],) # <<<<<<<<<<<<<< * free(dim_sizes) * # check to see if this field is a nested compound type. */ __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_dim_sizes[__pyx_v_ndim])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_v_field_shape, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF_SET(__pyx_v_field_shape, __pyx_t_1); __pyx_t_1 = 0; } /* "netCDF4/_netCDF4.pyx":4620 * # if numdims=0, not an array. * field_shape = () * if numdims != 0: # <<<<<<<<<<<<<< * for ndim from 0 <= ndim < numdims: * field_shape = field_shape + (dim_sizes[ndim],) */ } /* "netCDF4/_netCDF4.pyx":4623 * for ndim from 0 <= ndim < numdims: * field_shape = field_shape + (dim_sizes[ndim],) * free(dim_sizes) # <<<<<<<<<<<<<< * # check to see if this field is a nested compound type. * try: */ free(__pyx_v_dim_sizes); /* "netCDF4/_netCDF4.pyx":4625 * free(dim_sizes) * # check to see if this field is a nested compound type. * try: # <<<<<<<<<<<<<< * field_type = _nctonptype[field_typeid] * if endian is not None: */ { __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4626 * # check to see if this field is a nested compound type. * try: * field_type = _nctonptype[field_typeid] # <<<<<<<<<<<<<< * if endian is not None: * format = endian + format */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4626; __pyx_clineno = __LINE__; goto __pyx_L24_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_field_typeid, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4626; __pyx_clineno = __LINE__; goto __pyx_L24_error;}; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_field_type, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":4627 * try: * field_type = _nctonptype[field_typeid] * if endian is not None: # <<<<<<<<<<<<<< * format = endian + format * except KeyError: */ __pyx_t_3 = (__pyx_v_endian != Py_None); __pyx_t_16 = (__pyx_t_3 != 0); if (__pyx_t_16) { /* "netCDF4/_netCDF4.pyx":4628 * field_type = _nctonptype[field_typeid] * if endian is not None: * format = endian + format # <<<<<<<<<<<<<< * except KeyError: * with nogil: */ if (unlikely(!__pyx_v_format)) { __Pyx_RaiseUnboundLocalError("format"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L24_error;} } __pyx_t_10 = PyNumber_Add(__pyx_v_endian, __pyx_v_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4628; __pyx_clineno = __LINE__; goto __pyx_L24_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_XDECREF_SET(__pyx_v_format, __pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":4627 * try: * field_type = _nctonptype[field_typeid] * if endian is not None: # <<<<<<<<<<<<<< * format = endian + format * except KeyError: */ } /* "netCDF4/_netCDF4.pyx":4625 * free(dim_sizes) * # check to see if this field is a nested compound type. * try: # <<<<<<<<<<<<<< * field_type = _nctonptype[field_typeid] * if endian is not None: */ } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L31_try_end; __pyx_L24_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; /* "netCDF4/_netCDF4.pyx":4629 * if endian is not None: * format = endian + format * except KeyError: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_user_type(_grpid, */ __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_2) { __Pyx_AddTraceback("netCDF4._netCDF4._read_compound", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4629; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "netCDF4/_netCDF4.pyx":4630 * format = endian + format * except KeyError: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, * field_typeid,NULL,NULL,NULL,NULL,&classp) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4631 * except KeyError: * with nogil: * ierr = nc_inq_user_type(_grpid, # <<<<<<<<<<<<<< * field_typeid,NULL,NULL,NULL,NULL,&classp) * if classp == NC_COMPOUND: # a compound type */ __pyx_v_ierr = nc_inq_user_type(__pyx_v__grpid, __pyx_v_field_typeid, NULL, NULL, NULL, NULL, (&__pyx_v_classp)); } /* "netCDF4/_netCDF4.pyx":4630 * format = endian + format * except KeyError: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_user_type(_grpid, * field_typeid,NULL,NULL,NULL,NULL,&classp) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L39; } __pyx_L39:; } } /* "netCDF4/_netCDF4.pyx":4633 * ierr = nc_inq_user_type(_grpid, * field_typeid,NULL,NULL,NULL,NULL,&classp) * if classp == NC_COMPOUND: # a compound type # <<<<<<<<<<<<<< * # recursively call this function? * field_type = _read_compound(group, field_typeid, endian=endian) */ __pyx_t_16 = ((__pyx_v_classp == NC_COMPOUND) != 0); if (__pyx_t_16) { /* "netCDF4/_netCDF4.pyx":4635 * if classp == NC_COMPOUND: # a compound type * # recursively call this function? * field_type = _read_compound(group, field_typeid, endian=endian) # <<<<<<<<<<<<<< * else: * raise KeyError('compound field of an unsupported data type') */ __pyx_t_17.__pyx_n = 1; __pyx_t_17.endian = __pyx_v_endian; __pyx_t_7 = __pyx_f_7netCDF4_8_netCDF4__read_compound(__pyx_v_group, __pyx_v_field_typeid, &__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4635; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_XDECREF_SET(__pyx_v_field_type, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4633 * ierr = nc_inq_user_type(_grpid, * field_typeid,NULL,NULL,NULL,NULL,&classp) * if classp == NC_COMPOUND: # a compound type # <<<<<<<<<<<<<< * # recursively call this function? * field_type = _read_compound(group, field_typeid, endian=endian) */ goto __pyx_L40; } /* "netCDF4/_netCDF4.pyx":4637 * field_type = _read_compound(group, field_typeid, endian=endian) * else: * raise KeyError('compound field of an unsupported data type') # <<<<<<<<<<<<<< * if field_shape != (): * formats.append((field_type,field_shape)) */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4637; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4637; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} } __pyx_L40:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L25_exception_handled; } goto __pyx_L26_except_error; __pyx_L26_except_error:; /* "netCDF4/_netCDF4.pyx":4625 * free(dim_sizes) * # check to see if this field is a nested compound type. * try: # <<<<<<<<<<<<<< * field_type = _nctonptype[field_typeid] * if endian is not None: */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L25_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L31_try_end:; } /* "netCDF4/_netCDF4.pyx":4638 * else: * raise KeyError('compound field of an unsupported data type') * if field_shape != (): # <<<<<<<<<<<<<< * formats.append((field_type,field_shape)) * else: */ __pyx_t_8 = PyObject_RichCompare(__pyx_v_field_shape, __pyx_empty_tuple, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_16) { /* "netCDF4/_netCDF4.pyx":4639 * raise KeyError('compound field of an unsupported data type') * if field_shape != (): * formats.append((field_type,field_shape)) # <<<<<<<<<<<<<< * else: * formats.append(field_type) */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_field_type); __Pyx_GIVEREF(__pyx_v_field_type); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_field_type); __Pyx_INCREF(__pyx_v_field_shape); __Pyx_GIVEREF(__pyx_v_field_shape); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_field_shape); __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_formats, __pyx_t_8); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4638 * else: * raise KeyError('compound field of an unsupported data type') * if field_shape != (): # <<<<<<<<<<<<<< * formats.append((field_type,field_shape)) * else: */ goto __pyx_L41; } /* "netCDF4/_netCDF4.pyx":4641 * formats.append((field_type,field_shape)) * else: * formats.append(field_type) # <<<<<<<<<<<<<< * # make sure entries in lists sorted by offset. * names = _sortbylist(names, offsets) */ /*else*/ { __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_formats, __pyx_v_field_type); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L41:; } /* "netCDF4/_netCDF4.pyx":4643 * formats.append(field_type) * # make sure entries in lists sorted by offset. * names = _sortbylist(names, offsets) # <<<<<<<<<<<<<< * formats = _sortbylist(formats, offsets) * offsets.sort() */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sortbylist); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_v_names); __Pyx_INCREF(__pyx_v_offsets); __Pyx_GIVEREF(__pyx_v_offsets); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_v_offsets); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_names, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4644 * # make sure entries in lists sorted by offset. * names = _sortbylist(names, offsets) * formats = _sortbylist(formats, offsets) # <<<<<<<<<<<<<< * offsets.sort() * # create a dict that can be converted into a numpy dtype. */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sortbylist); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_formats); __Pyx_GIVEREF(__pyx_v_formats); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_formats); __Pyx_INCREF(__pyx_v_offsets); __Pyx_GIVEREF(__pyx_v_offsets); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_offsets); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4644; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_formats, __pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4645 * names = _sortbylist(names, offsets) * formats = _sortbylist(formats, offsets) * offsets.sort() # <<<<<<<<<<<<<< * # create a dict that can be converted into a numpy dtype. * dtype_dict = {'names':names,'formats':formats,'offsets':offsets} */ __pyx_t_12 = PyList_Sort(__pyx_v_offsets); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4647 * offsets.sort() * # create a dict that can be converted into a numpy dtype. * dtype_dict = {'names':names,'formats':formats,'offsets':offsets} # <<<<<<<<<<<<<< * return CompoundType(group, dtype_dict, name, typeid=xtype) * */ __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_names, __pyx_v_names) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_formats, __pyx_v_formats) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_offsets, __pyx_v_offsets) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_dtype_dict = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "netCDF4/_netCDF4.pyx":4648 * # create a dict that can be converted into a numpy dtype. * dtype_dict = {'names':names,'formats':formats,'offsets':offsets} * return CompoundType(group, dtype_dict, name, typeid=xtype) # <<<<<<<<<<<<<< * * # VLEN datatype support. */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_dtype_dict); __Pyx_GIVEREF(__pyx_v_dtype_dict); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dtype_dict); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_name); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_typeid, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_CompoundType), __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4568 * return xtype * * cdef _read_compound(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a compound data type id from an existing file, * # construct a corresponding numpy dtype instance, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._read_compound", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_formats); __Pyx_XDECREF(__pyx_v_offsets); __Pyx_XDECREF(__pyx_v_field_name); __Pyx_XDECREF(__pyx_v_field_shape); __Pyx_XDECREF(__pyx_v_field_type); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_dtype_dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4668 * __pdoc__['VLType.dtype'] = \ * """A numpy dtype object describing the component type for the VLEN.""" * def __init__(self, grp, object dt, object dtype_name, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(group, datatype, datatype_name)`** */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_6VLType___init__[] = "\n **`__init__(group, datatype, datatype_name)`**\n\n VLType constructor.\n\n **`group`**: `netCDF4.Group` instance to associate with the VLEN datatype.\n\n **`datatype`**: An numpy dtype object describing the component type for the\n variable length array.\n\n **`datatype_name`**: a Python string containing a description of the\n VLEN data type.\n\n ***`Note`***: `netCDF4.VLType` instances should be created using the\n `netCDF4.Dataset.createVLType`\n method of a `netCDF4.Dataset` or `netCDF4.Group` instance, not using this class directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_6VLType___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grp = 0; PyObject *__pyx_v_dt = 0; PyObject *__pyx_v_dtype_name = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grp,&__pyx_n_s_dt,&__pyx_n_s_dtype_name,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4668; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4668; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4668; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_grp = values[0]; __pyx_v_dt = values[1]; __pyx_v_dtype_name = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4668; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.VLType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self), __pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_kwargs) { nc_type __pyx_v_xtype; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; nc_type __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dt); /* "netCDF4/_netCDF4.pyx":4687 * """ * cdef nc_type xtype * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_typeid, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4688 * cdef nc_type xtype * if 'typeid' in kwargs: * xtype = kwargs['typeid'] # <<<<<<<<<<<<<< * else: * xtype, dt = _def_vlen(grp, dt, dtype_name) */ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_typeid); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_nc_type(__pyx_t_3); if (unlikely((__pyx_t_4 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_xtype = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":4687 * """ * cdef nc_type xtype * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4690 * xtype = kwargs['typeid'] * else: * xtype, dt = _def_vlen(grp, dt, dtype_name) # <<<<<<<<<<<<<< * self._nc_type = xtype * self.dtype = dt */ /*else*/ { __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__def_vlen(__pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_t_4 = __Pyx_PyInt_As_nc_type(__pyx_t_5); if (unlikely((__pyx_t_4 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_xtype = __pyx_t_4; __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4691 * else: * xtype, dt = _def_vlen(grp, dt, dtype_name) * self._nc_type = xtype # <<<<<<<<<<<<<< * self.dtype = dt * if dt == str: */ __pyx_v_self->_nc_type = __pyx_v_xtype; /* "netCDF4/_netCDF4.pyx":4692 * xtype, dt = _def_vlen(grp, dt, dtype_name) * self._nc_type = xtype * self.dtype = dt # <<<<<<<<<<<<<< * if dt == str: * self.name = None */ __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_dt; /* "netCDF4/_netCDF4.pyx":4693 * self._nc_type = xtype * self.dtype = dt * if dt == str: # <<<<<<<<<<<<<< * self.name = None * else: */ __pyx_t_3 = PyObject_RichCompare(__pyx_v_dt, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4694 * self.dtype = dt * if dt == str: * self.name = None # <<<<<<<<<<<<<< * else: * self.name = dtype_name */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* "netCDF4/_netCDF4.pyx":4693 * self._nc_type = xtype * self.dtype = dt * if dt == str: # <<<<<<<<<<<<<< * self.name = None * else: */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":4696 * self.name = None * else: * self.name = dtype_name # <<<<<<<<<<<<<< * * def __repr__(self): */ /*else*/ { __Pyx_INCREF(__pyx_v_dtype_name); __Pyx_GIVEREF(__pyx_v_dtype_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_dtype_name; } __pyx_L6:; /* "netCDF4/_netCDF4.pyx":4668 * __pdoc__['VLType.dtype'] = \ * """A numpy dtype object describing the component type for the VLEN.""" * def __init__(self, grp, object dt, object dtype_name, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(group, datatype, datatype_name)`** */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4.VLType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dt); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4698 * self.name = dtype_name * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_3__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_2__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":4699 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4700 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4699 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":4702 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4698 * self.name = dtype_name * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.VLType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4704 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * if self.dtype == str: * return repr(type(self))+': string type' */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_4__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":4705 * * def __unicode__(self): * if self.dtype == str: # <<<<<<<<<<<<<< * return repr(type(self))+': string type' * else: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->dtype, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4706 * def __unicode__(self): * if self.dtype == str: * return repr(type(self))+': string type' # <<<<<<<<<<<<<< * else: * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s_string_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4705 * * def __unicode__(self): * if self.dtype == str: # <<<<<<<<<<<<<< * return repr(type(self))+': string type' * else: */ } /* "netCDF4/_netCDF4.pyx":4708 * return repr(type(self))+': string type' * else: * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ # <<<<<<<<<<<<<< * (self.name, self.dtype) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); /* "netCDF4/_netCDF4.pyx":4709 * else: * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ * (self.name, self.dtype) # <<<<<<<<<<<<<< * * cdef _def_vlen(grp, object dt, object dtype_name): */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->name); __Pyx_GIVEREF(__pyx_v_self->name); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->dtype); /* "netCDF4/_netCDF4.pyx":4708 * return repr(type(self))+': string type' * else: * return repr(type(self))+": name = '%s', numpy dtype = %s\n" %\ # <<<<<<<<<<<<<< * (self.name, self.dtype) * */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_name_s_numpy_dtype_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4704 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * if self.dtype == str: * return repr(type(self))+': string type' */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("netCDF4._netCDF4.VLType.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4662 * the user. * """ * cdef public nc_type _nc_type # <<<<<<<<<<<<<< * cdef public dtype, name * __pdoc__['VLType.name'] = \ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_nc_type(__pyx_v_self->_nc_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.VLType._nc_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations nc_type __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_nc_type(__pyx_v_value); if (unlikely((__pyx_t_1 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_nc_type = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.VLType._nc_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4663 * """ * cdef public nc_type _nc_type * cdef public dtype, name # <<<<<<<<<<<<<< * __pdoc__['VLType.name'] = \ * """String name.""" */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dtype); __pyx_r = __pyx_v_self->dtype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_5dtype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6VLType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_6VLType_4name_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_VLType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_6VLType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_VLType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4711 * (self.name, self.dtype) * * cdef _def_vlen(grp, object dt, object dtype_name): # <<<<<<<<<<<<<< * # private function used to construct a netcdf VLEN data type * # from a numpy dtype object or python str object by VLType.__init__. */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_vlen(PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name) { nc_type __pyx_v_xtype; nc_type __pyx_v_xtype_tmp; int __pyx_v_ierr; char *__pyx_v_namstring; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; nc_type __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_def_vlen", 0); __Pyx_INCREF(__pyx_v_dt); /* "netCDF4/_netCDF4.pyx":4719 * cdef char *namstring * cdef char *nested_namstring * if dt == str: # python string, use NC_STRING # <<<<<<<<<<<<<< * xtype = NC_STRING * # dtype_name ignored */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_dt, ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4720 * cdef char *nested_namstring * if dt == str: # python string, use NC_STRING * xtype = NC_STRING # <<<<<<<<<<<<<< * # dtype_name ignored * else: # numpy datatype */ __pyx_v_xtype = NC_STRING; /* "netCDF4/_netCDF4.pyx":4719 * cdef char *namstring * cdef char *nested_namstring * if dt == str: # python string, use NC_STRING # <<<<<<<<<<<<<< * xtype = NC_STRING * # dtype_name ignored */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4723 * # dtype_name ignored * else: # numpy datatype * bytestr = _strencode(dtype_name) # <<<<<<<<<<<<<< * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. */ /*else*/ { __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_dtype_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4724 * else: # numpy datatype * bytestr = _strencode(dtype_name) * namstring = bytestr # <<<<<<<<<<<<<< * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _supportedtypes: */ __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_3; /* "netCDF4/_netCDF4.pyx":4725 * bytestr = _strencode(dtype_name) * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. # <<<<<<<<<<<<<< * if dt.str[1:] in _supportedtypes: * # find netCDF primitive data type corresponding to */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_dt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_dt); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4726 * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _supportedtypes: # <<<<<<<<<<<<<< * # find netCDF primitive data type corresponding to * # specified numpy data type. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__95, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_supportedtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_2 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":4729 * # find netCDF primitive data type corresponding to * # specified numpy data type. * xtype_tmp = _nptonctype[dt.str[1:]] # <<<<<<<<<<<<<< * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype); * if ierr != NC_NOERR: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nptonctype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__96, 1, 0, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_t_6); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyInt_As_nc_type(__pyx_t_5); if (unlikely((__pyx_t_8 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_xtype_tmp = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4730 * # specified numpy data type. * xtype_tmp = _nptonctype[dt.str[1:]] * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype); # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ierr = nc_def_vlen(__pyx_t_9, __pyx_v_namstring, __pyx_v_xtype_tmp, (&__pyx_v_xtype)); /* "netCDF4/_netCDF4.pyx":4731 * xtype_tmp = _nptonctype[dt.str[1:]] * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype); * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":4732 * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype); * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * raise KeyError("unsupported datatype specified for VLEN") */ __pyx_t_3 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, strlen(__pyx_t_3), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4731 * xtype_tmp = _nptonctype[dt.str[1:]] * ierr = nc_def_vlen(grp._grpid, namstring, xtype_tmp, &xtype); * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ } /* "netCDF4/_netCDF4.pyx":4726 * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _supportedtypes: # <<<<<<<<<<<<<< * # find netCDF primitive data type corresponding to * # specified numpy data type. */ goto __pyx_L4; } /* "netCDF4/_netCDF4.pyx":4734 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * raise KeyError("unsupported datatype specified for VLEN") # <<<<<<<<<<<<<< * return xtype, dt * */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L4:; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4735 * else: * raise KeyError("unsupported datatype specified for VLEN") * return xtype, dt # <<<<<<<<<<<<<< * * cdef _read_vlen(group, nc_type xtype, endian=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_dt); __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4711 * (self.name, self.dtype) * * cdef _def_vlen(grp, object dt, object dtype_name): # <<<<<<<<<<<<<< * # private function used to construct a netcdf VLEN data type * # from a numpy dtype object or python str object by VLType.__init__. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4._def_vlen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4737 * return xtype, dt * * cdef _read_vlen(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a VLEN data type id from an existing file, * # construct a corresponding numpy dtype instance, */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_vlen(PyObject *__pyx_v_group, nc_type __pyx_v_xtype, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_vlen *__pyx_optional_args) { PyObject *__pyx_v_endian = ((PyObject *)Py_None); int __pyx_v_ierr; int __pyx_v__grpid; size_t __pyx_v_vlsize; nc_type __pyx_v_base_xtype; char __pyx_v_vl_namstring[(NC_MAX_NAME + 1)]; PyObject *__pyx_v_dt = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_datatype = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_vlen", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_endian = __pyx_optional_args->endian; } } /* "netCDF4/_netCDF4.pyx":4746 * cdef nc_type base_xtype * cdef char vl_namstring[NC_MAX_NAME+1] * _grpid = group._grpid # <<<<<<<<<<<<<< * if xtype == NC_STRING: * dt = str */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4747 * cdef char vl_namstring[NC_MAX_NAME+1] * _grpid = group._grpid * if xtype == NC_STRING: # <<<<<<<<<<<<<< * dt = str * name = None */ __pyx_t_3 = ((__pyx_v_xtype == NC_STRING) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4748 * _grpid = group._grpid * if xtype == NC_STRING: * dt = str # <<<<<<<<<<<<<< * name = None * else: */ __Pyx_INCREF(((PyObject *)(&PyString_Type))); __pyx_v_dt = ((PyObject *)(&PyString_Type)); /* "netCDF4/_netCDF4.pyx":4749 * if xtype == NC_STRING: * dt = str * name = None # <<<<<<<<<<<<<< * else: * with nogil: */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "netCDF4/_netCDF4.pyx":4747 * cdef char vl_namstring[NC_MAX_NAME+1] * _grpid = group._grpid * if xtype == NC_STRING: # <<<<<<<<<<<<<< * dt = str * name = None */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4751 * name = None * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) * if ierr != NC_NOERR: */ /*else*/ { { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4752 * else: * with nogil: * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_v_ierr = nc_inq_vlen(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_vl_namstring, (&__pyx_v_vlsize), (&__pyx_v_base_xtype)); } /* "netCDF4/_netCDF4.pyx":4751 * name = None * else: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) * if ierr != NC_NOERR: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L6; } __pyx_L6:; } } /* "netCDF4/_netCDF4.pyx":4753 * with nogil: * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4754 * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = vl_namstring.decode(default_encoding,unicode_error) * try: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4753 * with nogil: * ierr = nc_inq_vlen(_grpid, xtype, vl_namstring, &vlsize, &base_xtype) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":4755 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * try: * datatype = _nctonptype[base_xtype] */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_vl_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4756 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4757 * name = vl_namstring.decode(default_encoding,unicode_error) * try: * datatype = _nctonptype[base_xtype] # <<<<<<<<<<<<<< * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4757; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_base_xtype, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4757; __pyx_clineno = __LINE__; goto __pyx_L8_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_datatype = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4758 * try: * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype # <<<<<<<<<<<<<< * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: */ __pyx_t_3 = (__pyx_v_endian != Py_None); __pyx_t_14 = (__pyx_t_3 != 0); if (__pyx_t_14) { __pyx_t_6 = PyNumber_Add(__pyx_v_endian, __pyx_v_datatype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4758; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6); __pyx_t_6 = 0; } /* "netCDF4/_netCDF4.pyx":4759 * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type # <<<<<<<<<<<<<< * except KeyError: * raise KeyError("unsupported component type for VLEN") */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4759; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4759; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_1) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_datatype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4759; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4759; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_datatype); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4759; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_dt = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4756 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_try_end; __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4760 * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: # <<<<<<<<<<<<<< * raise KeyError("unsupported component type for VLEN") * return VLType(group, dt, name, typeid=xtype) */ __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_2) { __Pyx_AddTraceback("netCDF4._netCDF4._read_vlen", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4760; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":4761 * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: * raise KeyError("unsupported component type for VLEN") # <<<<<<<<<<<<<< * return VLType(group, dt, name, typeid=xtype) * */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4761; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4761; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;} } goto __pyx_L10_except_error; __pyx_L10_except_error:; /* "netCDF4/_netCDF4.pyx":4756 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = vl_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L15_try_end:; } } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4762 * except KeyError: * raise KeyError("unsupported component type for VLEN") * return VLType(group, dt, name, typeid=xtype) # <<<<<<<<<<<<<< * * # Enum datatype support. */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_dt); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_name); __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_typeid, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_VLType), __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4737 * return xtype, dt * * cdef _read_vlen(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a VLEN data type id from an existing file, * # construct a corresponding numpy dtype instance, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._read_vlen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dt); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_datatype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4784 * __pdoc__['EnumType.enum_dict'] = \ * """A python dictionary describing the enum fields and values.""" * def __init__(self, grp, object dt, object dtype_name, object enum_dict, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(group, datatype, datatype_name, enum_dict)`** */ /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8EnumType___init__[] = "\n **`__init__(group, datatype, datatype_name, enum_dict)`**\n\n EnumType constructor.\n\n **`group`**: `netCDF4.Group` instance to associate with the VLEN datatype.\n\n **`datatype`**: An numpy integer dtype object describing the base type\n for the Enum.\n\n **`datatype_name`**: a Python string containing a description of the\n Enum data type.\n\n **`enum_dict`**: a Python dictionary containing the Enum field/value\n pairs.\n\n ***`Note`***: `netCDF4.EnumType` instances should be created using the\n `netCDF4.Dataset.createEnumType`\n method of a `netCDF4.Dataset` or `netCDF4.Group` instance, not using this class directly.\n "; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_7netCDF4_8_netCDF4_8EnumType___init__; #endif static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grp = 0; PyObject *__pyx_v_dt = 0; PyObject *__pyx_v_dtype_name = 0; PyObject *__pyx_v_enum_dict = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_grp,&__pyx_n_s_dt,&__pyx_n_s_dtype_name,&__pyx_n_s_enum_dict,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_grp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4784; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4784; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_enum_dict)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4784; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4784; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_grp = values[0]; __pyx_v_dt = values[1]; __pyx_v_dtype_name = values[2]; __pyx_v_enum_dict = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4784; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("netCDF4._netCDF4.EnumType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType___init__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self), __pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name, __pyx_v_enum_dict, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType___init__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_enum_dict, PyObject *__pyx_v_kwargs) { nc_type __pyx_v_xtype; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; nc_type __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); __Pyx_INCREF(__pyx_v_dt); /* "netCDF4/_netCDF4.pyx":4806 * """ * cdef nc_type xtype * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_typeid, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4807 * cdef nc_type xtype * if 'typeid' in kwargs: * xtype = kwargs['typeid'] # <<<<<<<<<<<<<< * else: * xtype, dt = _def_enum(grp, dt, dtype_name, enum_dict) */ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_typeid); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_nc_type(__pyx_t_3); if (unlikely((__pyx_t_4 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_xtype = __pyx_t_4; /* "netCDF4/_netCDF4.pyx":4806 * """ * cdef nc_type xtype * if 'typeid' in kwargs: # <<<<<<<<<<<<<< * xtype = kwargs['typeid'] * else: */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4809 * xtype = kwargs['typeid'] * else: * xtype, dt = _def_enum(grp, dt, dtype_name, enum_dict) # <<<<<<<<<<<<<< * self._nc_type = xtype * self.dtype = dt */ /*else*/ { __pyx_t_3 = __pyx_f_7netCDF4_8_netCDF4__def_enum(__pyx_v_grp, __pyx_v_dt, __pyx_v_dtype_name, __pyx_v_enum_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } __pyx_t_4 = __Pyx_PyInt_As_nc_type(__pyx_t_5); if (unlikely((__pyx_t_4 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_xtype = __pyx_t_4; __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4810 * else: * xtype, dt = _def_enum(grp, dt, dtype_name, enum_dict) * self._nc_type = xtype # <<<<<<<<<<<<<< * self.dtype = dt * self.name = dtype_name */ __pyx_v_self->_nc_type = __pyx_v_xtype; /* "netCDF4/_netCDF4.pyx":4811 * xtype, dt = _def_enum(grp, dt, dtype_name, enum_dict) * self._nc_type = xtype * self.dtype = dt # <<<<<<<<<<<<<< * self.name = dtype_name * self.enum_dict = enum_dict */ __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_dt; /* "netCDF4/_netCDF4.pyx":4812 * self._nc_type = xtype * self.dtype = dt * self.name = dtype_name # <<<<<<<<<<<<<< * self.enum_dict = enum_dict * */ __Pyx_INCREF(__pyx_v_dtype_name); __Pyx_GIVEREF(__pyx_v_dtype_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_dtype_name; /* "netCDF4/_netCDF4.pyx":4813 * self.dtype = dt * self.name = dtype_name * self.enum_dict = enum_dict # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_INCREF(__pyx_v_enum_dict); __Pyx_GIVEREF(__pyx_v_enum_dict); __Pyx_GOTREF(__pyx_v_self->enum_dict); __Pyx_DECREF(__pyx_v_self->enum_dict); __pyx_v_self->enum_dict = __pyx_v_enum_dict; /* "netCDF4/_netCDF4.pyx":4784 * __pdoc__['EnumType.enum_dict'] = \ * """A python dictionary describing the enum fields and values.""" * def __init__(self, grp, object dt, object dtype_name, object enum_dict, **kwargs): # <<<<<<<<<<<<<< * """ * **`__init__(group, datatype, datatype_name, enum_dict)`** */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("netCDF4._netCDF4.EnumType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dt); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4815 * self.enum_dict = enum_dict * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_3__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_3__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_2__repr__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_2__repr__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "netCDF4/_netCDF4.pyx":4816 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_python3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4817 * def __repr__(self): * if python3: * return self.__unicode__() # <<<<<<<<<<<<<< * else: * return unicode(self).encode(default_encoding) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_4) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4816 * * def __repr__(self): * if python3: # <<<<<<<<<<<<<< * return self.__unicode__() * else: */ } /* "netCDF4/_netCDF4.pyx":4819 * return self.__unicode__() * else: * return unicode(self).encode(default_encoding) # <<<<<<<<<<<<<< * * def __unicode__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4815 * self.enum_dict = enum_dict * * def __repr__(self): # <<<<<<<<<<<<<< * if python3: * return self.__unicode__() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("netCDF4._netCDF4.EnumType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4821 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * return repr(type(self))+\ * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_5__unicode__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__unicode__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4__unicode__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_4__unicode__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); /* "netCDF4/_netCDF4.pyx":4822 * * def __unicode__(self): * return repr(type(self))+\ # <<<<<<<<<<<<<< * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ * (self.name, self.dtype, self.enum_dict) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_Repr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); /* "netCDF4/_netCDF4.pyx":4824 * return repr(type(self))+\ * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ * (self.name, self.dtype, self.enum_dict) # <<<<<<<<<<<<<< * * cdef _def_enum(grp, object dt, object dtype_name, object enum_dict): */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->name); __Pyx_GIVEREF(__pyx_v_self->name); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name); __Pyx_INCREF(__pyx_v_self->dtype); __Pyx_GIVEREF(__pyx_v_self->dtype); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->dtype); __Pyx_INCREF(__pyx_v_self->enum_dict); __Pyx_GIVEREF(__pyx_v_self->enum_dict); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->enum_dict); /* "netCDF4/_netCDF4.pyx":4823 * def __unicode__(self): * return repr(type(self))+\ * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ # <<<<<<<<<<<<<< * (self.name, self.dtype, self.enum_dict) * */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_name_s_numpy_dtype_s_fields_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4822 * * def __unicode__(self): * return repr(type(self))+\ # <<<<<<<<<<<<<< * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ * (self.name, self.dtype, self.enum_dict) */ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4821 * return unicode(self).encode(default_encoding) * * def __unicode__(self): # <<<<<<<<<<<<<< * return repr(type(self))+\ * ": name = '%s', numpy dtype = %s, fields/values =%s\n" %\ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("netCDF4._netCDF4.EnumType.__unicode__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4776 * the user. * """ * cdef public nc_type _nc_type # <<<<<<<<<<<<<< * cdef public dtype, name, enum_dict * __pdoc__['EnumType.name'] = \ */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_nc_type(__pyx_v_self->_nc_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("netCDF4._netCDF4.EnumType._nc_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_8_nc_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_8_nc_type_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations nc_type __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); __pyx_t_1 = __Pyx_PyInt_As_nc_type(__pyx_v_value); if (unlikely((__pyx_t_1 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->_nc_type = __pyx_t_1; /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("netCDF4._netCDF4.EnumType._nc_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4777 * """ * cdef public nc_type _nc_type * cdef public dtype, name, enum_dict # <<<<<<<<<<<<<< * __pdoc__['EnumType.name'] = \ * """String name.""" */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->dtype); __pyx_r = __pyx_v_self->dtype; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_5dtype_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_5dtype_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->dtype); __Pyx_DECREF(__pyx_v_self->dtype); __pyx_v_self->dtype = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_4name_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_4name_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict___get__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict___get__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->enum_dict); __pyx_r = __pyx_v_self->enum_dict; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_2__set__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_2__set__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_GOTREF(__pyx_v_self->enum_dict); __Pyx_DECREF(__pyx_v_self->enum_dict); __pyx_v_self->enum_dict = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7netCDF4_8_netCDF4_8EnumType_9enum_dict_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_4__del__(((struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7netCDF4_8_netCDF4_8EnumType_9enum_dict_4__del__(struct __pyx_obj_7netCDF4_8_netCDF4_EnumType *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->enum_dict); __Pyx_DECREF(__pyx_v_self->enum_dict); __pyx_v_self->enum_dict = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4826 * (self.name, self.dtype, self.enum_dict) * * cdef _def_enum(grp, object dt, object dtype_name, object enum_dict): # <<<<<<<<<<<<<< * # private function used to construct a netCDF Enum data type * # from a numpy dtype object or python str object by EnumType.__init__. */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__def_enum(PyObject *__pyx_v_grp, PyObject *__pyx_v_dt, PyObject *__pyx_v_dtype_name, PyObject *__pyx_v_enum_dict) { nc_type __pyx_v_xtype; nc_type __pyx_v_xtype_tmp; int __pyx_v_ierr; int __pyx_v_val; char *__pyx_v_namstring; PyObject *__pyx_v_bytestr = NULL; PyObject *__pyx_v_msg = NULL; PyObject *__pyx_v_field = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; nc_type __pyx_t_8; int __pyx_t_9; Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_def_enum", 0); __Pyx_INCREF(__pyx_v_dt); /* "netCDF4/_netCDF4.pyx":4832 * cdef int ierr, val * cdef char *namstring * bytestr = _strencode(dtype_name) # <<<<<<<<<<<<<< * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. */ __pyx_t_1 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_dtype_name, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytestr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4833 * cdef char *namstring * bytestr = _strencode(dtype_name) * namstring = bytestr # <<<<<<<<<<<<<< * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _intnptonctype.keys(): */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4834 * bytestr = _strencode(dtype_name) * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. # <<<<<<<<<<<<<< * if dt.str[1:] in _intnptonctype.keys(): * # find netCDF primitive data type corresponding to */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_dt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dt); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4835 * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _intnptonctype.keys(): # <<<<<<<<<<<<<< * # find netCDF primitive data type corresponding to * # specified numpy data type. */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__99, 1, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_intnptonctype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":4838 * # find netCDF primitive data type corresponding to * # specified numpy data type. * xtype_tmp = _intnptonctype[dt.str[1:]] # <<<<<<<<<<<<<< * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype); * if ierr != NC_NOERR: */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_intnptonctype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__100, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyInt_As_nc_type(__pyx_t_4); if (unlikely((__pyx_t_8 == (nc_type)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_xtype_tmp = __pyx_t_8; /* "netCDF4/_netCDF4.pyx":4839 * # specified numpy data type. * xtype_tmp = _intnptonctype[dt.str[1:]] * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype); # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ierr = nc_def_enum(__pyx_t_9, __pyx_v_xtype_tmp, __pyx_v_namstring, (&__pyx_v_xtype)); /* "netCDF4/_netCDF4.pyx":4840 * xtype_tmp = _intnptonctype[dt.str[1:]] * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype); * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":4841 * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype); * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * else: * msg="unsupported datatype specified for Enum (must be integer)" */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4840 * xtype_tmp = _intnptonctype[dt.str[1:]] * ierr = nc_def_enum(grp._grpid, xtype_tmp, namstring, &xtype); * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: */ } /* "netCDF4/_netCDF4.pyx":4835 * namstring = bytestr * dt = numpy.dtype(dt) # convert to numpy datatype. * if dt.str[1:] in _intnptonctype.keys(): # <<<<<<<<<<<<<< * # find netCDF primitive data type corresponding to * # specified numpy data type. */ goto __pyx_L3; } /* "netCDF4/_netCDF4.pyx":4843 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * else: * msg="unsupported datatype specified for Enum (must be integer)" # <<<<<<<<<<<<<< * raise KeyError(msg) * # insert named members into enum type. */ /*else*/ { __Pyx_INCREF(__pyx_kp_s_unsupported_datatype_specified_f_2); __pyx_v_msg = __pyx_kp_s_unsupported_datatype_specified_f_2; /* "netCDF4/_netCDF4.pyx":4844 * else: * msg="unsupported datatype specified for Enum (must be integer)" * raise KeyError(msg) # <<<<<<<<<<<<<< * # insert named members into enum type. * for field in enum_dict: */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_msg); __Pyx_GIVEREF(__pyx_v_msg); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_msg); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; /* "netCDF4/_netCDF4.pyx":4846 * raise KeyError(msg) * # insert named members into enum type. * for field in enum_dict: # <<<<<<<<<<<<<< * value = enum_dict[field] * bytestr = _strencode(field) */ if (likely(PyList_CheckExact(__pyx_v_enum_dict)) || PyTuple_CheckExact(__pyx_v_enum_dict)) { __pyx_t_3 = __pyx_v_enum_dict; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_enum_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } for (;;) { if (likely(!__pyx_t_11)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_11(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4847 * # insert named members into enum type. * for field in enum_dict: * value = enum_dict[field] # <<<<<<<<<<<<<< * bytestr = _strencode(field) * namstring = bytestr */ __pyx_t_4 = PyObject_GetItem(__pyx_v_enum_dict, __pyx_v_field); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4848 * for field in enum_dict: * value = enum_dict[field] * bytestr = _strencode(field) # <<<<<<<<<<<<<< * namstring = bytestr * val = value */ __pyx_t_4 = __pyx_f_7netCDF4_8_netCDF4__strencode(__pyx_v_field, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_bytestr, __pyx_t_4); __pyx_t_4 = 0; /* "netCDF4/_netCDF4.pyx":4849 * value = enum_dict[field] * bytestr = _strencode(field) * namstring = bytestr # <<<<<<<<<<<<<< * val = value * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_namstring = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4850 * bytestr = _strencode(field) * namstring = bytestr * val = value # <<<<<<<<<<<<<< * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) * if ierr != NC_NOERR: */ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_val = __pyx_t_9; /* "netCDF4/_netCDF4.pyx":4851 * namstring = bytestr * val = value * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) # <<<<<<<<<<<<<< * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grp, __pyx_n_s_grpid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ierr = nc_insert_enum(__pyx_t_9, __pyx_v_xtype, __pyx_v_namstring, (&__pyx_v_val)); /* "netCDF4/_netCDF4.pyx":4852 * val = value * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return xtype, dt */ __pyx_t_7 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_7) { /* "netCDF4/_netCDF4.pyx":4853 * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * return xtype, dt * */ __pyx_t_2 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_2, 0, strlen(__pyx_t_2), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4852 * val = value * ierr = nc_insert_enum(grp._grpid, xtype, namstring, &val) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return xtype, dt */ } /* "netCDF4/_netCDF4.pyx":4846 * raise KeyError(msg) * # insert named members into enum type. * for field in enum_dict: # <<<<<<<<<<<<<< * value = enum_dict[field] * bytestr = _strencode(field) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4854 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * return xtype, dt # <<<<<<<<<<<<<< * * cdef _read_enum(group, nc_type xtype, endian=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_dt); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4826 * (self.name, self.dtype, self.enum_dict) * * cdef _def_enum(grp, object dt, object dtype_name, object enum_dict): # <<<<<<<<<<<<<< * # private function used to construct a netCDF Enum data type * # from a numpy dtype object or python str object by EnumType.__init__. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("netCDF4._netCDF4._def_enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_bytestr); __Pyx_XDECREF(__pyx_v_msg); __Pyx_XDECREF(__pyx_v_field); __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4856 * return xtype, dt * * cdef _read_enum(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a Enum data type id from an existing file, * # construct a corresponding numpy dtype instance, */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__read_enum(PyObject *__pyx_v_group, nc_type __pyx_v_xtype, struct __pyx_opt_args_7netCDF4_8_netCDF4__read_enum *__pyx_optional_args) { PyObject *__pyx_v_endian = ((PyObject *)Py_None); int __pyx_v_ierr; int __pyx_v__grpid; int __pyx_v_nmem; char __pyx_v_enum_val; nc_type __pyx_v_base_xtype; char __pyx_v_enum_namstring[(NC_MAX_NAME + 1)]; size_t __pyx_v_nmembers; PyObject *__pyx_v_name = NULL; PyObject *__pyx_v_datatype = NULL; PyObject *__pyx_v_dt = NULL; PyObject *__pyx_v_enum_dict = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; size_t __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_read_enum", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_endian = __pyx_optional_args->endian; } } /* "netCDF4/_netCDF4.pyx":4866 * cdef char enum_namstring[NC_MAX_NAME+1] * cdef size_t nmembers * _grpid = group._grpid # <<<<<<<<<<<<<< * # get name, datatype, and number of members. * with nogil: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_group, __pyx_n_s_grpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v__grpid = __pyx_t_2; /* "netCDF4/_netCDF4.pyx":4868 * _grpid = group._grpid * # get name, datatype, and number of members. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\ * &nmembers) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4869 * # get name, datatype, and number of members. * with nogil: * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\ # <<<<<<<<<<<<<< * &nmembers) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_inq_enum(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_enum_namstring, (&__pyx_v_base_xtype), NULL, (&__pyx_v_nmembers)); } /* "netCDF4/_netCDF4.pyx":4868 * _grpid = group._grpid * # get name, datatype, and number of members. * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\ * &nmembers) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "netCDF4/_netCDF4.pyx":4871 * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\ * &nmembers) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) */ __pyx_t_3 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4872 * &nmembers) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = enum_namstring.decode(default_encoding,unicode_error) * try: */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4871 * ierr = nc_inq_enum(_grpid, xtype, enum_namstring, &base_xtype, NULL,\ * &nmembers) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":4873 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * try: * datatype = _nctonptype[base_xtype] */ __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_enum_namstring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4874 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ { __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4875 * name = enum_namstring.decode(default_encoding,unicode_error) * try: * datatype = _nctonptype[base_xtype] # <<<<<<<<<<<<<< * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nctonptype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_base_xtype, nc_type, 1, __Pyx_PyInt_From_nc_type, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4875; __pyx_clineno = __LINE__; goto __pyx_L7_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_datatype = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4876 * try: * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype # <<<<<<<<<<<<<< * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: */ __pyx_t_3 = (__pyx_v_endian != Py_None); __pyx_t_14 = (__pyx_t_3 != 0); if (__pyx_t_14) { __pyx_t_6 = PyNumber_Add(__pyx_v_endian, __pyx_v_datatype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4876; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_datatype, __pyx_t_6); __pyx_t_6 = 0; } /* "netCDF4/_netCDF4.pyx":4877 * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type # <<<<<<<<<<<<<< * except KeyError: * raise KeyError("unsupported component type for VLEN") */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4877; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4877; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); } } if (!__pyx_t_1) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_datatype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4877; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4877; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_datatype); __Pyx_GIVEREF(__pyx_v_datatype); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_datatype); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4877; __pyx_clineno = __LINE__; goto __pyx_L7_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_dt = __pyx_t_6; __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4874 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ } __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "netCDF4/_netCDF4.pyx":4878 * if endian is not None: datatype = endian + datatype * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: # <<<<<<<<<<<<<< * raise KeyError("unsupported component type for VLEN") * # loop over members, build dict. */ __pyx_t_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_2) { __Pyx_AddTraceback("netCDF4._netCDF4._read_enum", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_10, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4878; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_7); /* "netCDF4/_netCDF4.pyx":4879 * dt = numpy.dtype(datatype) # see if it is a primitive type * except KeyError: * raise KeyError("unsupported component type for VLEN") # <<<<<<<<<<<<<< * # loop over members, build dict. * enum_dict = {} */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4879; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4879; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} } goto __pyx_L9_except_error; __pyx_L9_except_error:; /* "netCDF4/_netCDF4.pyx":4874 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) * try: # <<<<<<<<<<<<<< * datatype = _nctonptype[base_xtype] * if endian is not None: datatype = endian + datatype */ __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L14_try_end:; } /* "netCDF4/_netCDF4.pyx":4881 * raise KeyError("unsupported component type for VLEN") * # loop over members, build dict. * enum_dict = {} # <<<<<<<<<<<<<< * for nmem from 0 <= nmem < nmembers: * with nogil: */ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_v_enum_dict = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4882 * # loop over members, build dict. * enum_dict = {} * for nmem from 0 <= nmem < nmembers: # <<<<<<<<<<<<<< * with nogil: * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ */ __pyx_t_15 = __pyx_v_nmembers; for (__pyx_v_nmem = 0; __pyx_v_nmem < __pyx_t_15; __pyx_v_nmem++) { /* "netCDF4/_netCDF4.pyx":4883 * enum_dict = {} * for nmem from 0 <= nmem < nmembers: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ * enum_namstring, &enum_val) */ { #ifdef WITH_THREAD PyThreadState *_save; Py_UNBLOCK_THREADS #endif /*try:*/ { /* "netCDF4/_netCDF4.pyx":4884 * for nmem from 0 <= nmem < nmembers: * with nogil: * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ # <<<<<<<<<<<<<< * enum_namstring, &enum_val) * if ierr != NC_NOERR: */ __pyx_v_ierr = nc_inq_enum_member(__pyx_v__grpid, __pyx_v_xtype, __pyx_v_nmem, __pyx_v_enum_namstring, (&__pyx_v_enum_val)); } /* "netCDF4/_netCDF4.pyx":4883 * enum_dict = {} * for nmem from 0 <= nmem < nmembers: * with nogil: # <<<<<<<<<<<<<< * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ * enum_namstring, &enum_val) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD Py_BLOCK_THREADS #endif goto __pyx_L24; } __pyx_L24:; } } /* "netCDF4/_netCDF4.pyx":4886 * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ * enum_namstring, &enum_val) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) */ __pyx_t_14 = ((__pyx_v_ierr != NC_NOERR) != 0); if (__pyx_t_14) { /* "netCDF4/_netCDF4.pyx":4887 * enum_namstring, &enum_val) * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) # <<<<<<<<<<<<<< * name = enum_namstring.decode(default_encoding,unicode_error) * enum_dict[name] = int(enum_val) */ __pyx_t_4 = ((char *)nc_strerror(__pyx_v_ierr)); __pyx_t_7 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4887; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4886 * ierr = nc_inq_enum_member(_grpid, xtype, nmem, \ * enum_namstring, &enum_val) * if ierr != NC_NOERR: # <<<<<<<<<<<<<< * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) */ } /* "netCDF4/_netCDF4.pyx":4888 * if ierr != NC_NOERR: * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) # <<<<<<<<<<<<<< * enum_dict[name] = int(enum_val) * return EnumType(group, dt, name, enum_dict, typeid=xtype) */ __pyx_t_10 = __Pyx_PyObject_FromString(__pyx_v_enum_namstring); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_9 = 0; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_1); __pyx_t_10 = 0; __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4889 * raise RuntimeError((nc_strerror(ierr)).decode('ascii')) * name = enum_namstring.decode(default_encoding,unicode_error) * enum_dict[name] = int(enum_val) # <<<<<<<<<<<<<< * return EnumType(group, dt, name, enum_dict, typeid=xtype) * */ __pyx_t_7 = __Pyx_PyInt_From_char(__pyx_v_enum_val); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(PyDict_SetItem(__pyx_v_enum_dict, __pyx_v_name, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "netCDF4/_netCDF4.pyx":4890 * name = enum_namstring.decode(default_encoding,unicode_error) * enum_dict[name] = int(enum_val) * return EnumType(group, dt, name, enum_dict, typeid=xtype) # <<<<<<<<<<<<<< * * cdef _strencode(pystr,encoding=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_group); __Pyx_GIVEREF(__pyx_v_group); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_group); __Pyx_INCREF(__pyx_v_dt); __Pyx_GIVEREF(__pyx_v_dt); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_dt); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_name); __Pyx_INCREF(__pyx_v_enum_dict); __Pyx_GIVEREF(__pyx_v_enum_dict); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_enum_dict); __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_nc_type(__pyx_v_xtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_typeid, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7netCDF4_8_netCDF4_EnumType), __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4856 * return xtype, dt * * cdef _read_enum(group, nc_type xtype, endian=None): # <<<<<<<<<<<<<< * # read a Enum data type id from an existing file, * # construct a corresponding numpy dtype instance, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._read_enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_datatype); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XDECREF(__pyx_v_enum_dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4892 * return EnumType(group, dt, name, enum_dict, typeid=xtype) * * cdef _strencode(pystr,encoding=None): # <<<<<<<<<<<<<< * # encode a string into bytes. If already bytes, do nothing. * # uses default_encoding module variable for default encoding. */ static PyObject *__pyx_f_7netCDF4_8_netCDF4__strencode(PyObject *__pyx_v_pystr, struct __pyx_opt_args_7netCDF4_8_netCDF4__strencode *__pyx_optional_args) { PyObject *__pyx_v_encoding = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_strencode", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_encoding = __pyx_optional_args->encoding; } } __Pyx_INCREF(__pyx_v_encoding); /* "netCDF4/_netCDF4.pyx":4895 * # encode a string into bytes. If already bytes, do nothing. * # uses default_encoding module variable for default encoding. * if encoding is None: # <<<<<<<<<<<<<< * encoding = default_encoding * try: */ __pyx_t_1 = (__pyx_v_encoding == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "netCDF4/_netCDF4.pyx":4896 * # uses default_encoding module variable for default encoding. * if encoding is None: * encoding = default_encoding # <<<<<<<<<<<<<< * try: * return pystr.encode(encoding) */ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4895 * # encode a string into bytes. If already bytes, do nothing. * # uses default_encoding module variable for default encoding. * if encoding is None: # <<<<<<<<<<<<<< * encoding = default_encoding * try: */ } /* "netCDF4/_netCDF4.pyx":4897 * if encoding is None: * encoding = default_encoding * try: # <<<<<<<<<<<<<< * return pystr.encode(encoding) * except (AttributeError, UnicodeDecodeError): */ { __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "netCDF4/_netCDF4.pyx":4898 * encoding = default_encoding * try: * return pystr.encode(encoding) # <<<<<<<<<<<<<< * except (AttributeError, UnicodeDecodeError): * return pystr # already bytes or unicode? */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pystr, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_INCREF(__pyx_v_encoding); __Pyx_GIVEREF(__pyx_v_encoding); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_encoding); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4898; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L8_try_return; /* "netCDF4/_netCDF4.pyx":4897 * if encoding is None: * encoding = default_encoding * try: # <<<<<<<<<<<<<< * return pystr.encode(encoding) * except (AttributeError, UnicodeDecodeError): */ } __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "netCDF4/_netCDF4.pyx":4899 * try: * return pystr.encode(encoding) * except (AttributeError, UnicodeDecodeError): # <<<<<<<<<<<<<< * return pystr # already bytes or unicode? * */ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_10) { __Pyx_AddTraceback("netCDF4._netCDF4._strencode", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4899; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "netCDF4/_netCDF4.pyx":4900 * return pystr.encode(encoding) * except (AttributeError, UnicodeDecodeError): * return pystr # already bytes or unicode? # <<<<<<<<<<<<<< * * #---------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pystr); __pyx_r = __pyx_v_pystr; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_except_return; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "netCDF4/_netCDF4.pyx":4897 * if encoding is None: * encoding = default_encoding * try: # <<<<<<<<<<<<<< * return pystr.encode(encoding) * except (AttributeError, UnicodeDecodeError): */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L8_try_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L7_except_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; } /* "netCDF4/_netCDF4.pyx":4892 * return EnumType(group, dt, name, enum_dict, typeid=xtype) * * cdef _strencode(pystr,encoding=None): # <<<<<<<<<<<<<< * # encode a string into bytes. If already bytes, do nothing. * # uses default_encoding module variable for default encoding. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("netCDF4._netCDF4._strencode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_encoding); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4912 * gregorian = datetime(1582,10,15) * * def _dateparse(timestr): # <<<<<<<<<<<<<< * """parse a string of the form time-units since yyyy-mm-dd hh:mm:ss, * return a datetime instance""" */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7_dateparse(PyObject *__pyx_self, PyObject *__pyx_v_timestr); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_6_dateparse[] = "parse a string of the form time-units since yyyy-mm-dd hh:mm:ss,\n return a datetime instance"; static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_7_dateparse = {"_dateparse", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_7_dateparse, METH_O, __pyx_doc_7netCDF4_8_netCDF4_6_dateparse}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_7_dateparse(PyObject *__pyx_self, PyObject *__pyx_v_timestr) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_dateparse (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_6_dateparse(__pyx_self, ((PyObject *)__pyx_v_timestr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_6_dateparse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_timestr) { PyObject *__pyx_v_timestr_split = NULL; CYTHON_UNUSED PyObject *__pyx_v_units = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_v_isostring = NULL; PyObject *__pyx_v_year = NULL; PyObject *__pyx_v_month = NULL; PyObject *__pyx_v_day = NULL; PyObject *__pyx_v_hour = NULL; PyObject *__pyx_v_minute = NULL; PyObject *__pyx_v_second = NULL; PyObject *__pyx_v_utc_offset = NULL; PyObject *__pyx_v_basedate = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); Py_ssize_t __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_dateparse", 0); /* "netCDF4/_netCDF4.pyx":4917 * # same as version in netcdftime, but returns a timezone naive * # python datetime instance with the utc_offset included. * timestr_split = timestr.split() # <<<<<<<<<<<<<< * units = timestr_split[0].lower() * if timestr_split[1].lower() != 'since': */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_timestr, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_timestr_split = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4918 * # python datetime instance with the utc_offset included. * timestr_split = timestr.split() * units = timestr_split[0].lower() # <<<<<<<<<<<<<< * if timestr_split[1].lower() != 'since': * raise ValueError("no 'since' in unit_string") */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_timestr_split, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } if (__pyx_t_2) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_units = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4919 * timestr_split = timestr.split() * units = timestr_split[0].lower() * if timestr_split[1].lower() != 'since': # <<<<<<<<<<<<<< * raise ValueError("no 'since' in unit_string") * # parse the date string. */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_timestr_split, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_since, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":4920 * units = timestr_split[0].lower() * if timestr_split[1].lower() != 'since': * raise ValueError("no 'since' in unit_string") # <<<<<<<<<<<<<< * # parse the date string. * n = timestr.find('since')+6 */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4919 * timestr_split = timestr.split() * units = timestr_split[0].lower() * if timestr_split[1].lower() != 'since': # <<<<<<<<<<<<<< * raise ValueError("no 'since' in unit_string") * # parse the date string. */ } /* "netCDF4/_netCDF4.pyx":4922 * raise ValueError("no 'since' in unit_string") * # parse the date string. * n = timestr.find('since')+6 # <<<<<<<<<<<<<< * isostring = timestr[n:] * year, month, day, hour, minute, second, utc_offset =\ */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_timestr, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_6, 6, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4923 * # parse the date string. * n = timestr.find('since')+6 * isostring = timestr[n:] # <<<<<<<<<<<<<< * year, month, day, hour, minute, second, utc_offset =\ * _parse_date( isostring.strip() ) */ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_timestr, 0, 0, &__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_isostring = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4925 * isostring = timestr[n:] * year, month, day, hour, minute, second, utc_offset =\ * _parse_date( isostring.strip() ) # <<<<<<<<<<<<<< * if year >= MINYEAR: * basedate = datetime(year, month, day, hour, minute, second) */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_parse_date); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_isostring, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (!__pyx_t_5) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; #if CYTHON_COMPILING_IN_CPYTHON Py_ssize_t size = Py_SIZE(sequence); #else Py_ssize_t size = PySequence_Size(sequence); #endif if (unlikely(size != 7)) { if (size > 7) __Pyx_RaiseTooManyValuesError(7); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); __pyx_t_7 = PyList_GET_ITEM(sequence, 4); __pyx_t_8 = PyList_GET_ITEM(sequence, 5); __pyx_t_9 = PyList_GET_ITEM(sequence, 6); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[7] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_3,&__pyx_t_5,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; for (i=0; i < 7; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; PyObject** temps[7] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_3,&__pyx_t_5,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 7; index++) { PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L5_unpacking_done:; } /* "netCDF4/_netCDF4.pyx":4924 * n = timestr.find('since')+6 * isostring = timestr[n:] * year, month, day, hour, minute, second, utc_offset =\ # <<<<<<<<<<<<<< * _parse_date( isostring.strip() ) * if year >= MINYEAR: */ __pyx_v_year = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_month = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_day = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_hour = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_minute = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_second = __pyx_t_8; __pyx_t_8 = 0; __pyx_v_utc_offset = __pyx_t_9; __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":4926 * year, month, day, hour, minute, second, utc_offset =\ * _parse_date( isostring.strip() ) * if year >= MINYEAR: # <<<<<<<<<<<<<< * basedate = datetime(year, month, day, hour, minute, second) * # add utc_offset to basedate time instance (which is timezone naive) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MINYEAR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_RichCompare(__pyx_v_year, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":4927 * _parse_date( isostring.strip() ) * if year >= MINYEAR: * basedate = datetime(year, month, day, hour, minute, second) # <<<<<<<<<<<<<< * # add utc_offset to basedate time instance (which is timezone naive) * basedate += timedelta(days=utc_offset/1440.) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_12 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_12 = 1; } } __pyx_t_7 = PyTuple_New(6+__pyx_t_12); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_year); __Pyx_GIVEREF(__pyx_v_year); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_12, __pyx_v_year); __Pyx_INCREF(__pyx_v_month); __Pyx_GIVEREF(__pyx_v_month); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_12, __pyx_v_month); __Pyx_INCREF(__pyx_v_day); __Pyx_GIVEREF(__pyx_v_day); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_12, __pyx_v_day); __Pyx_INCREF(__pyx_v_hour); __Pyx_GIVEREF(__pyx_v_hour); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_12, __pyx_v_hour); __Pyx_INCREF(__pyx_v_minute); __Pyx_GIVEREF(__pyx_v_minute); PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_12, __pyx_v_minute); __Pyx_INCREF(__pyx_v_second); __Pyx_GIVEREF(__pyx_v_second); PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_12, __pyx_v_second); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_basedate = __pyx_t_9; __pyx_t_9 = 0; /* "netCDF4/_netCDF4.pyx":4929 * basedate = datetime(year, month, day, hour, minute, second) * # add utc_offset to basedate time instance (which is timezone naive) * basedate += timedelta(days=utc_offset/1440.) # <<<<<<<<<<<<<< * else: * if not utc_offset: */ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_timedelta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyFloat_DivideObjC(__pyx_v_utc_offset, __pyx_float_1440_, 1440., 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_days, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_basedate, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_basedate, __pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4926 * year, month, day, hour, minute, second, utc_offset =\ * _parse_date( isostring.strip() ) * if year >= MINYEAR: # <<<<<<<<<<<<<< * basedate = datetime(year, month, day, hour, minute, second) * # add utc_offset to basedate time instance (which is timezone naive) */ goto __pyx_L6; } /* "netCDF4/_netCDF4.pyx":4931 * basedate += timedelta(days=utc_offset/1440.) * else: * if not utc_offset: # <<<<<<<<<<<<<< * basedate = netcdftime.datetime(year, month, day, hour, minute, second) * else: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_utc_offset); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((!__pyx_t_4) != 0); if (__pyx_t_13) { /* "netCDF4/_netCDF4.pyx":4932 * else: * if not utc_offset: * basedate = netcdftime.datetime(year, month, day, hour, minute, second) # <<<<<<<<<<<<<< * else: * raise ValueError('cannot use utc_offset for reference years <= 0') */ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_netcdftime); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_datetime); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_12 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_12 = 1; } } __pyx_t_8 = PyTuple_New(6+__pyx_t_12); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_year); __Pyx_GIVEREF(__pyx_v_year); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_12, __pyx_v_year); __Pyx_INCREF(__pyx_v_month); __Pyx_GIVEREF(__pyx_v_month); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_12, __pyx_v_month); __Pyx_INCREF(__pyx_v_day); __Pyx_GIVEREF(__pyx_v_day); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_12, __pyx_v_day); __Pyx_INCREF(__pyx_v_hour); __Pyx_GIVEREF(__pyx_v_hour); PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_12, __pyx_v_hour); __Pyx_INCREF(__pyx_v_minute); __Pyx_GIVEREF(__pyx_v_minute); PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_12, __pyx_v_minute); __Pyx_INCREF(__pyx_v_second); __Pyx_GIVEREF(__pyx_v_second); PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_12, __pyx_v_second); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_basedate = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4931 * basedate += timedelta(days=utc_offset/1440.) * else: * if not utc_offset: # <<<<<<<<<<<<<< * basedate = netcdftime.datetime(year, month, day, hour, minute, second) * else: */ goto __pyx_L7; } /* "netCDF4/_netCDF4.pyx":4934 * basedate = netcdftime.datetime(year, month, day, hour, minute, second) * else: * raise ValueError('cannot use utc_offset for reference years <= 0') # <<<<<<<<<<<<<< * return basedate * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; } __pyx_L6:; /* "netCDF4/_netCDF4.pyx":4935 * else: * raise ValueError('cannot use utc_offset for reference years <= 0') * return basedate # <<<<<<<<<<<<<< * * def stringtoarr(string,NUMCHARS,dtype='S'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_basedate); __pyx_r = __pyx_v_basedate; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4912 * gregorian = datetime(1582,10,15) * * def _dateparse(timestr): # <<<<<<<<<<<<<< * """parse a string of the form time-units since yyyy-mm-dd hh:mm:ss, * return a datetime instance""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4._dateparse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_timestr_split); __Pyx_XDECREF(__pyx_v_units); __Pyx_XDECREF(__pyx_v_n); __Pyx_XDECREF(__pyx_v_isostring); __Pyx_XDECREF(__pyx_v_year); __Pyx_XDECREF(__pyx_v_month); __Pyx_XDECREF(__pyx_v_day); __Pyx_XDECREF(__pyx_v_hour); __Pyx_XDECREF(__pyx_v_minute); __Pyx_XDECREF(__pyx_v_second); __Pyx_XDECREF(__pyx_v_utc_offset); __Pyx_XDECREF(__pyx_v_basedate); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4937 * return basedate * * def stringtoarr(string,NUMCHARS,dtype='S'): # <<<<<<<<<<<<<< * """ * **`stringtoarr(a, NUMCHARS,dtype='S')`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9stringtoarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_8stringtoarr[] = "\n**`stringtoarr(a, NUMCHARS,dtype='S')`**\n\nconvert a string to a character array of length `NUMCHARS`\n\n**`a`**: Input python string.\n\n**`NUMCHARS`**: number of characters used to represent string\n(if len(a) < `NUMCHARS`, it will be padded on the right with blanks).\n\n**`dtype`**: type of numpy array to return. Default is `'S'`, which\nmeans an array of dtype `'S1'` will be returned. If dtype=`'U'`, a\nunicode array (dtype = `'U1'`) will be returned.\n\nreturns a rank 1 numpy character array of length NUMCHARS with datatype `'S1'`\n(default) or `'U1'` (if dtype=`'U'`)"; static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_9stringtoarr = {"stringtoarr", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_9stringtoarr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7netCDF4_8_netCDF4_8stringtoarr}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_9stringtoarr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_string = 0; PyObject *__pyx_v_NUMCHARS = 0; PyObject *__pyx_v_dtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stringtoarr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,&__pyx_n_s_NUMCHARS,&__pyx_n_s_dtype,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_n_s_S); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_NUMCHARS)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("stringtoarr", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stringtoarr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_string = values[0]; __pyx_v_NUMCHARS = values[1]; __pyx_v_dtype = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("stringtoarr", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4937; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("netCDF4._netCDF4.stringtoarr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_8stringtoarr(__pyx_self, __pyx_v_string, __pyx_v_NUMCHARS, __pyx_v_dtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_8stringtoarr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string, PyObject *__pyx_v_NUMCHARS, PyObject *__pyx_v_dtype) { PyObject *__pyx_v_arr = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Py_ssize_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stringtoarr", 0); /* "netCDF4/_netCDF4.pyx":4954 * returns a rank 1 numpy character array of length NUMCHARS with datatype `'S1'` * (default) or `'U1'` (if dtype=`'U'`)""" * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("dtype must string or unicode ('S' or 'U')") * arr = numpy.zeros(NUMCHARS,dtype+'1') */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_1 = __pyx_v_dtype; __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_S, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_U, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "netCDF4/_netCDF4.pyx":4955 * (default) or `'U1'` (if dtype=`'U'`)""" * if dtype not in ["S","U"]: * raise ValueError("dtype must string or unicode ('S' or 'U')") # <<<<<<<<<<<<<< * arr = numpy.zeros(NUMCHARS,dtype+'1') * arr[0:len(string)] = tuple(string) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4954 * returns a rank 1 numpy character array of length NUMCHARS with datatype `'S1'` * (default) or `'U1'` (if dtype=`'U'`)""" * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("dtype must string or unicode ('S' or 'U')") * arr = numpy.zeros(NUMCHARS,dtype+'1') */ } /* "netCDF4/_netCDF4.pyx":4956 * if dtype not in ["S","U"]: * raise ValueError("dtype must string or unicode ('S' or 'U')") * arr = numpy.zeros(NUMCHARS,dtype+'1') # <<<<<<<<<<<<<< * arr[0:len(string)] = tuple(string) * return arr */ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_v_dtype, __pyx_kp_s_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_NUMCHARS); __Pyx_GIVEREF(__pyx_v_NUMCHARS); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_NUMCHARS); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_arr = __pyx_t_1; __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4957 * raise ValueError("dtype must string or unicode ('S' or 'U')") * arr = numpy.zeros(NUMCHARS,dtype+'1') * arr[0:len(string)] = tuple(string) # <<<<<<<<<<<<<< * return arr * */ __pyx_t_1 = PySequence_Tuple(__pyx_v_string); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_Length(__pyx_v_string); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_PyObject_SetSlice(__pyx_v_arr, __pyx_t_1, 0, __pyx_t_7, NULL, NULL, NULL, 1, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "netCDF4/_netCDF4.pyx":4958 * arr = numpy.zeros(NUMCHARS,dtype+'1') * arr[0:len(string)] = tuple(string) * return arr # <<<<<<<<<<<<<< * * def stringtochar(a): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4937 * return basedate * * def stringtoarr(string,NUMCHARS,dtype='S'): # <<<<<<<<<<<<<< * """ * **`stringtoarr(a, NUMCHARS,dtype='S')`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("netCDF4._netCDF4.stringtoarr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_arr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4960 * return arr * * def stringtochar(a): # <<<<<<<<<<<<<< * """ * **`stringtochar(a)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_11stringtochar(PyObject *__pyx_self, PyObject *__pyx_v_a); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_10stringtochar[] = "\n**`stringtochar(a)`**\n\nconvert a string array to a character array with one extra dimension\n\n**`a`**: Input numpy string array with numpy datatype `'SN'` or `'UN'`, where N\nis the number of characters in each string. Will be converted to\nan array of characters (datatype `'S1'` or `'U1'`) of shape `a.shape + (N,)`.\n\nreturns a numpy character array with datatype `'S1'` or `'U1'`\nand shape `a.shape + (N,)`, where N is the length of each string in a."; static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_11stringtochar = {"stringtochar", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_11stringtochar, METH_O, __pyx_doc_7netCDF4_8_netCDF4_10stringtochar}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_11stringtochar(PyObject *__pyx_self, PyObject *__pyx_v_a) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stringtochar (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_10stringtochar(__pyx_self, ((PyObject *)__pyx_v_a)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_10stringtochar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a) { PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stringtochar", 0); /* "netCDF4/_netCDF4.pyx":4972 * returns a numpy character array with datatype `'S1'` or `'U1'` * and shape `a.shape + (N,)`, where N is the length of each string in a.""" * dtype = a.dtype.kind # <<<<<<<<<<<<<< * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4973 * and shape `a.shape + (N,)`, where N is the length of each string in a.""" * dtype = a.dtype.kind * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("type must string or unicode ('S' or 'U')") * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_2 = __pyx_v_dtype; __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_U, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":4974 * dtype = a.dtype.kind * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") # <<<<<<<<<<<<<< * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') * b.shape = a.shape + (a.itemsize,) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4973 * and shape `a.shape + (N,)`, where N is the length of each string in a.""" * dtype = a.dtype.kind * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("type must string or unicode ('S' or 'U')") * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') */ } /* "netCDF4/_netCDF4.pyx":4975 * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') # <<<<<<<<<<<<<< * b.shape = a.shape + (a.itemsize,) * return b */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_tostring); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (__pyx_t_8) { __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_v_dtype, __pyx_kp_s_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_t_1); __pyx_t_7 = 0; __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_b = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4976 * raise ValueError("type must string or unicode ('S' or 'U')") * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') * b.shape = a.shape + (a.itemsize,) # <<<<<<<<<<<<<< * return b * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_b, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "netCDF4/_netCDF4.pyx":4977 * b = numpy.array(tuple(a.tostring().decode(default_encoding)),dtype+'1') * b.shape = a.shape + (a.itemsize,) * return b # <<<<<<<<<<<<<< * * def chartostring(b): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_b); __pyx_r = __pyx_v_b; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4960 * return arr * * def stringtochar(a): # <<<<<<<<<<<<<< * """ * **`stringtochar(a)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("netCDF4._netCDF4.stringtochar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":4979 * return b * * def chartostring(b): # <<<<<<<<<<<<<< * """ * **`chartostring(b)`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_13chartostring(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_12chartostring[] = "\n**`chartostring(b)`**\n\nconvert a character array to a string array with one less dimension.\n\n**`b`**: Input character array (numpy datatype `'S1'` or `'U1'`).\nWill be converted to a array of strings, where each string has a fixed\nlength of `b.shape[-1]` characters.\n\nreturns a numpy string array with datatype `'SN'` or `'UN'` and shape\n`b.shape[:-1]` where where `N=b.shape[-1]`."; static PyMethodDef __pyx_mdef_7netCDF4_8_netCDF4_13chartostring = {"chartostring", (PyCFunction)__pyx_pw_7netCDF4_8_netCDF4_13chartostring, METH_O, __pyx_doc_7netCDF4_8_netCDF4_12chartostring}; static PyObject *__pyx_pw_7netCDF4_8_netCDF4_13chartostring(PyObject *__pyx_self, PyObject *__pyx_v_b) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chartostring (wrapper)", 0); __pyx_r = __pyx_pf_7netCDF4_8_netCDF4_12chartostring(__pyx_self, ((PyObject *)__pyx_v_b)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7netCDF4_8_netCDF4_12chartostring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) { PyObject *__pyx_v_dtype = NULL; PyObject *__pyx_v_bs = NULL; PyObject *__pyx_v_slen = NULL; PyObject *__pyx_v_a = NULL; PyObject *__pyx_v_n1 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chartostring", 0); /* "netCDF4/_netCDF4.pyx":4991 * returns a numpy string array with datatype `'SN'` or `'UN'` and shape * `b.shape[:-1]` where where `N=b.shape[-1]`.""" * dtype = b.dtype.kind # <<<<<<<<<<<<<< * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dtype = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4992 * `b.shape[:-1]` where where `N=b.shape[-1]`.""" * dtype = b.dtype.kind * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("type must string or unicode ('S' or 'U')") * bs = b.tostring().decode(default_encoding) */ __Pyx_INCREF(__pyx_v_dtype); __pyx_t_2 = __pyx_v_dtype; __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_S, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_U, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "netCDF4/_netCDF4.pyx":4993 * dtype = b.dtype.kind * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") # <<<<<<<<<<<<<< * bs = b.tostring().decode(default_encoding) * slen = int(b.shape[-1]) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "netCDF4/_netCDF4.pyx":4992 * `b.shape[:-1]` where where `N=b.shape[-1]`.""" * dtype = b.dtype.kind * if dtype not in ["S","U"]: # <<<<<<<<<<<<<< * raise ValueError("type must string or unicode ('S' or 'U')") * bs = b.tostring().decode(default_encoding) */ } /* "netCDF4/_netCDF4.pyx":4994 * if dtype not in ["S","U"]: * raise ValueError("type must string or unicode ('S' or 'U')") * bs = b.tostring().decode(default_encoding) # <<<<<<<<<<<<<< * slen = int(b.shape[-1]) * a = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],dtype+repr(slen)) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_tostring); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (__pyx_t_6) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_default_encoding); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } if (!__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_bs = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4995 * raise ValueError("type must string or unicode ('S' or 'U')") * bs = b.tostring().decode(default_encoding) * slen = int(b.shape[-1]) # <<<<<<<<<<<<<< * a = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],dtype+repr(slen)) * a.shape = b.shape[:-1] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_slen = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4996 * bs = b.tostring().decode(default_encoding) * slen = int(b.shape[-1]) * a = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],dtype+repr(slen)) # <<<<<<<<<<<<<< * a.shape = b.shape[:-1] * return a */ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyObject_Length(__pyx_v_bs); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_slen); __Pyx_GIVEREF(__pyx_v_slen); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_slen); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_n1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Add(__pyx_v_n1, __pyx_v_slen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_bs, 0, 0, &__pyx_v_n1, &__pyx_t_1, NULL, 0, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_Repr(__pyx_v_slen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = PyNumber_Add(__pyx_v_dtype, __pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_10); __pyx_t_5 = 0; __pyx_t_10 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_a = __pyx_t_2; __pyx_t_2 = 0; /* "netCDF4/_netCDF4.pyx":4997 * slen = int(b.shape[-1]) * a = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],dtype+repr(slen)) * a.shape = b.shape[:-1] # <<<<<<<<<<<<<< * return a * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, -1L, NULL, NULL, &__pyx_slice__108, 0, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_a, __pyx_n_s_shape, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "netCDF4/_netCDF4.pyx":4998 * a = numpy.array([bs[n1:n1+slen] for n1 in range(0,len(bs),slen)],dtype+repr(slen)) * a.shape = b.shape[:-1] * return a # <<<<<<<<<<<<<< * * def date2num(dates,units,calendar='standard'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_a); __pyx_r = __pyx_v_a; goto __pyx_L0; /* "netCDF4/_netCDF4.pyx":4979 * return b * * def chartostring(b): # <<<<<<<<<<<<<< * """ * **`chartostring(b)`** */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("netCDF4._netCDF4.chartostring", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dtype); __Pyx_XDECREF(__pyx_v_bs); __Pyx_XDECREF(__pyx_v_slen); __Pyx_XDECREF(__pyx_v_a); __Pyx_XDECREF(__pyx_v_n1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "netCDF4/_netCDF4.pyx":5000 * return a * * def date2num(dates,units,calendar='standard'): # <<<<<<<<<<<<<< * """ * **`date2num(dates,units,calendar='standard')`** */ /* Python wrapper */ static PyObject *__pyx_pw_7netCDF4_8_netCDF4_15date2num(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7netCDF4_8_netCDF4_14date2num[] = "\n**`date2num(dates,units,calendar='standard')`**\n\nReturn numeric time values given datetime objects. The units\nof the numeric time values are described by the `netCDF4.units` argument\nand the `netCDF4.calendar` keyword. The datetime objects must\nbe in UTC with no time-zone offset. If there is a\ntime-zone offset in `units`, it will be applied to the\nreturned numeric values.\n\n**`dates`**: A datetime object or a sequence of datetime objects.\nThe datetime objects should not include a time-zone offset.\n\n**`units`**: a string of the form `